Re: [PATCH v2 11/14] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-08-14 Thread Rohan McLure
>>> "Nullify" means "invalidate", which is not what this does or is for :-( >> >> Would "Zeroise" be more appropriate ? > > That is probably a good compromise, yes. It obviously is a verb, its > meaning is clear and unamiguous, and there is precedent for it even :-) Zeroise it is. The

Re: [PATCH v2 13/14] powerpc/64s: Fix comment on interrupt handler prologue

2022-08-10 Thread Rohan McLure
> Maybe it would be interesting to know from which patch the error comes. It’s hard to attribute this to a single commit, but the distance between r10’s save location and r11-r12’s save location has definitely grown over time. The comment is introduced in commit 7180e3e636de ("[POWERPC] force

Re: [PATCH v2 01/14] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-08-08 Thread Rohan McLure
> Well, of course we need the patch build, so SYSCALL_DEFINE and > COMPAT_SYSCALL_DEFINE have to go with the name changes, that's obvious. > > My comment was more related to changes like the renaming of > ppc64_personality() to do_ppc64_personality() and the creation of >

Re: [PATCH v2 05/14] powerpc: Use generic fallocate compatibility syscall

2022-08-08 Thread Rohan McLure
>> --- a/arch/powerpc/kernel/asm-offsets.c >> +++ b/arch/powerpc/kernel/asm-offsets.c >> @@ -9,6 +9,7 @@ >> * #defines from the assembly-language output. >> */ >> >> +#include > > What's this for? Good spot.

Re: [PATCH v2 01/14] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-08-08 Thread Rohan McLure
Thanks for reviewing my patches. > I think this patch should be split in two patches. One where you just > change to using SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE, and a second > patch for everything else. > > The first patch could then be linked to >

[PATCH v2 14/14] powerpc/64s: Clear gprs on interrupt routine entry

2022-07-25 Thread Rohan McLure
for interrupt_exit_user_prepare. The mmap_bench benchmark in selftests should rapidly invoke pagefaults. See ~0.8% performance regression with this mitigation, but this indicates the worst-case performance due to heavier-weight interrupt handlers. Signed-off-by: Rohan McLure --- V1 -> V2:

[PATCH v2 13/14] powerpc/64s: Fix comment on interrupt handler prologue

2022-07-25 Thread Rohan McLure
to afford space for the value of the CFAR. Comment is currently written as if r10-r12 are saved to PACA, but in fact only r10 is saved. Signed-off-by: Rohan McLure --- V1 -> V2: Given its own commit --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH v2 12/14] powerpc/64s: Use {NULLIFY,SAVE,REST}_GPRS macros in sc, scv 0 handlers

2022-07-25 Thread Rohan McLure
in the struct pt_regs on the stack). Wherever a different gpr is storing the initial value of another gpr at the interrupt location, care must be taken to issue the correct save instruction and so the macros are not applied in neighbouring stores. Signed-off-by: Rohan McLure --- V1 -> V2: Update summ

[PATCH v2 11/14] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-07-25 Thread Rohan McLure
of syscall_exit_prepare is to determine when non-volatile regs must be restored, and it still serves that purpose on 32-bit. Use it now for determining where to find XER, CTR, CR. Signed-off-by: Rohan McLure --- V1 -> V2: Update summary --- arch/powerpc/kernel/interrupt_64.S |

[PATCH v2 10/14] powerpc: Provide syscall wrapper

2022-07-25 Thread Rohan McLure
xed in a successive patch, but requires spu_sys_callback to allocate a pt_regs structure to satisfy the wrapped calling convention. Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan Signed-off-by: Rohan McLure --- V1 -> V2: Generate prototypes for symbols produced by the wrapper. ---

[PATCH v2 09/14] powerpc: Add NULLIFY_GPRS macros for register clears

2022-07-25 Thread Rohan McLure
of the accompanying restore and save macros, and usage of nullify to describe this operation elsewhere in the kernel. Signed-off-by: Rohan McLure --- V1 -> V2: Change 'ZERO' usage in naming to 'NULLIFY', a more obvious verb --- arch/powerpc/include/asm/ppc_asm.h | 22 ++ 1 file changed,

[PATCH v2 08/14] powerpc: Use common syscall handler type

2022-07-25 Thread Rohan McLure
six machine-word length parameters to a function to be passed by registers, even handlers which admit fewer than six parameters may be viewed as having the above type. Fixup comparisons in VDSO to avoid pointer-integer comparison. Introduce explicit cast on systems with SPUs. Signed-off-by: Rohan

[PATCH v2 07/14] powerpc: Enable compile-time check for syscall handlers

2022-07-25 Thread Rohan McLure
/syscalls.h headers for prototypes. Reported-by: Arnd Bergmann Signed-off-by: Rohan McLure --- V1 -> V2: New patch. --- arch/powerpc/kernel/{systbl.S => systbl.c} | 27 ++-- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/systbl.S b/arch/p

[PATCH v2 06/14] powerpc: Include all arch-specific syscall prototypes

2022-07-25 Thread Rohan McLure
handlers are expressed in terms of types in ppc32.h. Expose this header globally. Signed-off-by: Rohan McLure --- V1 -> V2: Explicitly include prototypes. --- arch/powerpc/{kernel => include/asm}/ppc32.h | 0 arch/powerpc/include/asm/syscalls.h | 104 - arch/p

[PATCH v2 05/14] powerpc: Use generic fallocate compatibility syscall

2022-07-25 Thread Rohan McLure
ll replace more architecture-defined syscall handlers with generic implementations, dependent on introducing generic implementations that are compatible with powerpc and arm's parameter reorderings. Reported-by: Arnd Bergmann Signed-off-by: Rohan McLure --- V1 -> V2: Remove arch-specific fall

[PATCH v2 04/14] powerpc/32: Remove powerpc select specialisation

2022-07-25 Thread Rohan McLure
both implement this syscall with oldselect semantics. Remove the powerpc implementation, and update syscall.tbl to refer to emit a reference to sys_old_select for 32-bit binaries, in keeping with how other architectures support syscall #82. Signed-off-by: Rohan McLure --- V1 -> V2: Remove a

[PATCH v2 03/14] powerpc: Remove direct call to mmap2 syscall handlers

2022-07-25 Thread Rohan McLure
with the personality handlers. Signed-off-by: Rohan McLure --- V1 -> V2: Move mmap2 compat implementation to asm/kernel/syscalls.c. --- arch/powerpc/kernel/sys_ppc32.c| 10 -- arch/powerpc/kernel/syscalls.c | 11 +++ arch/powerpc/ker

[PATCH v2 02/14] powerpc: Remove direct call to personality syscall handler

2022-07-25 Thread Rohan McLure
inline helper in . Signed-off-by: Rohan McLure --- V1 -> V2: Use inline helper to deduplicate bodies in compat/regular implementations. --- arch/powerpc/kernel/syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscall

[PATCH v2 01/14] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-07-25 Thread Rohan McLure
the __ARCH_WANT_COMPAT_SYS_... convention. Signed-off-by: Rohan McLure --- V1 -> V2: All syscall handlers wrapped by this macro. --- arch/powerpc/include/asm/syscalls.h | 14 ++--- arch/powerpc/kernel/sys_ppc32.c | 50 +++--- arch/powerpc/kernel/syscall

[PATCH v2 00/14] powerpc: Syscall wrapper and register clearing

2022-07-25 Thread Rohan McLure
old_select semantics to syscall #82 - Move ppc32.h header to include/asm/ - Include benchmark results for both DSI and null syscalls Rohan McLure (14): powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers powerpc: Remove direct call to personality syscall handler powerpc: Remove direct

Re: [PATCH 2/6] powerpc: Provide syscall wrapper

2022-06-15 Thread Rohan McLure
> Le 01/06/2022 à 10:29, Christophe Leroy a écrit : >> Le 01/06/2022 à 07:48, Rohan McLure a écrit : >>> [Vous ne recevez pas souvent de courriers de la part de >>> rmcl...@linux.ibm.com. Découvrez pourquoi cela peut être important à >>> l'adresse https://a

Re: [PATCH 2/6] powerpc: Provide syscall wrapper

2022-06-14 Thread Rohan McLure
> On 3 Jun 2022, at 7:04 pm, Arnd Bergmann wrote: > > On Wed, Jun 1, 2022 at 7:48 AM Rohan McLure wrote: >> >> Syscall wrapper implemented as per s390, x86, arm64, providing the >> option for gprs to be cleared on entry to the kernel, reducing caller >> i

Re: [PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears

2022-06-09 Thread Rohan McLure
> On 2 Jun 2022, at 2:00 am, Segher Boessenkool > wrote: > > Hi! > > On Wed, Jun 01, 2022 at 03:48:45PM +1000, Rohan McLure wrote: >> +.macro BINOP_REGS op, rhs, start, end >> +.Lreg=\start >> +.rept (\end - \start + 1) >> +\op .Lreg

Re: [PATCH 2/6] powerpc: Provide syscall wrapper

2022-06-02 Thread Rohan McLure
tophe Leroy > wrote: > > > > Le 01/06/2022 à 07:48, Rohan McLure a écrit : >> [Vous ne recevez pas souvent de courriers de la part de >> rmcl...@linux.ibm.com. Découvrez pourquoi cela peut être important à >> l'adresse https://aka.ms/LearnAboutSenderIdentification

[PATCH 6/6] powerpc/64s: Clear gprs on interrupt routine entry

2022-05-31 Thread Rohan McLure
these register values. Prior to this commit, r14-r31 are restored on a per-interrupt basis at exit, but now they are always restored. Remove explicit REST_NVGPRS invocations on interrupt entry and simplify exit logic. Signed-off-by: Rohan McLure --- arch/powerpc/kernel/exceptions-64s.S | 19

[PATCH 5/6] powerpc: Move syscall handler prototypes to header

2022-05-31 Thread Rohan McLure
. Signed-off-by: Rohan McLure --- arch/powerpc/include/asm/syscalls.h | 16 arch/powerpc/kernel/syscalls.c | 7 --- arch/powerpc/kernel/vdso.c | 3 +-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/syscalls.h b/arch

[PATCH 4/6] powerpc: Fix comment, use clear and restore macros

2022-05-31 Thread Rohan McLure
Only r10 is saved to the PACA. Reflect this in the inline comment. Replace instructions for restoring gprs from the stack and clearing them with the REST_GPRS and ZERO_GPRS convenience macros. Signed-off-by: Rohan McLure --- arch/powerpc/kernel/exceptions-64s.S | 2 +- arch/powerpc/kernel

[PATCH 3/6] powerpc: Make syscalls save and restore gprs

2022-05-31 Thread Rohan McLure
-by: Rohan McLure --- arch/powerpc/kernel/interrupt_64.S | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/interrupt_64.S b/arch/powerpc/kernel/interrupt_64.S index b11c2bd84827..e601ed999798 100644 --- a/arch/powerpc/kernel/interrupt_64.S +++ b/arch

[PATCH 2/6] powerpc: Provide syscall wrapper

2022-05-31 Thread Rohan McLure
with ARCH_HAS_SYSCALL_WRAPPER enabled. Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan Signed-off-by: Rohan McLure --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/interrupt.h | 3 +- arch/powerpc/include/asm/syscall_wrapper.h | 92

[PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears

2022-05-31 Thread Rohan McLure
Macros for restoring saving registers to and from the stack exist. Provide a macro for simply zeroing a range of gprs, or an individual gpr. Signed-off-by: Rohan McLure --- arch/powerpc/include/asm/ppc_asm.h | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/powerpc

[PATCH v3] powerpc: declare unmodified attribute_group usages const

2022-03-07 Thread Rohan McLure
are candidates for being const. Declare them as const. Signed-off-by: Rohan McLure --- arch/powerpc/include/asm/spu.h | 4 ++-- arch/powerpc/perf/generic-compat-pmu.c | 4 ++-- arch/powerpc/perf/hv-24x7.c | 6 +++--- arch/powerpc/perf/hv-gpci.c | 8

[PATCH v2] powerpc: declare unmodified attribute_group usages const

2022-03-03 Thread Rohan McLure
are candidates for being const. Declare them as const. Signed-off-by: Rohan McLure --- arch/powerpc/perf/generic-compat-pmu.c | 4 ++-- arch/powerpc/perf/hv-24x7.c | 6 +++--- arch/powerpc/perf/hv-gpci.c | 8 arch/powerpc/perf/imc-pmu.c | 6

<    1   2   3   4