Re: [PATCH v2 10/10] drm/ofdrm: Support color management

2022-09-21 Thread Thomas Zimmermann
Hi Am 21.09.22 um 18:48 schrieb Geert Uytterhoeven: Hi Thomas, On Wed, Sep 21, 2022 at 2:55 PM Thomas Zimmermann wrote: Am 05.08.22 um 02:19 schrieb Benjamin Herrenschmidt: On Wed, 2022-07-20 at 16:27 +0200, Thomas Zimmermann wrote: +#if !defined(CONFIG_PPC) +static inline void out_8(void _

Re: [powerpc] memcpy warning drivers/scsi/scsi_transport_fc.c:581 (next-20220921)

2022-09-21 Thread Sachin Sant
> On 22-Sep-2022, at 2:13 AM, Kees Cook wrote: > > On Wed, Sep 21, 2022 at 09:21:52PM +0530, Sachin Sant wrote: >> While booting recent linux-next kernel on a Power server following >> warning is seen: >> >> [6.427054] lpfc 0022:01:00.0: 0:6468 Set host date / time: Status x10: >> [6.

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-21 Thread Anshuman Khandual
On 9/21/22 12:47, Nadav Amit wrote: > On Sep 20, 2022, at 11:53 PM, Anshuman Khandual > wrote: > >> ⚠ External Email >> >> On 8/22/22 13:51, Yicong Yang wrote: >>> +static inline void arch_tlbbatch_add_mm(struct arch_tlbflush_unmap_batch >>> *batch, >>> +

Re: [PATCH] block: move from strlcpy with unused retval to strscpy

2022-09-21 Thread Jens Axboe
On Thu, 18 Aug 2022 22:59:57 +0200, Wolfram Sang wrote: > Follow the advice of the below link and prefer 'strscpy' in this > subsystem. Conversion is 1:1 because the return value is not used. > Generated by a coccinelle script. > > Applied, thanks! [1/1] block: move from strlcpy with unused ret

Re: [PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-21 Thread Guo Ren
Reviewed-by: Guo Ren On Mon, Sep 19, 2022 at 6:17 PM Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) > --- > drivers/cpuidle/cpuidle-psci.c |9 +

Re: [PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-21 Thread Kajetan Puchalski
On Mon, Sep 19, 2022 at 11:59:46AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Tried it on Pixel 6 running psci_idle, looks good with no apparent

Re: [powerpc] Kernel crash with THP tests (next-20220920)

2022-09-21 Thread Mike Kravetz
On 09/21/22 12:00, Sachin Sant wrote: > While running transparent huge page tests [1] against 6.0.0-rc6-next-20220920 > following crash is seen on IBM Power server. Thanks Sachin, Naoya reported this, with my analysis here: https://lore.kernel.org/linux-mm/YyqCS6+OXAgoqI8T@monkey/ An updated ver

Re: [powerpc] memcpy warning drivers/scsi/scsi_transport_fc.c:581 (next-20220921)

2022-09-21 Thread Kees Cook
On Wed, Sep 21, 2022 at 09:21:52PM +0530, Sachin Sant wrote: > While booting recent linux-next kernel on a Power server following > warning is seen: > > [6.427054] lpfc 0022:01:00.0: 0:6468 Set host date / time: Status x10: > [6.471457] lpfc 0022:01:00.0: 0:6448 Dual Dump is enabled > [

Re: [PATCH] Documentation: spufs: correct a duplicate word typo

2022-09-21 Thread Jonathan Corbet
Randy Dunlap writes: > Fix a typo of "or" which should be "of". > > Signed-off-by: Randy Dunlap > Cc: Jeremy Kerr > Cc: Arnd Bergmann > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Jonathan Corbet > --- > Documentation/filesystems/spufs/spufs.rst |2 +- > 1 file changed, 1 insertion(+), 1 del

Re: [PATCH 2/2] powerpc/64s: update cpu selection options

2022-09-21 Thread Segher Boessenkool
On Wed, Sep 21, 2022 at 11:41:03AM +1000, Nicholas Piggin wrote: > Update the 64s GENERIC_CPU option. POWER4 support has been dropped, so > make that clear in the option name. The POWER5_CPU option is dropped > because it's uncommon, and GENERIC_CPU covers it. > > -mtune= before power8 is dropped

Re: [PATCH 1/2] powerpc/64s: Fix GENERIC_CPU build flags for PPC970 / G5

2022-09-21 Thread Segher Boessenkool
On Wed, Sep 21, 2022 at 11:41:02AM +1000, Nicholas Piggin wrote: > Big-endian GENERIC_CPU supports 970, but builds with -mcpu=power5. > POWER5 is ISA v2.02 whereas 970 is v2.01 plus Altivec. 2.02 added > the popcntb instruction which a compiler might use. > > Use -mcpu=power4. > > Fixes: 471d7ff8

[PATCH 2/2] tools/perf/tests: Fix build id test check for PE file

2022-09-21 Thread Athira Rajeev
Perf test "build id cache operations" fails for PE executable. Logs below from powerpc system. Same is observed on x86 as well. <<>> Adding 5a0fd882b53084224ba47b624c55a469 ./tests/shell/../pe-file.exe: Ok build id: 5a0fd882b53084224ba47b624c55a469 link: /tmp/perf.debug.w0V/.build-id/5a/0fd882b53

[PATCH 1/2] tools/perf/tests: Fix string substitutions in build id test

2022-09-21 Thread Athira Rajeev
The perf test named “build id cache operations” skips with below error on some distros: <<>> 78: build id cache operations : test child forked, pid 01 WARNING: wine not found. PE binaries will not be run. test binaries: /tmp/perf.ex.SHA1.PKz /tmp/perf.ex.

Re: [RFC PATCH 3/7] powerpc/64: provide a helper macro to load r2 with the kernel TOC

2022-09-21 Thread Christophe Leroy
Le 19/09/2022 à 16:01, Nicholas Piggin a écrit : > A later change stops the kernel using r2 and loads it with a poison > value. Provide a PACATOC loading abstraction which can hide this > detail. > > XXX: 64e, KVM, ftrace not entirely done > > Signed-off-by: Nicholas Piggin > --- > arch/pow

Re: [RFC PATCH 2/7] powerpc/64: abstract asm global variable declaration and access

2022-09-21 Thread Christophe Leroy
Le 19/09/2022 à 16:01, Nicholas Piggin a écrit : > Use asm helpers to access global variables and to define them in asm. > Stop using got addressing and use the more common @toc offsets. 32-bit > already does this so that should be unchanged. > > Signed-off-by: Nicholas Piggin > --- > diff --g

Re: [RFC PATCH 1/7] powerpc: use 16-bit immediate for STACK_FRAME_REGS_MARKER

2022-09-21 Thread Christophe Leroy
Le 19/09/2022 à 16:01, Nicholas Piggin a écrit : > Using a 16-bit constant for this marker allows it to be loaded with > a single 'li' instruction. On 64-bit this avoids a TOC entry and a > TOC load that depends on the r2 value that has just been loaded from > the PACA. > > XXX: this probably sh

Re: [PATCH v2 10/10] drm/ofdrm: Support color management

2022-09-21 Thread Geert Uytterhoeven
Hi Thomas, On Wed, Sep 21, 2022 at 2:55 PM Thomas Zimmermann wrote: > Am 05.08.22 um 02:19 schrieb Benjamin Herrenschmidt: > > On Wed, 2022-07-20 at 16:27 +0200, Thomas Zimmermann wrote: > >> +#if !defined(CONFIG_PPC) > >> +static inline void out_8(void __iomem *addr, int val) > >> +{ } > >> +sta

Re: [PATCH 1/2] powerpc/64s: Fix GENERIC_CPU build flags for PPC970 / G5

2022-09-21 Thread Christophe Leroy
Le 21/09/2022 à 03:41, Nicholas Piggin a écrit : > Big-endian GENERIC_CPU supports 970, but builds with -mcpu=power5. > POWER5 is ISA v2.02 whereas 970 is v2.01 plus Altivec. 2.02 added > the popcntb instruction which a compiler might use. > > Use -mcpu=power4. > > Fixes: 471d7ff8b51b ("powerpc

Re: [PATCH] Revert "powerpc/rtas: Implement reentrant rtas call"

2022-09-21 Thread Nathan Lynch
"Nicholas Piggin" writes: > On Mon Sep 19, 2022 at 11:51 PM AEST, Nathan Lynch wrote: >> > I wonder - would it be worth making the panic path use a separate >> > "emergency" rtas_args buffer as well? If a CPU is actually "stuck" in >> > RTAS at panic time, then leaving rtas.args untouched might m

[powerpc] memcpy warning drivers/scsi/scsi_transport_fc.c:581 (next-20220921)

2022-09-21 Thread Sachin Sant
U: 0 PID: 16 Comm: kworker/0:1 Tainted: GE 6.0.0-rc6-next-20220921 #38 [7.432270] Workqueue: events work_for_cpu_fn [7.432277] NIP: c00801366a2c LR: c00801366a28 CTR: 007088ec [7.432282] REGS: c380b6d0 TRAP: 0700 Tainted: GE

Re: [RFC PATCH 5/7] powerpc/64s: update generic cpu option name and compiler flags

2022-09-21 Thread Segher Boessenkool
Hi! On Wed, Sep 21, 2022 at 11:01:18AM +1000, Nicholas Piggin wrote: > On Wed Sep 21, 2022 at 8:16 AM AEST, Segher Boessenkool wrote: > > On Tue, Sep 20, 2022 at 12:01:47AM +1000, Nicholas Piggin wrote: > > > Update the 64s GENERIC_CPU option. POWER4 support has been dropped, so > > > make that cl

[PATCH V2 2/3] tools/perf/tests: Fix branch stack sampling test to include sanity check for branch filter

2022-09-21 Thread Athira Rajeev
commit b55878c90ab9 ("perf test: Add test for branch stack sampling") added test for branch stack sampling. There is a sanity check in the beginning to skip the test if the hardware doesn't support branch stack sampling. Snippet <<>> skip the test if the hardware doesn't support branch stack sampl

[PATCH V2 3/3] tools/testing/selftests/powerpc: Update the bhrb filter sampling test to test for multiple branch filters

2022-09-21 Thread Athira Rajeev
For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type, ie branch filters are supported. The testcase "bhrb_filter_map_test" tests the valid and invalid filter maps in different powerpc platforms. Update this testcase to include scenario to cover multiple branch filters at sametime.

[PATCH V2 1/3] powerpc/perf: Fix branch_filter support for multiple filters in powerpc

2022-09-21 Thread Athira Rajeev
For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type ie branch filters are supported. The branch filters are requested via event attribute "branch_sample_type". Multiple branch filters can be passed in event attribute. Example: perf record -b -o- -B --branch-filter any,ind_call t

Re: [PATCH v1 2/3] powerpc/prom_init: drop PROM_BUG()

2022-09-21 Thread David Hildenbrand
On 21.09.22 15:02, Michael Ellerman wrote: David Hildenbrand writes: Unused, let's drop it. Signed-off-by: David Hildenbrand --- arch/powerpc/kernel/prom_init.c | 6 -- 1 file changed, 6 deletions(-) Thanks. I'll take this one via the powerpc tree, and the others can go via wherever?

Re: [PATCH v1 2/3] powerpc/prom_init: drop PROM_BUG()

2022-09-21 Thread Michael Ellerman
David Hildenbrand writes: > Unused, let's drop it. > > Signed-off-by: David Hildenbrand > --- > arch/powerpc/kernel/prom_init.c | 6 -- > 1 file changed, 6 deletions(-) Thanks. I'll take this one via the powerpc tree, and the others can go via wherever? cheers > diff --git a/arch/powerpc/

Re: [PATCH] powerpc: Save AMR/IAMR when switching tasks

2022-09-21 Thread Michael Ellerman
Christophe Leroy writes: > Le 19/09/2022 à 14:37, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> Le 16/09/2022 à 07:05, Samuel Holland a écrit : With CONFIG_PREEMPT=y (involuntary preemption enabled), it is possible to switch away from a task inside copy_{from,to}_user. This

Re: [PATCH v2 10/10] drm/ofdrm: Support color management

2022-09-21 Thread Thomas Zimmermann
Hi Am 05.08.22 um 02:19 schrieb Benjamin Herrenschmidt: On Wed, 2022-07-20 at 16:27 +0200, Thomas Zimmermann wrote: +#if !defined(CONFIG_PPC) +static inline void out_8(void __iomem *addr, int val) +{ } +static inline void out_le32(void __iomem *addr, int val) +{ } +static inline unsigned int in

Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function

2022-09-21 Thread Thomas Zimmermann
Hi Am 05.08.22 um 02:22 schrieb Benjamin Herrenschmidt: On Tue, 2022-07-26 at 16:40 +0200, Michal Suchánek wrote: Hello, On Tue, Jul 26, 2022 at 03:38:37PM +0200, Javier Martinez Canillas wrote: On 7/20/22 16:27, Thomas Zimmermann wrote: Add a per-model device-function structure in preparati

Re: [PATCH v2 08/10] drm/ofdrm: Add CRTC state

2022-09-21 Thread Thomas Zimmermann
Hi Am 26.07.22 um 15:36 schrieb Javier Martinez Canillas: On 7/20/22 16:27, Thomas Zimmermann wrote: Add a dedicated CRTC state to ofdrm to later store information for palette updates. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/ofdrm.c | 62 ++-

Re: [PATCH v2 07/10] drm/ofdrm: Add ofdrm for Open Firmware framebuffers

2022-09-21 Thread Thomas Zimmermann
Hi Am 26.07.22 um 15:17 schrieb Javier Martinez Canillas: Hello Thomas, On 7/20/22 16:27, Thomas Zimmermann wrote: Open Firmware provides basic display output via the 'display' node. DT platform code already provides a device that represents the node's framebuffer. Add a DRM driver for the dev

Re: [PATCH v3] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-21 Thread Baolin Wang
On 9/19/2022 10:13 AM, Mike Kravetz wrote: During discussions of this series [1], it was suggested that hugetlb handling code in follow_page_mask could be simplified. At the beginning of follow_page_mask, there currently is a call to follow_huge_addr which 'may' handle hugetlb pages. ia64 is

Re: [PATCH v3 00/16] objtool: Enable and implement --mcount option on powerpc

2022-09-21 Thread Sathvika Vasireddy
Hi Josh, On 14/09/22 05:45, Josh Poimboeuf wrote: On Tue, Sep 13, 2022 at 04:13:52PM +0200, Peter Zijlstra wrote: On Mon, Sep 12, 2022 at 01:50:04PM +0530, Sathvika Vasireddy wrote: Christophe Leroy (4): objtool: Fix SEGFAULT objtool: Use target file endianness instead of a compiled con

Re: [PATCH v4 1/2] mm/tlbbatch: Introduce arch_tlbbatch_should_defer()

2022-09-21 Thread Barry Song
On Wed, Sep 21, 2022 at 8:45 PM Yicong Yang wrote: > > From: Anshuman Khandual > > The entire scheme of deferred TLB flush in reclaim path rests on the > fact that the cost to refill TLB entries is less than flushing out > individual entries by sending IPI to remote CPUs. But architecture > can h

[PATCH v4 0/2] mm: arm64: bring up BATCHED_UNMAP_TLB_FLUSH

2022-09-21 Thread Yicong Yang
From: Yicong Yang Though ARM64 has the hardware to do tlb shootdown, the hardware broadcasting is not free. A simplest micro benchmark shows even on snapdragon 888 with only 8 cores, the overhead for ptep_clear_flush is huge even for paging out one page mapped by only one process: 5.36% a.out

[PATCH v4 1/2] mm/tlbbatch: Introduce arch_tlbbatch_should_defer()

2022-09-21 Thread Yicong Yang
From: Anshuman Khandual The entire scheme of deferred TLB flush in reclaim path rests on the fact that the cost to refill TLB entries is less than flushing out individual entries by sending IPI to remote CPUs. But architecture can have different ways to evaluate that. Hence apart from checking TT

[PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-21 Thread Yicong Yang
From: Barry Song on x86, batched and deferred tlb shootdown has lead to 90% performance increase on tlb shootdown. on arm64, HW can do tlb shootdown without software IPI. But sync tlbi is still quite expensive. Even running a simplest program which requires swapout can prove this is true, #incl

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-21 Thread Nadav Amit
On Sep 20, 2022, at 11:53 PM, Anshuman Khandual wrote: > ⚠ External Email > > On 8/22/22 13:51, Yicong Yang wrote: >> +static inline void arch_tlbbatch_add_mm(struct arch_tlbflush_unmap_batch >> *batch, >> + struct mm_struct *mm, >> +

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-21 Thread Barry Song
On Wed, Sep 21, 2022 at 6:53 PM Anshuman Khandual wrote: > > > On 8/22/22 13:51, Yicong Yang wrote: > > +static inline void arch_tlbbatch_add_mm(struct arch_tlbflush_unmap_batch > > *batch, > > + struct mm_struct *mm, > > + u

Re: [PATCH v2 4/4] powerpc/64s: Enable KFENCE on book3s64

2022-09-21 Thread Christophe Leroy
Le 21/09/2022 à 04:02, Nicholas Miehlbradt a écrit : > KFENCE support was added for ppc32 in commit 90cbac0e995d > ("powerpc: Enable KFENCE for PPC32"). > Enable KFENCE on ppc64 architecture with hash and radix MMUs. > It uses the same mechanism as debug pagealloc to > protect/unprotect pages. Al

[PATCH v6 25/25] powerpc/64e: Clear gprs on interrupt routine entry on Book3E

2022-09-21 Thread Rohan McLure
Zero GPRS r14-r31 on entry into the kernel for interrupt sources to limit influence of user-space values in potential speculation gadgets. Prior to this commit, all other GPRS are reassigned during the common prologue to interrupt handlers and so need not be zeroised explicitly. This may be done s

[PATCH v6 24/25] powerpc/64s: Clear gprs on interrupt routine entry in Book3S

2022-09-21 Thread Rohan McLure
Zero GPRS r0, r2-r11, r14-r31, on entry into the kernel for all other interrupt sources to limit influence of user-space values in potential speculation gadgets. The remaining gprs are overwritten by entry macros to interrupt handlers, irrespective of whether or not a given handler consumes these r

[PATCH v6 23/25] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig

2022-09-21 Thread Rohan McLure
Add Kconfig option for enabling clearing of registers on arrival in an interrupt handler. This reduces the speculation influence of registers on kernel internals. The option will be consumed by 64-bit systems that feature speculation and wish to implement this mitigation. This patch only introduce

[PATCH v6 22/25] powerpc/64s: Clear user GPRs in syscall interrupt entry

2022-09-21 Thread Rohan McLure
Clear user state in gprs (assign to zero) to reduce the influence of user registers on speculation within kernel syscall handlers. Clears occur at the very beginning of the sc and scv 0 interrupt handlers, with restores occurring following the execution of the syscall handler. Signed-off-by: Rohan

[PATCH v6 21/25] powerpc: Provide syscall wrapper

2022-09-21 Thread Rohan McLure
Implement syscall wrapper as per s390, x86, arm64. When enabled cause handlers to accept parameters from a stack frame rather than from user scratch register state. This allows for user registers to be safely cleared in order to reduce caller influence on speculation within syscall routine. The wra

[PATCH v6 20/25] powerpc: Change system_call_exception calling convention

2022-09-21 Thread Rohan McLure
Change system_call_exception arguments to pass a pointer to a stack frame container caller state, as well as the original r0, which determines the number of the syscall. This has been observed to yield improved performance to passing them by registers, circumventing the need to allocate a stack fra

[PATCH v6 19/25] powerpc: Remove high-order word clearing on compat syscall entry

2022-09-21 Thread Rohan McLure
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-by: N

[PATCH v6 18/25] powerpc: Use common syscall handler type

2022-09-21 Thread Rohan McLure
Cause syscall handlers to be typed as follows when called indirectly throughout the kernel. This is to allow for better type checking. typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); Since both 32 and

[PATCH v6 17/25] powerpc: Enable compile-time check for syscall handlers

2022-09-21 Thread Rohan McLure
The table of syscall handlers and registered compatibility syscall handlers has in past been produced using assembly, with function references resolved at link time. This moves link-time errors to compile-time, by rewriting systbl.S in C, and including the linux/syscalls.h, linux/compat.h and asm/s

[PATCH v6 16/25] powerpc: Include all arch-specific syscall prototypes

2022-09-21 Thread Rohan McLure
Forward declare all syscall handler prototypes where a generic prototype is not provided in either linux/syscalls.h or linux/compat.h in asm/syscalls.h. This is required for compile-time type-checking for syscall handlers, which is implemented later in this series. 32-bit compatibility syscall han

[PATCH v6 15/25] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-09-21 Thread Rohan McLure
Arch-specific implementations of syscall handlers are currently used over generic implementations for the following reasons: 1. Semantics unique to powerpc 2. Compatibility syscalls require 'argument padding' to comply with 64-bit argument convention in ELF32 abi. 3. Parameter types or order is

[PATCH v6 14/25] powerpc: Provide do_ppc64_personality helper

2022-09-21 Thread Rohan McLure
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: Ne

[PATCH v6 13/25] powerpc: Remove direct call to mmap2 syscall handlers

2022-09-21 Thread Rohan McLure
Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Move the compatibility syscall definition for mmap2 to syscalls.c, so that all mmap implementations can share a helper function. Remove 'inline' on st

[PATCH v6 12/25] powerpc: Remove direct call to personality syscall handler

2022-09-21 Thread Rohan McLure
Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Fortunately, in the case of ppc64_personality, its call to sys_personality can be replaced with an invocation to the equivalent ksys_personality inline

[PATCH v6 11/25] powerpc/32: Remove powerpc select specialisation

2022-09-21 Thread Rohan McLure
Syscall #82 has been implemented for 32-bit platforms in a unique way on powerpc systems. This hack will in effect guess whether the caller is expecting new select semantics or old select semantics. It does so via a guess, based off the first parameter. In new select, this parameter represents the

[PATCH v6 10/25] powerpc: Use generic fallocate compatibility syscall

2022-09-21 Thread Rohan McLure
The powerpc fallocate compat syscall handler is identical to the generic implementation provided by commit 59c10c52f573f ("riscv: compat: syscall: Add compat_sys_call_table implementation"), and as such can be removed in favour of the generic implementation. A future patch series will replace more

[PATCH v6 09/25] asm-generic: compat: Support BE for long long args in 32-bit ABIs

2022-09-21 Thread Rohan McLure
32-bit ABIs support passing 64-bit integers by registers via argument translation. Commit 59c10c52f573 ("riscv: compat: syscall: Add compat_sys_call_table implementation") implements the compat_arg_u64 macro for efficiently defining little endian compatibility syscalls. Architectures supporting bi

[PATCH v6 08/25] powerpc: Fix fallocate and fadvise64_64 compat parameter combination

2022-09-21 Thread Rohan McLure
As reported[1] by Arnd, the arch-specific fadvise64_64 and fallocate compatibility handlers assume parameters are passed with 32-bit big-endian ABI. This affects the assignment of odd-even parameter pairs to the high or low words of a 64-bit syscall parameter. Fix fadvise64_64 fallocate compat han

[PATCH v6 07/25] powerpc/64s: Fix comment on interrupt handler prologue

2022-09-21 Thread Rohan McLure
Interrupt handlers on 64s systems will often need to save register state from the interrupted process to make space for loading special purpose registers or for internal state. Fix a comment documenting a common code path macro in the beginning of interrupt handlers where r10 is saved to the PACA

[PATCH v6 06/25] powerpc/64e: Clarify register saves and clears with {SAVE,ZEROIZE}_GPRS

2022-09-21 Thread Rohan McLure
The common interrupt handler prologue macro and the bad_stack trampolines include consecutive sequences of register saves, and some register clears. Neaten such instances by expanding use of the SAVE_GPRS macro and employing the ZEROIZE_GPR macro when appropriate. Also simplify an invocation of SA

[PATCH v6 05/25] powerpc/32: Clarify interrupt restores with REST_GPR macro in entry_32.S

2022-09-21 Thread Rohan McLure
Restoring the register state of the interrupted thread involves issuing a large number of predictable loads to the kernel stack frame. Issue the REST_GPR{,S} macros to clearly signal when this is happening, and bunch together restores at the end of the interrupt handler where the saved value is not

[PATCH v6 04/25] powerpc/64s: Use {ZEROIZE,SAVE,REST}_GPRS macros in sc, scv 0 handlers

2022-09-21 Thread Rohan McLure
Use the convenience macros for saving/clearing/restoring gprs in keeping with syscall calling conventions. The plural variants of these macros can store a range of registers for concision. This works well when the user gpr value we are hoping to save is still live. In the syscall interrupt handler