Re: [PATCH v2 1/3] powerpc/pseries: Parse control memory access error

2021-08-23 Thread Michael Ellerman
Hi Ganesh, Some comments below ... Ganesh Goudar writes: > Add support to parse and log control memory access > error for pseries. > > Signed-off-by: Ganesh Goudar > --- > v2: No changes in this patch. > --- > arch/powerpc/platforms/pseries/ras.c | 21 + > 1 file changed, 2

Re: [PATCH v5 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-08-23 Thread Alexey Kardashevskiy
On 17/08/2021 16:12, Leonardo Brás wrote: On Tue, 2021-08-17 at 02:59 -0300, Leonardo Brás wrote: Hello Fred, thanks for the feedback! On Tue, 2021-07-20 at 19:51 +0200, Frederic Barrat wrote: On 16/07/2021 10:27, Leonardo Bras wrote: Update remove_dma_window() so it can be used to remov

Re: [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag

2021-08-23 Thread Martin K. Petersen
On Tue, 17 Aug 2021 21:43:37 +0800, John Garry wrote: > Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag. > > > > Applied to 5.15/scsi-queue, thanks! [1/1] scsi: ibmvfc: Stop using scsi_cmnd.tag https://git.kernel.org/mkp/scsi/c/6a036ce0e25c -- Martin K. Petersen

Re: [PATCH v2 5/5] KVM: selftests: Remove __NR_userfaultfd syscall fallback

2021-08-23 Thread Ben Gardon
On Fri, Aug 20, 2021 at 3:50 PM Sean Christopherson wrote: > > Revert the __NR_userfaultfd syscall fallback added for KVM selftests now > that x86's unistd_{32,63}.h overrides are under uapi/ and thus not in > KVM sefltests' search path, i.e. now that KVM gets x86 syscall numbers > from the instal

Re: [PATCH] powerpc/32: Don't use lmw/stmw for saving/restoring non volatile regs

2021-08-23 Thread Christophe Leroy
Le 23/08/2021 à 20:46, Segher Boessenkool a écrit : On Mon, Aug 23, 2021 at 03:29:12PM +, Christophe Leroy wrote: Instructions lmw/stmw are interesting for functions that are rarely used and not in the cache, because only one instruction is to be copied into the instruction cache instead

Re: linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Aneesh Kumar K.V
Stephen Rothwell writes: > Hi all, > > [cc'ing Jon in case he can fix the sphix hang - or knows anything about it] > > On Mon, 23 Aug 2021 19:55:40 +1000 Stephen Rothwell > wrote: >> >> After merging the powerpc tree, today's linux-next build (htmldocs) >> produced this warning: >> > > I misse

[PATCH linux-next] selftests/powerpc: remove duplicate include

2021-08-23 Thread CGEL
From: Changcheng Deng Clean up the following includecheck warning: ./tools/testing/selftests/powerpc/tm/tm-poison.c: inttypes.h is included more than once. No functional change. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng --- tools/testing/selftests/powerpc/tm/tm-poison.c | 1 -

Re: linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Stephen Rothwell
Hi Jona, On Mon, 23 Aug 2021 08:19:30 -0600 Jonathan Corbet wrote: > > Stephen Rothwell writes: > > > Hi all, > > > > [cc'ing Jon in case he can fix the sphix hang - or knows anything about it] > > > > That's new to me. Which version of sphinx? 3.4.3-2, its a Debian version. -- Cheers,

Re: [PATCH v2 1/3] powerpc/pseries: Parse control memory access error

2021-08-23 Thread Ganesh
Hi mpe, Any comments on this patchset? On 8/5/21 2:50 PM, Ganesh Goudar wrote: Add support to parse and log control memory access error for pseries. Signed-off-by: Ganesh Goudar --- v2: No changes in this patch. --- arch/powerpc/platforms/pseries/ras.c | 21 + 1 file ch

Re: [PATCH] powerpc/booke: Avoid link stack corruption in several places

2021-08-23 Thread Segher Boessenkool
On Mon, Aug 23, 2021 at 07:05:38PM +0200, Christophe Leroy wrote: > Le 23/08/2021 à 17:58, Segher Boessenkool a écrit : > >On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote: > >> /* Be careful, this will clobber the lr register. */ > >> #define LOAD_REG_ADDR_PIC(reg, name)

Re: [PATCH] powerpc/32: Don't use lmw/stmw for saving/restoring non volatile regs

2021-08-23 Thread Segher Boessenkool
On Mon, Aug 23, 2021 at 03:29:12PM +, Christophe Leroy wrote: > Instructions lmw/stmw are interesting for functions that are rarely > used and not in the cache, because only one instruction is to be > copied into the instruction cache instead of 19. However those > instruction are less performa

Re: [PATCH] powerpc/booke: Avoid link stack corruption in several places

2021-08-23 Thread Christophe Leroy
Le 23/08/2021 à 17:58, Segher Boessenkool a écrit : On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote: /* Be careful, this will clobber the lr register. */ #define LOAD_REG_ADDR_PIC(reg, name) \ - bl 0f; \ + bcl 20,3

Re: [PATCH] powerpc/booke: Avoid link stack corruption in several places

2021-08-23 Thread Segher Boessenkool
On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote: > /* Be careful, this will clobber the lr register. */ > #define LOAD_REG_ADDR_PIC(reg, name) \ > - bl 0f; \ > + bcl 20,31,0f\ > 0: mflrreg;

[PATCH v2 5/5] powerpc/signal: Use unsafe_copy_siginfo_to_user()

2021-08-23 Thread Christophe Leroy
Use unsafe_copy_siginfo_to_user() in order to do the copy within the user access block. On an mpc 8321 (book3s/32) the improvment is about 5% on a process sending a signal to itself. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 13 ++--- arch/powerpc/kernel/sign

[PATCH v2 4/5] powerpc/uaccess: Add unsafe_clear_user()

2021-08-23 Thread Christophe Leroy
Implement unsafe_clear_user() for powerpc. It's a copy/paste of unsafe_copy_to_user() with value 0 as source. It may be improved in a later patch by using 'dcbz' instruction to zeroize full cache lines at once. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/uaccess.h | 20

[PATCH v2 3/5] signal: Add unsafe_copy_siginfo_to_user()

2021-08-23 Thread Christophe Leroy
In the same spirit as commit fb05121fd6a2 ("signal: Add unsafe_get_compat_sigset()"), implement an 'unsafe' version of copy_siginfo_to_user() in order to use it within user access blocks. For that, also add an 'unsafe' version of clear_user(). Signed-off-by: Christophe Leroy --- include/linux/s

[PATCH v2 2/5] powerpc/signal: Include the new stack frame inside the user access block

2021-08-23 Thread Christophe Leroy
Include the new stack frame inside the user access block and set it up using unsafe_put_user(). On an mpc 8321 (book3s/32) the improvment is about 4% on a process sending a signal to itself. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 29 +

[PATCH v2 1/5] powerpc/signal64: Access function descriptor with user access block

2021-08-23 Thread Christophe Leroy
Access the function descriptor of the handler within a user access block. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_64.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c inde

[PATCH] powerpc/32: Don't use lmw/stmw for saving/restoring non volatile regs

2021-08-23 Thread Christophe Leroy
Instructions lmw/stmw are interesting for functions that are rarely used and not in the cache, because only one instruction is to be copied into the instruction cache instead of 19. However those instruction are less performant than 19x raw lwz/stw as they require synchronisation plus one additiona

[PATCH v2] powerpc/booke: Avoid link stack corruption in several places

2021-08-23 Thread Christophe Leroy
Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy --- v2: Added missing ; in LOAD_REG_ADDR_PIC() --- arch/powerpc/include/asm/ppc_asm.h

[PATCH v3 2/2] powerpc/32s: Save content of sr0 to avoid 'mfsr'

2021-08-23 Thread Christophe Leroy
Calling 'mfsr' to get the content of segment registers is heavy, in addition it requires clearing of the 'reserved' bits. In order to avoid this operation, save it in mm context and in thread struct. The saved sr0 is the one used by kernel, this means that on locking entry it can be used as is.

[PATCH v3 1/2] powerpc/32s: Do kuep_lock() and kuep_unlock() in assembly

2021-08-23 Thread Christophe Leroy
When interrupt and syscall entries where converted to C, KUEP locking and unlocking was also converted. It improved performance by unrolling the loop, and allowed easily implementing boot time deactivation of KUEP. However, null_syscall selftest shows that KUEP is still heavy (361 cycles with KUEP

Re: [PATCH v2 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-23 Thread Mathieu Desnoyers
[ re-send to Darren Hart ] - On Aug 23, 2021, at 11:18 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Aug 20, 2021, at 6:50 PM, Sean Christopherson sea...@google.com > wrote: > >> Add a test to verify an rseq's CPU ID is updated correctly if the task is >> migrated

Re: [PATCH v2 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-23 Thread Mathieu Desnoyers
- On Aug 20, 2021, at 6:50 PM, Sean Christopherson sea...@google.com wrote: > Add a test to verify an rseq's CPU ID is updated correctly if the task is > migrated while the kernel is handling KVM_RUN. This is a regression test > for a bug introduced by commit 72c3c0fe54a3 ("x86/kvm: Use gener

Re: [PATCH v2 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest

2021-08-23 Thread Mathieu Desnoyers
- On Aug 20, 2021, at 6:49 PM, Sean Christopherson sea...@google.com wrote: > Invoke rseq's NOTIFY_RESUME handler when processing the flag prior to > transferring to a KVM guest, which is roughly equivalent to an exit to > userspace and processes many of the same pending actions. While the ta

Re: linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Jonathan Corbet
Stephen Rothwell writes: > Hi all, > > [cc'ing Jon in case he can fix the sphix hang - or knows anything about it] That's new to me. Which version of sphinx? jon

Re: [PATCH v2 1/2] KVM: Refactor kvm_arch_vcpu_fault() to return a struct page pointer

2021-08-23 Thread Christian Borntraeger
On 12.08.21 11:04, David Hildenbrand wrote: On 12.08.21 06:02, Hou Wenlong wrote: From: Sean Christopherson Refactor kvm_arch_vcpu_fault() to return 'struct page *' instead of 'vm_fault_t' to simplify architecture specific implementations that do more than return SIGBUS.  Currently this onl

Re: [PATCH v3] PCI: Move pci_dev_is/assign_added() to pci.h

2021-08-23 Thread Niklas Schnelle
On Fri, 2021-08-20 at 17:37 -0500, Bjorn Helgaas wrote: > On Tue, Jul 20, 2021 at 05:01:45PM +0200, Niklas Schnelle wrote: > > The helper function pci_dev_is_added() from drivers/pci/pci.h is used in > > PCI arch code of both s390 and powerpc leading to awkward relative > > includes. Move it to the

Re: linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Stephen Rothwell
Hi all, [cc'ing Jon in case he can fix the sphix hang - or knows anything about it] On Mon, 23 Aug 2021 19:55:40 +1000 Stephen Rothwell wrote: > > After merging the powerpc tree, today's linux-next build (htmldocs) > produced this warning: > I missed a line: Sphinx parallel build error: > d

[PATCH] powerpc/32s: Fix random crashes by adding isync() after locking/unlocking KUEP

2021-08-23 Thread Christophe Leroy
Backport for kernel 5.13 (cherry picked from commit ef486bf448a057a6e2d50e40ae879f7add6585da) Commit b5efec00b671 ("powerpc/32s: Move KUEP locking/unlocking in C") removed the 'isync' instruction after adding/removing NX bit in user segments. The reasoning behind this change was that when setting

Re: [PATCH 1/3] powerpc/smp: Fix a crash while booting kvm guest with nr_cpus=2

2021-08-23 Thread Srikar Dronamraju
* Gautham R Shenoy [2021-08-23 11:41:22]: > On Sat, Aug 21, 2021 at 02:54:17PM +0530, Srikar Dronamraju wrote: > > Aneesh reported a crash with a fairly recent upstream kernel when > > booting kernel whose commandline was appended with nr_cpus=2 > > > > 1:mon> e > > cpu 0x1: Vector: 300 (Data Ac

linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Stephen Rothwell
Hi all, After merging the powerpc tree, today's linux-next build (htmldocs) produced this warning: docutils.utils.SystemMessage: Documentation/powerpc/associativity.rst:1: (SEVERE/4) Title overline & underline mismatch. NUMA resource associativity ==

Re: [PATCH v2 0/3] Updates to powerpc for robust CPU online/offline

2021-08-23 Thread Peter Zijlstra
On Mon, Aug 23, 2021 at 03:04:37PM +0530, Srikar Dronamraju wrote: > * Peter Zijlstra [2021-08-23 10:33:30]: > > > On Sat, Aug 21, 2021 at 03:55:32PM +0530, Srikar Dronamraju wrote: > > > Scheduler expects unique number of node distances to be available > > > at boot. It uses node distance to cal

Re: [PATCH v2 1/3] powerpc/numa: Print debug statements only when required

2021-08-23 Thread Srikar Dronamraju
* Laurent Dufour [2021-08-23 11:21:33]: > Le 21/08/2021 à 12:25, Srikar Dronamraju a écrit : > > Currently, a debug message gets printed every time an attempt to > > add(remove) a CPU. However this is redundant if the CPU is already added > > (removed) from the node. > > > > Cc: linuxppc-dev@lis

Re: [PATCH v2 0/3] Updates to powerpc for robust CPU online/offline

2021-08-23 Thread Srikar Dronamraju
* Peter Zijlstra [2021-08-23 10:33:30]: > On Sat, Aug 21, 2021 at 03:55:32PM +0530, Srikar Dronamraju wrote: > > Scheduler expects unique number of node distances to be available > > at boot. It uses node distance to calculate this unique node > > distances. On Power Servers, node distances for o

Re: [PATCH v2] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC

2021-08-23 Thread Cédric Le Goater
On 8/23/21 8:49 AM, Christophe Leroy wrote: > Commit e65e1fc2d24b ("[PATCH] syscall class hookup for all normal > targets") added generic support for AUDIT but that didn't include > support for bi-arch like powerpc. > > Commit 4b58841149dc ("audit: Add generic compat syscall support") > added gene

Re: [PATCH] powerpc/syscalls: Remove __NR__exit

2021-08-23 Thread Michael Ellerman
Christophe Leroy writes: > Le 23/08/2021 à 10:33, Andreas Schwab a écrit : >> On Aug 23 2021, Christophe Leroy wrote: >> >>> __NR_exit is nowhere used. On most architectures it was removed by >> >> ITYM __NR__exit, which is what you are removing. >> > > Indeed. > > Michael, can you fix when app

[PATCH v2 1/2] powerpc/prom: Fix unused variable ‘reserve_map’ when CONFIG_PPC32 is not set

2021-08-23 Thread Cédric Le Goater
This fixes a compile error with W=1. arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’: arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable] __be64 *reserve_map; ^~~ cc1: all warnings being treated as err

Re: [PATCH v2 1/3] powerpc/numa: Print debug statements only when required

2021-08-23 Thread Laurent Dufour
Le 21/08/2021 à 12:25, Srikar Dronamraju a écrit : Currently, a debug message gets printed every time an attempt to add(remove) a CPU. However this is redundant if the CPU is already added (removed) from the node. Cc: linuxppc-dev@lists.ozlabs.org Cc: Nathan Lynch Cc: Michael Ellerman Cc: Ingo

[PATCH v2 0/2] W=1 fixes

2021-08-23 Thread Cédric Le Goater
Hello, These are the remaining patches needed to compile the ppc kernel with W=1. Audit issues are now being addressed by Christophe in patch : [v2] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC http://patchwork.ozlabs.org/project/linuxppc-dev/patch/dc14509a28a993738b1325211f412be72

[PATCH v2 2/2] powerpc/compat_sys: Declare syscalls

2021-08-23 Thread Cédric Le Goater
This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater --- arch/powerpc/include/asm/syscalls.h | 30 + 1 file changed, 30 insertions(+) diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index 3

Re: [PATCH] powerpc/syscalls: Remove __NR__exit

2021-08-23 Thread Christophe Leroy
Le 23/08/2021 à 10:33, Andreas Schwab a écrit : On Aug 23 2021, Christophe Leroy wrote: __NR_exit is nowhere used. On most architectures it was removed by ITYM __NR__exit, which is what you are removing. Indeed. Michael, can you fix when applying or do you prefer a new patch ?

Re: [PATCH 5/6] audit: Declare ppc32_classify_syscall()

2021-08-23 Thread Cédric Le Goater
On 8/23/21 10:28 AM, Christophe Leroy wrote: > > > Le 19/08/2021 à 16:56, Christophe Leroy a écrit : >> >> >> Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : >>> This fixes a compile error with W=1. >>> >>> Cc: Christophe Leroy >>> Signed-off-by: Cédric Le Goater >>> --- >>> >>>   I don't thi

Re: [PATCH v2 0/3] Updates to powerpc for robust CPU online/offline

2021-08-23 Thread Peter Zijlstra
On Sat, Aug 21, 2021 at 03:55:32PM +0530, Srikar Dronamraju wrote: > Scheduler expects unique number of node distances to be available > at boot. It uses node distance to calculate this unique node > distances. On Power Servers, node distances for offline nodes is not > available. However, Power Se

Re: [PATCH] powerpc/syscalls: Remove __NR__exit

2021-08-23 Thread Andreas Schwab
On Aug 23 2021, Christophe Leroy wrote: > __NR_exit is nowhere used. On most architectures it was removed by ITYM __NR__exit, which is what you are removing. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for

Re: [PATCH 1/6] powerpc/prom: Introduce early_reserve_mem_old()

2021-08-23 Thread Cédric Le Goater
On 8/19/21 4:42 PM, Christophe Leroy wrote: > > > Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : >> and condition its call with IS_ENABLED(CONFIG_PPC32). This fixes a >> compile error with W=1. >> >> arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’: >> arch/powerpc/kernel/prom.c:625

Re: [PATCH 5/6] audit: Declare ppc32_classify_syscall()

2021-08-23 Thread Christophe Leroy
Le 19/08/2021 à 16:56, Christophe Leroy a écrit : Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater ---   I don't think this is correct. Which file could we use ? I think you can completely remov

[PATCH v3 3/3] powerpc: Define and use MSR_RI only on non booke/40x

2021-08-23 Thread Christophe Leroy
40x and BOOKE don't have MSR_RI. Define MSR_RI only for platforms where it exists. For the other ones, defines it as BUILD_BUG for C and do not define it for ASM. Signed-off-by: Christophe Leroy --- v3: Fixes kvm_emul.S and include in --- arch/powerpc/include/asm/reg.h | 5 + arch/

[PATCH v3 2/3] powerpc: Refactor verification of MSR_RI

2021-08-23 Thread Christophe Leroy
40x and BOOKE don't have MSR_RI therefore all tests involving MSR_RI may be problematic on those plateforms. Create helpers to check or set MSR_RI in regs, and use them in common code. Signed-off-by: Christophe Leroy --- v2: Remove superflous { --- arch/powerpc/include/asm/ptrace.h

[PATCH v3 1/3] powerpc: Remove MSR_PR check in interrupt_exit_{user/kernel}_prepare()

2021-08-23 Thread Christophe Leroy
In those hot functions that are called at every interrupt, any saved cycle is worth it. interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare() are called from three places: - From entry_32.S - From interrupt_64.S - From interrupt_exit_user_restart() and interrupt_exit_kernel_restart()

[PATCH] powerpc/syscalls: Remove __NR__exit

2021-08-23 Thread Christophe Leroy
__NR_exit is nowhere used. On most architectures it was removed by commit 135ab6ec8fda ("[PATCH] remove remaining errno and __KERNEL_SYSCALLS__ references") but not on powerpc. powerpc removed __KERNEL_SYSCALLS__ in commit 3db03b4afb3e ("[PATCH] rename the provided execve functions to kernel_execv

[PATCH v2] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC

2021-08-23 Thread Christophe Leroy
Commit e65e1fc2d24b ("[PATCH] syscall class hookup for all normal targets") added generic support for AUDIT but that didn't include support for bi-arch like powerpc. Commit 4b58841149dc ("audit: Add generic compat syscall support") added generic support for bi-arch. Convert powerpc to that bi-arc

[PATCH] powerpc/32: Avoid link stack corruption in a few places

2021-08-23 Thread Christophe Leroy
Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/misc_32.S| 2 +- arch/powerpc/kernel/reloc_32.S | 2 +- arch/pow

[PATCH] powerpc/booke: Avoid link stack corruption in several places

2021-08-23 Thread Christophe Leroy
Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc_asm.h| 2 +- arch/powerpc/kernel/exceptions-64e.S

[PATCH] powerpc/64: Avoid link stack corruption in kexec_wait()

2021-08-23 Thread Christophe Leroy
Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/misc_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --