[PATCH v5 04/10] libnvdimm/nvdimm/flush: Allow architecture to override the flush barrier

2020-06-09 Thread Aneesh Kumar K.V
Architectures like ppc64 provide persistent memory specific barriers that will ensure that all stores for which the modifications are written to persistent storage by preceding dcbfps and dcbstps instructions have updated persistent storage before any data access or data transfer caused by subseque

[PATCH v5 01/10] powerpc/pmem: Restrict papr_scm to P8 and above.

2020-06-09 Thread Aneesh Kumar K.V
The PAPR based virtualized persistent memory devices are only supported on POWER9 and above. In the followup patch, the kernel will switch the persistent memory cache flush functions to use a new `dcbf` variant instruction. The new instructions even though added in ISA 3.1 works even on P8 and P9 b

[PATCH v5 10/10] powerpc/pmem: Initialize pmem device on newer hardware

2020-06-09 Thread Aneesh Kumar K.V
With kernel now supporting new pmem flush/sync instructions, we can now enable the kernel to initialize the device. On P10 these devices would appear with a new compatible string. For PAPR device we have compatible "ibm,pmemory-v2" and for OF pmem device we have compatible "pmem-regi

[PATCH v5 09/10] powerpc/pmem: Disable synchronous fault by default

2020-06-09 Thread Aneesh Kumar K.V
This adds a kernel config option that controls whether MAP_SYNC is enabled by default. With POWER10, architecture is adding new pmem flush and sync instructions. The kernel should prevent the usage of MAP_SYNC if applications are not using the new instructions on newer hardware. This config allows

[PATCH v5 08/10] libnvdimm/dax: Add a dax flag to control synchronous fault support

2020-06-09 Thread Aneesh Kumar K.V
With POWER10, architecture is adding new pmem flush and sync instructions. The kernel should prevent the usage of MAP_SYNC if applications are not using the new instructions on newer hardware This patch adds a dax attribute (/sys/bus/nd/devices/region0/pfn0.1/block/pmem0/dax/sync_fault) which can

[PATCH v5 07/10] powerpc/book3s/pmem: Add WARN_ONCE to catch the wrong usage of pmem flush functions.

2020-06-09 Thread Aneesh Kumar K.V
We only support persistent memory on P8 and above. This is enforced by the firmware and further checked on virtualzied platform during platform init. Add WARN_ONCE in pmem flush routines to catch the wrong usage of these. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cacheflush.h

[PATCH v5 06/10] powerpc/pmem: Avoid the barrier in flush routines

2020-06-09 Thread Aneesh Kumar K.V
nvdimm expect the flush routines to just mark the cache clean. The barrier that mark the store globally visible is done in nvdimm_flush(). Update the papr_scm driver to a simplified nvdim_flush callback that do only the required barrier. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/lib/pmem

[PATCH v5 05/10] powerpc/pmem/of_pmem: Update of_pmem to use the new barrier instruction.

2020-06-09 Thread Aneesh Kumar K.V
of_pmem on POWER10 can now use phwsync instead of hwsync to ensure all previous writes are architecturally visible for the platform buffer flush. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cacheflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/incl

[PATCH v5 02/10] powerpc/pmem: Add new instructions for persistent storage and sync

2020-06-09 Thread Aneesh Kumar K.V
POWER10 introduces two new variants of dcbf instructions (dcbstps and dcbfps) that can be used to write modified locations back to persistent storage. Additionally, POWER10 also introduce phwsync and plwsync which can be used to establish order of these writes to persistent storage. This patch ex

[PATCH v5 03/10] powerpc/pmem: Add flush routines using new pmem store and sync instruction

2020-06-09 Thread Aneesh Kumar K.V
Start using dcbstps; phwsync; sequence for flushing persistent memory range. The new instructions are implemented as a variant of dcbf and hwsync and on P8 and P9 they will be executed as those instructions. We avoid using them on older hardware. This helps to avoid difficult to debug bugs. Signed

[PATCH v5 00/10] Support new pmem flush and sync instructions for POWER

2020-06-09 Thread Aneesh Kumar K.V
This patch series enables the usage os new pmem flush and sync instructions on POWER architecture. POWER10 introduces two new variants of dcbf instructions (dcbstps and dcbfps) that can be used to write modified locations back to persistent storage. Additionally, POWER10 also introduce phwsync a

Re: ipr crashes due to NULL dma_need_drain since cc97923a5bcc ("block: move dma drain handling to scsi")

2020-06-09 Thread Michael Ellerman
Christoph Hellwig writes: > Can you try this patch? > > --- > From 1c9913360a0494375c5655b133899cb4323bceb4 Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Tue, 9 Jun 2020 14:07:31 +0200 > Subject: scsi: wire up ata_scsi_dma_need_drain for SAS HBA drivers > > We need ata_scsi_dma_need_

Re: [PATCH v3 0/7] Base support for POWER10

2020-06-09 Thread Michael Ellerman
Murilo Opsfelder Araújo writes: > On Tue, Jun 09, 2020 at 03:28:31PM +1000, Michael Ellerman wrote: >> On Thu, 21 May 2020 11:43:34 +1000, Alistair Popple wrote: >> > This series brings together several previously posted patches required for >> > POWER10 support and introduces a new patch enabling

Re: [PATCH 2/6] powerpc/ppc-opcode: move ppc instruction encoding from test_emulate_step

2020-06-09 Thread Sandipan Das
On 26/05/20 1:45 pm, Balamuruhan S wrote: > Few ppc instructions are encoded in test_emulate_step.c, consolidate > them and use it from ppc-opcode.h > > Signed-off-by: Balamuruhan S > Acked-by: Naveen N. Rao > Tested-by: Naveen N. Rao > --- > arch/powerpc/include/asm/ppc-opcode.h | 35 +

Re: [PATCH 4/6] powerpc/ppc-opcode: consolidate powerpc instructions from bpf_jit.h

2020-06-09 Thread Sandipan Das
On 26/05/20 1:45 pm, Balamuruhan S wrote: > move macro definitions of powerpc instructions from bpf_jit.h to ppc-opcode.h > and adopt the users of the macros accordingly. `PPC_MR()` is defined twice in > bpf_jit.h, remove the duplicate one. > > Signed-off-by: Balamuruhan S > Acked-by: Naveen N.

Re: [PATCH 3/6] powerpc/bpf_jit: reuse instruction macros from ppc-opcode.h

2020-06-09 Thread Sandipan Das
On 26/05/20 1:45 pm, Balamuruhan S wrote: > remove duplicate macro definitions from bpf_jit.h and reuse the macros from > ppc-opcode.h > > Signed-off-by: Balamuruhan S > Acked-by: Naveen N. Rao > Tested-by: Naveen N. Rao > --- > arch/powerpc/net/bpf_jit.h| 18 +- > ar

Re: [PATCH] powerpc/pseries/svm: Fixup align argument in alloc_shared_lppaca() function

2020-06-09 Thread Thiago Jung Bauermann
Satheesh Rajendran writes: > Argument "align" in alloc_shared_lppaca() function was unused inside the > function. Let's fix it and update code comment. > > Cc: linux-ker...@vger.kernel.org > Cc: Thiago Jung Bauermann > Cc: Ram Pai > Cc: Sukadev Bhattiprolu > Cc: Laurent Dufour > Signed-off-

Re: [PATCH] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

2020-06-09 Thread Thiago Jung Bauermann
Satheesh Rajendran writes: > Early secure guest boot hits the below crash while booting with > vcpus numbers aligned with page boundary for PAGE size of 64k > and LPPACA size of 1k i.e 64, 128 etc, due to the BUG_ON assert > for shared_lppaca_total_size equal to shared_lppaca_size, > > [0.

Re: [PATCH] ibmvscsi: don't send host info in adapter info MAD after LPM

2020-06-09 Thread Martin K. Petersen
On Wed, 3 Jun 2020 15:36:32 -0500, Tyrel Datwyler wrote: > The adatper info MAD is used to send the client info and receive the > host info as a response. A peristent buffer is used and as such the > client info is overwritten after the response. During the course of > a normal adapter reset the c

PowerPC KVM-PR issue

2020-06-09 Thread Christian Zigotzky
Hello, KVM-PR doesn't work anymore on my Nemo board [1]. I figured out that the Git kernels and the kernel 5.7 are affected. Error message: Fienix kernel: kvmppc_exit_pr_progint: emulation at 700 failed () I can boot virtual QEMU PowerPC machines with KVM-PR with the kernel 5.6 wit

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-09 Thread Dan Williams
On Tue, Jun 9, 2020 at 10:54 AM Vaibhav Jain wrote: > > Thanks Dan for the consideration and taking time to look into this. > > My responses below: > > Dan Williams writes: > > > On Mon, Jun 8, 2020 at 5:16 PM kernel test robot wrote: > >> > >> Hi Vaibhav, > >> > >> Thank you for the patch! Perh

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-09 Thread Vaibhav Jain
Thanks Dan for the consideration and taking time to look into this. My responses below: Dan Williams writes: > On Mon, Jun 8, 2020 at 5:16 PM kernel test robot wrote: >> >> Hi Vaibhav, >> >> Thank you for the patch! Perhaps something to improve: >> >> [auto build test WARNING on powerpc/next]

Re: [PATCH v3 0/7] Base support for POWER10

2020-06-09 Thread Murilo Opsfelder Araújo
On Tue, Jun 09, 2020 at 03:28:31PM +1000, Michael Ellerman wrote: > On Thu, 21 May 2020 11:43:34 +1000, Alistair Popple wrote: > > This series brings together several previously posted patches required for > > POWER10 support and introduces a new patch enabling POWER10 architected > > mode to enabl

Re: [PATCH v12 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-09 Thread kernel test robot
imm-health/20200609-051451 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-randconfig-r031-20200608 (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project bc2b70982be8f5250cd0082a7190f8b417bd4dfe) reproduce (this is a

Re: [musl] ppc64le and 32-bit LE userland compatibility

2020-06-09 Thread Rich Felker
On Tue, Jun 09, 2020 at 10:29:57AM +, Will Springer wrote: > On Saturday, May 30, 2020 3:56:47 PM PDT you wrote: > > On Friday, May 29, 2020 12:24:27 PM PDT Rich Felker wrote: > > > The argument passing for pread/pwrite is historically a mess and > > > differs between archs. musl has a dedicate

Re: [PATCH] mm: Move p?d_alloc_track to separate header file

2020-06-09 Thread Stephen Rothwell
Hi Christophe, On Tue, 9 Jun 2020 17:24:14 +0200 Christophe Leroy wrote: > > Le 09/06/2020 à 14:05, Joerg Roedel a écrit : > > From: Joerg Roedel > > > > The functions are only used in two source files, so there is no need > > for them to be in the global header. Move them to the new > > hea

Re: ipr crashes due to NULL dma_need_drain since cc97923a5bcc ("block: move dma drain handling to scsi")

2020-06-09 Thread Christoph Hellwig
Can you try this patch? --- >From 1c9913360a0494375c5655b133899cb4323bceb4 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 9 Jun 2020 14:07:31 +0200 Subject: scsi: wire up ata_scsi_dma_need_drain for SAS HBA drivers We need ata_scsi_dma_need_drain for all drivers wired up to drive AT

Re: [PATCH] mm: Move p?d_alloc_track to separate header file

2020-06-09 Thread Christophe Leroy
Le 09/06/2020 à 14:05, Joerg Roedel a écrit : From: Joerg Roedel The functions are only used in two source files, so there is no need for them to be in the global header. Move them to the new header and include it only where needed. Do you mean we will now create a new header file for an

Re: [PATCH] mm: Move p?d_alloc_track to separate header file

2020-06-09 Thread Mike Rapoport
On Tue, Jun 09, 2020 at 02:05:33PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > The functions are only used in two source files, so there is no need > for them to be in the global header. Move them to the new > header and include it only where needed. > > Signed-off-by: Joerg Roedel A

[PATCH 00/17] spelling.txt: /decriptors/descriptors/

2020-06-09 Thread Kieran Bingham
I wouldn't normally go through spelling fixes, but I caught sight of this typo twice, and then foolishly grepped the tree for it, and saw how pervasive it was. so here I am ... fixing a typo globally... but with an addition in scripts/spelling.txt so it shouldn't re-appear ;-) Cc: linux-arm-ker..

[PATCH 06/17] drivers: scsi: Fix trivial spelling

2020-06-09 Thread Kieran Bingham
The word 'descriptor' is misspelled throughout the tree. Fix it up accordingly: decriptors -> descriptors Signed-off-by: Kieran Bingham --- drivers/scsi/ibmvscsi/ibmvfc.c| 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/qla2xxx/qla_inline.h | 2 +- drivers/scsi/qla2xxx/qla_

Re: Add a new fchmodat4() syscall, v2

2020-06-09 Thread Florian Weimer
* Palmer Dabbelt: > This patch set adds fchmodat4(), a new syscall. The actual > implementation is super simple: essentially it's just the same as > fchmodat(), but LOOKUP_FOLLOW is conditionally set based on the flags. > I've attempted to make this match "man 2 fchmodat" as closely as > possible,

Re: [RFC PATCH] ASoC: fsl_asrc_dma: Fix warning "Cannot create DMA dma:tx symlink"

2020-06-09 Thread Mark Brown
On Mon, Jun 08, 2020 at 03:07:00PM +0800, Shengjiu Wang wrote: > The issue log is: > > [ 48.021506] CPU: 0 PID: 664 Comm: aplay Not tainted > 5.7.0-rc1-13120-g12b434cbbea0 #343 > [ 48.031063] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > [ 48.037638] [] (unwind_backtrace) fro

Re: [PATCH] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

2020-06-09 Thread Laurent Dufour
Le 09/06/2020 à 12:57, Satheesh Rajendran a écrit : Early secure guest boot hits the below crash while booting with vcpus numbers aligned with page boundary for PAGE size of 64k and LPPACA size of 1k i.e 64, 128 etc, due to the BUG_ON assert for shared_lppaca_total_size equal to shared_lppaca_siz

[PATCH] mm: Move p?d_alloc_track to separate header file

2020-06-09 Thread Joerg Roedel
From: Joerg Roedel The functions are only used in two source files, so there is no need for them to be in the global header. Move them to the new header and include it only where needed. Signed-off-by: Joerg Roedel --- include/linux/mm.h| 45 --- inclu

Re: ipr crashes due to NULL dma_need_drain since cc97923a5bcc ("block: move dma drain handling to scsi")

2020-06-09 Thread Christoph Hellwig
On Tue, Jun 09, 2020 at 08:00:35PM +1000, Michael Ellerman wrote: > Hi all, > > I'm seeing crashes on powerpc with the ipr driver, which I'm fairly sure > are due to dma_need_drain being NULL. Ooops, my changes completely forgot about SAS attached ATAPI devices. I'll cook up a fix in a bit.

[PATCH] powerpc/pseries/svm: Fixup align argument in alloc_shared_lppaca() function

2020-06-09 Thread Satheesh Rajendran
Argument "align" in alloc_shared_lppaca() function was unused inside the function. Let's fix it and update code comment. Cc: linux-ker...@vger.kernel.org Cc: Thiago Jung Bauermann Cc: Ram Pai Cc: Sukadev Bhattiprolu Cc: Laurent Dufour Signed-off-by: Satheesh Rajendran --- arch/powerpc/kernel

[PATCH] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

2020-06-09 Thread Satheesh Rajendran
Early secure guest boot hits the below crash while booting with vcpus numbers aligned with page boundary for PAGE size of 64k and LPPACA size of 1k i.e 64, 128 etc, due to the BUG_ON assert for shared_lppaca_total_size equal to shared_lppaca_size, [0.00] Partition configured for 64 cpus.

Re: [musl] ppc64le and 32-bit LE userland compatibility

2020-06-09 Thread Will Springer
On Saturday, May 30, 2020 3:56:47 PM PDT you wrote: > On Friday, May 29, 2020 12:24:27 PM PDT Rich Felker wrote: > > The argument passing for pread/pwrite is historically a mess and > > differs between archs. musl has a dedicated macro that archs can > > define to override it. But it looks like it

Re: [PATCH v3] selftests: powerpc: Fix CPU affinity for child process

2020-06-09 Thread Satheesh Rajendran
On Tue, Jun 09, 2020 at 01:44:23PM +0530, Harish wrote: > On systems with large number of cpus, test fails trying to set > affinity by calling sched_setaffinity() with smaller size for > affinity mask. This patch fixes it by making sure that the size of > allocated affinity mask is dependent on the

ipr crashes due to NULL dma_need_drain since cc97923a5bcc ("block: move dma drain handling to scsi")

2020-06-09 Thread Michael Ellerman
Hi all, I'm seeing crashes on powerpc with the ipr driver, which I'm fairly sure are due to dma_need_drain being NULL. The backtrace is: scsi_init_io+0x1d8/0x350 scsi_queue_rq+0x7a4/0xc30 blk_mq_dispatch_rq_list+0x1b0/0x910 blk_mq_sched_dispatch_requests+0x154/0x270 __blk_mq_run_hw_que

Re: [PATCH v3] selftests: powerpc: Fix CPU affinity for child process

2020-06-09 Thread Kamalesh Babulal
On 6/9/20 1:44 PM, Harish wrote: > On systems with large number of cpus, test fails trying to set > affinity by calling sched_setaffinity() with smaller size for > affinity mask. This patch fixes it by making sure that the size of > allocated affinity mask is dependent on the number of CPUs as > re

[PATCH] ASoC: fsl_ssi: Fix bclk calculation for mono channel

2020-06-09 Thread Shengjiu Wang
For mono channel, ssi will switch to normal mode. In normal mode, the Word Length Control bits control the word length divider in clock generator, which is different with I2S master mode, the word length is fixed to 32bit. So we refine the famula for mono channel, otherwise there will be sound iss

[PATCH v3] selftests: powerpc: Fix CPU affinity for child process

2020-06-09 Thread Harish
On systems with large number of cpus, test fails trying to set affinity by calling sched_setaffinity() with smaller size for affinity mask. This patch fixes it by making sure that the size of allocated affinity mask is dependent on the number of CPUs as reported by get_nprocs(). Fixes: 00b7ec5c9cf

[PATCH v2] selftests: powerpc: Fix online CPU selection

2020-06-09 Thread Sandipan Das
The size of the CPU affinity mask must be large enough for systems with a very large number of CPUs. Otherwise, tests which try to determine the first online CPU by calling sched_getaffinity() will fail. This makes sure that the size of the allocated affinity mask is dependent on the number of CPUs

Re: [PATCH] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

2020-06-09 Thread Laurent Dufour
Le 09/06/2020 à 07:38, sathn...@linux.vent.ibm.com a écrit : From: Satheesh Rajendran Early secure guest boot hits the below crash while booting with vcpus numbers aligned with page boundary for PAGE size of 64k and LPPACA size of 1k i.e 64, 128 etc, due to the BUG_ON assert for shared_lppaca_t

Re: [PATCH v2] selftests: powerpc: Fix CPU affinity for child process

2020-06-09 Thread Kamalesh Babulal
On 6/9/20 9:10 AM, Harish wrote: > On systems with large number of cpus, test fails trying to set > affinity for child process by calling sched_setaffinity() with > smaller size for cpuset. This patch fixes it by making sure that > the size of allocated cpu set is dependent on the number of CPUs >

[PATCH 7/7] powerpc/64s: advertise hardware link stack flush

2020-06-09 Thread Nicholas Piggin
For testing only at the moment, firmware does not define these bits. --- arch/powerpc/include/asm/hvcall.h | 1 + arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kvm/powerpc.c| 9 +++-- arch/powerpc/platforms/powernv/setup.c| 3 +++ arch/powerpc/platfo

[PATCH 6/7] powerpc/security: Allow for processors that flush the link stack using the special bcctr

2020-06-09 Thread Nicholas Piggin
If both count cache and link stack are to be flushed, and can be flushed with the special bcctr, patch that in directly to the flush/branch nop site. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/security_features.h | 2 ++ arch/powerpc/kernel/security.c | 27 +++

[PATCH 5/7] powerpc/64s: Move branch cache flushing bcctr variant to ppc-ops.h

2020-06-09 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/kernel/entry_64.S| 6 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 2a39c716c343..79d5

[PATCH 4/7] powerpc/security: split branch cache flush toggle from code patching

2020-06-09 Thread Nicholas Piggin
Branch cache flushing code patching has inter-dependencies on both the link stack and the count cache flushing state. To make the code clearer and to separate the link stack and count cache handling, split the "toggle" (setting up variables and printing enable/disable) from the code patching. Sig

[PATCH 3/7] powerpc/security: make display of branch cache flush more consistent

2020-06-09 Thread Nicholas Piggin
Make the count-cache and link-stack messages look the same Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/security.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index 28f4cb062f69..659ef6a92bb

[PATCH 2/7] powerpc/security: change link stack flush state to the flush type enum

2020-06-09 Thread Nicholas Piggin
Prepare to allow for hardware link stack flushing by using the none/sw/hw type, same as the count cache state. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/security.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/security.c b/arch/po

[PATCH 1/7] powerpc/security: re-name count cache flush to branch cache flush

2020-06-09 Thread Nicholas Piggin
The count cache flush mostly refers to both count cache and link stack flushing. As a first step to untangling these a bit, re-name the bits that apply to both. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 4 +-- arch/powerpc/kernel/entry_64.S| 7 +

[PATCH 0/7] powerpc: branch cache flush changes

2020-06-09 Thread Nicholas Piggin
This series allows the link stack to be flushed with the speical bcctr 2,0,0 flush instruction that also flushes the count cache if the processor supports it. Firmware does not support this at the moment, but I've tested it in simulator with a patched firmware to advertise support. Thanks, Nick

Re: [PATCH v2] selftests: powerpc: Fix CPU affinity for child process

2020-06-09 Thread Satheesh Rajendran
On Tue, Jun 09, 2020 at 09:10:05AM +0530, Harish wrote: > On systems with large number of cpus, test fails trying to set > affinity for child process by calling sched_setaffinity() with > smaller size for cpuset. This patch fixes it by making sure that > the size of allocated cpu set is dependent

Re: [PATCH] selftests: powerpc: Fix online CPU selection

2020-06-09 Thread Sandipan Das
On 08/06/20 8:12 pm, Sandipan Das wrote: > The size of the cpu set must be large enough for systems > with a very large number of CPUs. Otherwise, tests which > try to determine the first online CPU by calling > sched_getaffinity() will fail. This makes sure that the > size of the allocated cpu

[PATCH 7/7] powerpc/64s: advertise hardware link stack flush

2020-06-09 Thread Nicholas Piggin
For testing only at the moment, firmware does not define these bits. --- arch/powerpc/include/asm/hvcall.h | 1 + arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kvm/powerpc.c| 9 +++-- arch/powerpc/platforms/powernv/setup.c| 3 +++ arch/powerpc/platfo

[PATCH 6/7] powerpc/security: Allow for processors that flush the link stack using the special bcctr

2020-06-09 Thread Nicholas Piggin
If both count cache and link stack are to be flushed, and can be flushed with the special bcctr, patch that in directly to the flush/branch nop site. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/security_features.h | 2 ++ arch/powerpc/kernel/security.c | 27 +++

[PATCH 5/7] powerpc/64s: Move branch cache flushing bcctr variant to ppc-ops.h

2020-06-09 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/kernel/entry_64.S| 6 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 2a39c716c343..79d5

[PATCH 4/7] powerpc/security: split branch cache flush toggle from code patching

2020-06-09 Thread Nicholas Piggin
Branch cache flushing code patching has inter-dependencies on both the link stack and the count cache flushing state. To make the code clearer and to separate the link stack and count cache handling, split the "toggle" (setting up variables and printing enable/disable) from the code patching. Sig

[PATCH 3/7] powerpc/security: make display of branch cache flush more consistent

2020-06-09 Thread Nicholas Piggin
Make the count-cache and link-stack messages look the same Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/security.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index 28f4cb062f69..659ef6a92bb

[PATCH 2/7] powerpc/security: change link stack flush state to the flush type enum

2020-06-09 Thread Nicholas Piggin
Prepare to allow for hardware link stack flushing by using the none/sw/hw type, same as the count cache state. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/security.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/security.c b/arch/po

[PATCH 1/7] powerpc/security: re-name count cache flush to branch cache flush

2020-06-09 Thread Nicholas Piggin
The count cache flush mostly refers to both count cache and link stack flushing. As a first step to untangling these a bit, re-name the bits that apply to both. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 4 +-- arch/powerpc/kernel/entry_64.S| 7 +

[PATCH 0/7] powerpc: branch cache flush changes

2020-06-09 Thread Nicholas Piggin
This series allows the link stack to be flushed with the speical bcctr 2,0,0 flush instruction that also flushes the count cache if the processor supports it. Firmware does not support this at the moment, but I've tested it in simulator with a patched firmware to advertise support. Thanks, Nick

Re: [PATCH] selftests: powerpc: Fix online CPU selection

2020-06-09 Thread Sandipan Das
On 08/06/20 8:12 pm, Sandipan Das wrote: > The size of the cpu set must be large enough for systems > with a very large number of CPUs. Otherwise, tests which > try to determine the first online CPU by calling > sched_getaffinity() will fail. This makes sure that the > size of the allocated cpu

Re: [PATCH] powerpc/powernv: Fix a warning message

2020-06-09 Thread Michael Ellerman
On Sat, 2020-05-02 at 11:59:49 UTC, Christophe JAILLET wrote: > Fix a cut'n'paste error in a warning message. This should be > 'cpu-idle-state-residency-ns' to match the property searched in the > previous 'of_property_read_u32_array()' > > Fixes: 9c7b185ab2fe ("powernv/cpuidle: Parse dt idle prop

Re: [PATCH v3 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2020-06-09 Thread Michael Ellerman
On Tue, 2019-04-02 at 20:47:22 UTC, Andrey Abramov wrote: > Replace relaswap with built-in one, because relaswap > does a simple byte to byte swap. > > Since Spectre mitigations have made indirect function calls more > expensive, and the default simple byte copies swap is implemented > without the

Re: [PATCH v3 7/9] powerpc/ps3: Add check for otheros image size

2020-06-09 Thread Michael Ellerman
On Sat, 2020-05-16 at 16:20:46 UTC, Geoff Levand wrote: > The ps3's otheros flash loader has a size limit of 16 MiB for the > uncompressed image. If that limit will be reached output the > flash image file as 'otheros-too-big.bld'. > > Signed-off-by: Geoff Levand Applied to powerpc next, thanks

Re: [PATCH 0/6] assorted kuap fixes (try again)

2020-06-09 Thread Michael Ellerman
On Wed, 29 Apr 2020 16:56:48 +1000, Nicholas Piggin wrote: > Well the last series was a disaster, I'll try again sending the > patches with proper subject and changelogs written. > > Nicholas Piggin (6): > powerpc/64/kuap: move kuap checks out of MSR[RI]=0 regions of exit > code > powerpc/