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
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
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
.
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
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
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
-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
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
> 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
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
> 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
> 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
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:
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
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
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
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
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.
---
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 |
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,
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
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
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
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
/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
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
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
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
Avoid duplication in future patch that will define the ppc64_personality
syscall handler in terms of the SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE
macros, by extracting the common body of ppc64_personality into a helper
function.
Signed-off-by: Rohan McLure
---
V2 -> V3: New commit.
---
a
inline helper in .
Signed-off-by: Rohan McLure
---
V1 -> V2: Use inline helper to deduplicate bodies in compat/regular
implementations.
V3 -> V4: Move to be applied before syscall wrapper.
---
arch/powerpc/kernel/syscalls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
of these
systems feature hardware speculation, and we already unconditionally
restore NVGPRS.
Rohan McLure (20):
powerpc: Remove asmlinkage from syscall handler definitions
powerpc: Use generic fallocate compatibility syscall
powerpc/32: Remove powerpc select specialisation
powerpc
handlers are expressed in terms of types in
ppc32.h. Expose this header globally.
Signed-off-by: Rohan McLure
---
V1 -> V2: Explicitly include prototypes.
V2 -> V3: Remove extraneous #include and ppc_fallocate
prototype. Rename header.
---
arch/powerpc/include/asm/syscalls.h
safely, without loss of register state prior to the
interrupt, as the common prologue saves the initial values of
non-volatiles, which are unconditionally restored in interrupt_64.S.
Signed-off-by: Rohan McLure
---
V3 -> V4: New patch.
---
arch/powerpc/kernel/exceptions-64e.S | 4 +++-
1 f
> What about arch/powerpc/kernel/exceptions-64e.S, no change required
> inside it ? As interru_64.S applies to both 64s and 64e, I would have
> expected changes in exceptions_64e too.
As it stands the changes in interrupt_64.S cause non-volatiles to be
unconditionally restored. This may lead to
where
r11-r12 are saved to the PACA.
Signed-off-by: Rohan McLure
---
V1 -> V2: Given its own commit
V2 -> V3: Annotate r11-r12 save locations with comment.
---
arch/powerpc/kernel/exceptions-64s.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/exce
-by: Rohan McLure
---
V1 -> V2: Update summary
V2 -> V3: Remove erroneous summary paragraph on syscall_exit_prepare
V3 -> V4: Use ZEROIZE instead of NULLIFY
---
arch/powerpc/kernel/interrupt_64.S | 22 ++
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/arch/power
the
__ARCH_WANT_COMPAT_SYS_... convention.
Signed-off-by: Rohan McLure
---
V1 -> V2: All syscall handlers wrapped by this macro.
V2 -> V3: Move creation of do_ppc64_personality helper to prior patch.
V3 -> V4: Fix parenthesis alignment. Don't emit sys_*** symbols.
---
arch/powerpc/in
with the personality handlers.
Signed-off-by: Rohan McLure
---
V1 -> V2: Move mmap2 compat implementation to asm/kernel/syscalls.c.
V3 -> V4: Move to be applied before syscall wrapper introduced.
---
arch/powerpc/kernel/sys_ppc32.c | 9 -
arch/powerpc/kernel/syscalls.c | 11
of SAVE_GPRS targetting all non-volatile
registers to SAVE_NVGPRS.
Signed-off-by: Rohan Mclure
---
V3 -> V4: New commit.
---
arch/powerpc/kernel/exceptions-64e.S | 27 +++---
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64e.S
handlers, user register state is
sometimes juggled between registers. Hold-off from issuing the SAVE_GPR
macro for applicable neighbouring lines to highlight the delicate
register save logic.
Signed-off-by: Rohan McLure
---
V1 -> V2: Update summary
V2 -> V3: Update summary regarding excl
is not consumed earlier in the handler code.
Signed-off-by: Rohan McLure
Reported-by: Christophe Leroy
---
V2 -> V3: New patch.
V3 -> V4: Minimise restores in the unrecoverable window between
restoring SRR0/1 and return from interrupt.
---
arch/powerpc/kernel/entry_32.
interrupt
handlers.
Signed-off-by: Rohan McLure
---
V1 -> V2: Add benchmark data
V2 -> V3: Use ZEROIZE_GPR{,S} macro renames, clarify
interrupt_exit_user_prepare changes in summary.
---
arch/powerpc/kernel/exceptions-64s.S | 21 -
arch/powerpc/kernel/interrupt_64.S
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 fallocat
ge provide far from complete support for C++ toolchains, and so
the macro serves no purpose in powerpc.
Remove all invocations of asmlinkage in arch/powerpc. These incidentally
only occur in syscall definitions and prototypes.
Signed-off-by: Rohan McLure
---
V2 -> V3: new patch
---
arch/powerp
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
of the accompanying restore and save macros, and usage
of zeroize 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
V2 -> V3: Change 'NULLIFY' usage in naming to 'ZEROIZE', which has
precedent in
/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
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.
V2
ement system call entry/exit logic
in C for PPC32")
when 32-bit adopted system_call_exception. Revert its removal of orig_r3
saves.
Signed-off-by: Rohan McLure
---
V2 -> V3: New commit.
---
arch/powerpc/kernel/entry_32.S | 1 +
arch/powerpc/kernel/interrupt_64.S | 2 ++
arch/powerpc/ker
> On 19 Aug 2022, at 4:52 pm, Christophe Leroy
> wrote:
>
>
>
> Le 19/08/2022 à 05:38, Rohan McLure a écrit :
>> Clear user state in gprs (assign to zero) to reduce the influence of user
>> registers on speculation within kernel syscall handlers. Clears
ge provide far from complete support for C++ toolchains, and so
the macro serves no purpose in powerpc.
Remove all invocations of asmlinkage in arch/powerpc. These incidentally
only occur in syscall defintions and prototypes.
Signed-off-by: Rohan McLure
---
V2 -> V3: new patch
---
arch/powerp
ystem call entry/exit logic in C for PPC32")
when 32-bit adopted system_call_exception. Revert its removal of orig_r3
saves.
Signed-off-by: Rohan McLure
---
V2 -> V3: New commit.
---
arch/powerpc/kernel/entry_32.S | 1 +
arch/powerpc/kernel/interrupt_64.S | 2 ++
arch/powerpc/kernel/sysca
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
handlers are expressed in terms of types in
ppc32.h. Expose this header globally.
Signed-off-by: Rohan McLure
---
V1 -> V2: Explicitly include prototypes.
V2 -> V3: Remove extraneous #include and ppc_fallocate
prototype. Rename header.
---
arch/powerpc/include/asm/syscalls.h
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
interrupt
handlers.
Signed-off-by: Rohan McLure
---
V1 -> V2: Add benchmark data
V2 -> V3: Use ZEROIZE_GPR{,S} macro renames, clarify
interrupt_exit_user_prepare changes in summary.
---
arch/powerpc/kernel/exceptions-64s.S | 21 -
arch/powerpc/kernel/interrupt_64.S
/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
where
r11-r12 are saved to the PACA.
Signed-off-by: Rohan McLure
---
V1 -> V2: Given its own commit
V2 -> V3: Annotate r11-r12 save locations with comment.
---
arch/powerpc/kernel/exceptions-64s.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/exce
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.
V2
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
with new macros
- Acknowledge system_call_exception move to syscall.c
- Save caller r3 for system calls in interrupt handlers rather than in
system_call_exception
- Remove asmlinkage from arch/powerpc
- Rearrange patches, realign changes to their relevant patches
Rohan McLure (18):
powerpc
Avoid duplication in future patch that will define the ppc64_personality
syscall handler in terms of the SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE
macros, by extracting the common body of ppc64_personality into a helper
function.
Signed-off-by: Rohan McLure
---
V2 -> V3: New commit.
---
a
the
__ARCH_WANT_COMPAT_SYS_... convention.
Signed-off-by: Rohan McLure
---
V1 -> V2: All syscall handlers wrapped by this macro.
V2 -> V3: Move creation of do_ppc64_personality helper to prior patch.
---
arch/powerpc/include/asm/syscalls.h | 18 +++---
arch/powerpc/kernel/sys_p
handlers, user register state is
sometimes juggled between registers. Hold-off from issuing the SAVE_GPR
macro for applicable neighbouring lines to highlight the delicate
register save logic.
Signed-off-by: Rohan McLure
---
V1 -> V2: Update summary
V2 -> V3: Update summary regarding excl
-by: Rohan McLure
---
V1 -> V2: Update summary
V2 -> V3: Remove erroneous summary paragraph on syscall_exit_prepare
---
arch/powerpc/kernel/interrupt_64.S | 22 ++
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/interrupt_64.S
b/arch/powerpc/
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 +++
2 files changed, 11 insertions(+), 10 deletions(-)
diff --
is not consumed earlier in the handler code.
Signed-off-by: Rohan McLure
Reported-by: Christophe Leroy
---
V2 -> V3: New patch.
---
arch/powerpc/kernel/entry_32.S | 35
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/kernel/entry_32.
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 fallocat
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
V2 -> V3: Change 'NULLIFY' usage in naming to 'ZEROIZE', which has
precedent in
the
DEFINE_INTERRUPT_HANDLER macros.
Applying this offset perturbs the layout of interrupt handler stack
frames, rendering to the kernel stack more difficult to control by means
of user invoked interrupts.
Link: https://lists.ozlabs.org/pipermail/linuxppc-dev/2022-May/243238.html
Signed-off-by: Rohan McLure
---
arch
rm64/mm: enable
ARCH_SUPPORTS_PAGE_TABLE_CHECK")
x86_64 in commit d283d422c6c4 ("x86: mm: add x86_64 support for page table
check")
Signed-off-by: Rohan McLure
---
V2: Update spacing and types assigned to pte_update calls.
V3: Update one last pte_update call to remove __pte invocat
for Book3S/nohash 32-bit systems.
Signed-off-by: Rohan McLure
---
V2: Provide missing pud_user implementations, use p{u,m}d_is_leaf.
V3: Provide missing pmd_user implementations as stubs in 32-bit.
---
arch/powerpc/include/asm/book3s/32/pgtable.h | 4
arch/powerpc/include/asm/book3s/64/pgtable.h
.
Signed-off-by: Rohan McLure
---
V2: Remove conditional BUILD_BUG and BUG. Instead warn on usage.
---
arch/powerpc/include/asm/book3s/64/pgtable.h | 10 --
arch/powerpc/include/asm/pgtable.h | 14 ++
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git
> On 20 Sep 2022, at 11:59 am, Nicholas Piggin wrote:
>
> On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
>> Implement syscall wrapper as per s390, x86, arm64. When enabled
>> cause handlers to accept parameters from a stack frame rather than
>> from
handlers, user register state is
sometimes juggled between registers. Hold-off from issuing the SAVE_GPR
macro for applicable neighbouring lines to highlight the delicate
register save logic.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: Update summary
V3: Update summary regarding
of SAVE_GPRS targetting all non-volatile
registers to SAVE_NVGPRS.
Signed-off-by: Rohan Mclure
Reported-by: Nicholas Piggin
Reviewed-by: Nicholas Piggin
---
V4: New commit.
V6: Split REST_GPRS(0, 1, r1) to remove dependence on macro
implementation ordering the r0 restore before r1 restore.
---
arch
is not consumed earlier in the handler code.
Signed-off-by: Rohan McLure
Reported-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
---
V3: New patch.
V4: Minimise restores in the unrecoverable window between
restoring SRR0/1 and return from interrupt.
---
arch/powerpc/kernel/entry_32.S | 33
interrupt
handlers. This mitigation is disabled by default, but enabled with
CONFIG_INTERRUPT_SANITIZE_REGISTERS.
Signed-off-by: Rohan McLure
---
V2: Add benchmark data
V3: Use ZEROIZE_GPR{,S} macro renames, clarify
upt_exit_user_prepare changes in summary.
V5: Configurable now
safely, without loss of register state prior to the
interrupt, as the common prologue saves the initial values of
non-volatiles, which are unconditionally restored in interrupt_64.S.
Mitigation defaults to enabled by INTERRUPT_SANITIZE_REGISTERS.
Signed-off-by: Rohan McLure
---
V4: New patch.
V5
handlers are expressed in terms of types in
ppc32.h. Expose this header globally.
Signed-off-by: Rohan McLure
Acked-by: Nicholas Piggin
---
V2: Explicitly include prototypes.
V3: Remove extraneous #include and ppc_fallocate
prototype. Rename header.
V5: Clean. Elaborate comment on long long
/syscalls.h headers for
prototypes.
Reported-by: Arnd Bergmann
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: New patch.
V5: For this patch only, represent handler function pointers as
unsigned long. Remove reference to syscall wrappers. Use asm/syscalls.h
which implies asm
.
Fixup comparisons in VDSO to avoid pointer-integer comparison. Introduce
explicit cast on systems with SPUs.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: New patch.
V3: Remove unnecessary cast from const syscall_fn to syscall_fn
V5: Update patch desctiption.
V6: Remove
where
r11-r12 are saved to the PACA.
Signed-off-by: Rohan McLure
Reported-by: Nicholas Piggin
Reviewed-by: Nicholas Piggin
---
V2: Given its own commit
V3: Annotate r11-r12 save locations with comment.
---
arch/powerpc/kernel/exceptions-64s.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
Remove explicit clearing of the high order-word of user parameters when
handling compatibility syscalls in system_call_exception. The
COMPAT_SYSCALL_DEFINEx macros handle this clearing through an
explicit cast to the signature type of the target handler.
Signed-off-by: Rohan McLure
Reported
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
---
V2: Generate prototypes for symbols produced by the wrapper.
V3: Rebased to rem
frame.
Signed-off-by: Rohan McLure
---
V6: Split off from syscall wrapper patch.
---
arch/powerpc/include/asm/interrupt.h | 3 +--
arch/powerpc/kernel/entry_32.S | 6 +++---
arch/powerpc/kernel/interrupt_64.S | 20 ++--
arch/powerpc/kernel/syscall.c| 10
> On 20 Sep 2022, at 2:54 pm, Rohan McLure wrote:
>
>> On 20 Sep 2022, at 12:03 pm, Nicholas Piggin wrote:
>>
>> On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
>>> Clear user state in gprs (assign to zero) to reduce the influence of user
>>&
3cc ("powerpc/syscall: implement system call entry/exit
logic in C for PPC32") when 32-bit adopted system_call_exception. Revert
its removal of orig_r3 saves.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V3: New commit.
V5: New commit message, as we do more than just revert
restore and save macros, and usage
of zeroize to describe this operation elsewhere in the kernel.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: Change 'ZERO' usage in naming to 'NULLIFY', a more obvious verb
V3: Change 'NULLIFY' usage in naming to 'ZEROIZE', which has
ent
supporting big endianness may benefit from reciprocal
argument translation, but are welcome also to implement their own.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
Reviewed-by: Arnd Bergmann
---
V5: New patch.
---
include/asm-generic/compat.h | 9 +++--
1 file changed, 7 insert
...@www.fastmail.com/
Fixes: 57f48b4b74e7 ("powerpc/compat_sys: swap hi/lo parts of 64-bit syscall
args in LE mode")
Reported-by: Arnd Bergmann
Signed-off-by: Rohan McLure
Reviewed-by: Arnd Bergmann
Reviewed-by: Nicholas Piggin
---
V5: New patch.
---
arch/powerpc/include/asm/sysca
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 and compat_sys_old_select
for 32-bit binaries, in keeping with how other architectures support
syscall #82.
Signed-off-by: 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
Reviewed-by: Arnd Bergmann
---
V2: Remove arc
.
- Remove extraneous clears of the high-order words of syscall
parameters, which is now redundant thanks to use of
COMPAT_SYSCALL_DEFINE everywhere.
Rohan McLure (25):
powerpc: Remove asmlinkage from syscall handler definitions
powerpc: Save caller r3 prior to system_call_exception
ge provide far from complete support for C++ toolchains, and so
the macro serves no purpose in powerpc.
Remove all invocations of asmlinkage in arch/powerpc. These incidentally
only occur in syscall definitions and prototypes.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
Reviewed-
, through the
__ARCH_WANT_COMPAT_SYS_... convention.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: All syscall handlers wrapped by this macro.
V3: Move creation of do_ppc64_personality helper to prior patch.
V4: Fix parenthesis alignment. Don't emit sys_*** symbols.
V5: Use
Avoid duplication in future patch that will define the ppc64_personality
syscall handler in terms of the SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE
macros, by extracting the common body of ppc64_personality into a helper
function.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V3
state, meaning that the
mitigation when implemented will have minimal overhead.
Signed-off-by: Rohan McLure
Acked-by: Nicholas Piggin
---
V5: New patch
---
arch/powerpc/Kconfig | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index
-by: Rohan McLure
---
V2: Update summary
V3: Remove erroneous summary paragraph on syscall_exit_prepare
V4: Use ZEROIZE instead of NULLIFY. Clear r0 also.
V5: Move to end of patch series.
V6: Include clears which were previously in the syscall wrapper patch.
Move comment on r3-r8 register save to when we
' on static mmap helper.
Signed-off-by: Rohan McLure
Reviewed-by: Nicholas Piggin
---
V2: Move mmap2 compat implementation to asm/kernel/syscalls.c.
V4: Move to be applied before syscall wrapper introduced.
V5: Remove 'inline' in helper.
---
arch/powerpc/kernel/sys_ppc32.c | 9 -
arch/powerpc
1 - 100 of 332 matches
Mail list logo