[PATCH] powerpc/pseries/eeh: Fix some kernel-doc warnings

2022-10-30 Thread Bo Liu
Fixes the following W=1 kernel build warning(s): arch/powerpc/platforms/pseries/eeh_pseries.c:163: warning: Function parameter or member 'config_addr' not described in 'pseries_eeh_phb_reset' arch/powerpc/platforms/pseries/eeh_pseries.c:163: warning: Excess function parameter 'config_adddr' d

[RFC PATCH 19/19] powerpc/64: ELFv2 use reserved word in the stack frame for the regs marker

2022-10-30 Thread Nicholas Piggin
There are 4 unused bytes in the minimum frame in the ELFv2 ABI. At the risk of causing a future ABI incompatibility, use this and save 16 bytes from interrupt and switch frames. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 15 ++- 1 file changed, 10 insertio

[RFC PATCH 18/19] powerpc: change stack marker memory operations to 32-bit

2022-10-30 Thread Nicholas Piggin
The marker is a 32-bit constant across all platforms now, so use 32-bit memory accesses. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h| 1 - arch/powerpc/kernel/exceptions-64e.S | 2 +- arch/powerpc/kernel/exceptions-64s.S | 2 +- arch/powerpc/kernel/interrupt_64.S |

[RFC PATCH 17/19] powerpc: remove STACK_FRAME_OVERHEAD

2022-10-30 Thread Nicholas Piggin
This is equal to STACK_FRAME_MIN_SIZE on 32-bit and 64-bit ELFv1, and no longer used in 64-bit ELFv2, so replace it with that constant. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --gi

[RFC PATCH 16/19] powerpc/64: ELFv2 use minimal stack frames in int and switch frame sizes

2022-10-30 Thread Nicholas Piggin
This requires an extra 16 bytes beyond the minimum frame size for the aligned regs marker for the int frame. The switch frame needs to match that because they share some offset definitions. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 21 +++-- 1 file ch

[RFC PATCH 15/19] powerpc: allow minimum sized kernel stack frames

2022-10-30 Thread Nicholas Piggin
This affects only 64-bit ELFv2 kernels, and reduces the minimum asm-created stack frame size from 112 to 32 byte on those kernels. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/head_40x.S | 2 +- arch/powerpc/kernel/head_44x.S | 6 +++--- arch/powerpc/kernel/head_64.S

[RFC PATCH 14/19] powerpc: split validate_sp into two functions

2022-10-30 Thread Nicholas Piggin
Most callers just want to validate an arbitrary kernel stack pointer, some need a particular size. Make the size case the exceptional one with an extra function. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/processor.h | 15 --- arch/powerpc/kernel/process.c| 2

[RFC PATCH 13/19] powerpc: copy_thread add a back chain to the switch stack frame

2022-10-30 Thread Nicholas Piggin
Stack unwinders need LR and the back chain as a minimum. The switch stack uses regs->nip for its return pointer rather than lrsave, so that was not filled in, and neither was the back chain. With this and the previous change, a stack trace in the switch or interrupt stack goes from looking like th

[RFC PATCH 12/19] powerpc: copy_thread fill in interrupt frame marker and back chain

2022-10-30 Thread Nicholas Piggin
Backtraces will not recognise the fork system call interrupt without the regs marker. And at least perf starts unwinding the user stack from gpr[1] directly, but regular interrupt entry from userspace creates the back chain to the user stack, so do this too, to be consistent. Signed-off-by: Nichol

[RFC PATCH 11/19] powerpc: add a define for the switch frame size and regs offset

2022-10-30 Thread Nicholas Piggin
This is open-coded in process.c, ppc32 uses a different define with the same value, and the C definition is name differently which makes it an extra indirection to grep for. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 6 -- arch/powerpc/kernel/asm-offsets.c | 2 +

[RFC PATCH 10/19] powerpc: add a define for the user interrupt frame size

2022-10-30 Thread Nicholas Piggin
The user interrupt frame is a different size from the kernel frame, so give it its own name. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 6 +++--- arch/powerpc/kernel/process.c | 6 +++--- arch/powerpc/kernel/stacktrace.c | 4 ++-- 3 files changed, 8 insertions(+)

[RFC PATCH 09/19] powerpc: Rename STACK_FRAME_MARKER and derive it from frame offset

2022-10-30 Thread Nicholas Piggin
This is a count of longs from the stack pointer to the regs marker. Rename it to make it more distinct from the other byte offsets. It can be derived from the byte offset definitions just added. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 4 ++-- arch/powerpc/kernel/pr

[RFC PATCH 08/19] powerpc: add a definition for the marker offset within the interrupt frame

2022-10-30 Thread Nicholas Piggin
Define a constant rather than open-code the offset for the "regs" marker. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 2 ++ arch/powerpc/kernel/entry_32.S | 2 +- arch/powerpc/kernel/exceptions-64e.S| 2 +- arch/powerpc/kernel/exceptions-64s.S

[RFC PATCH 07/19] powerpc: add definition for pt_regs offset within an interrupt frame

2022-10-30 Thread Nicholas Piggin
This is a common offset that currently uses the overloaded STACK_FRAME_OVERHEAD constant. It's easier to read and more flexible to use a specific regs offset for this. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 2 + arch/powerpc/kernel/asm-offsets.c

[RFC PATCH 06/19] powerpc: simplify ppc_save_regs

2022-10-30 Thread Nicholas Piggin
Adjust the pt_regs pointer so the interrupt frame offsets can be used directly to save registers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/ppc_save_regs.S | 58 +++-- 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/arch/powerpc/kernel/ppc_sav

[RFC PATCH 05/19] powerpc/32: Use load and store multiple in GPR save/restore macros

2022-10-30 Thread Nicholas Piggin
--- arch/powerpc/include/asm/ppc_asm.h | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 753a2757bcd4..ac44383d350a 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerp

[RFC PATCH 04/19] powerpc/pseries: hvcall stack frame overhead

2022-10-30 Thread Nicholas Piggin
This call may use the min size stack frame. The scratch space used is in the caller's parameter area frame, not this function's frame. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/hvCall.S | 38 + 1 file changed, 20 insertions(+), 18 deletions(-) dif

[RFC PATCH 03/19] powerpc/64: Remove asm interrupt tracing call helpers

2022-10-30 Thread Nicholas Piggin
These are unused. Remove. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/irqflags.h | 29 - 1 file changed, 29 deletions(-) diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h index 1a6c1ce17735..81e0a5025be8 100644 --

[RFC PATCH 02/19] powerpc: Rearrange copy_thread child stack creation

2022-10-30 Thread Nicholas Piggin
This makes it a bit clearer where the stack frame is created, and will allow easier use of some of the stack offset constants in a later change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/p

[RFC PATCH 00/19] Remove STACK_FRAME_OVERHEAD

2022-10-30 Thread Nicholas Piggin
This is some quick hacking, hardly tested but might have potential. I think we're not validating the perf kernel stack walker bounds quite correctly, and not setting up decent stack frames for the child in copy_thread. So at least those two things we could do. Maybe patch 1 should go upstream as a

[RFC PATCH 01/19] powerpc/perf: callchain validate kernel stack pointer bounds

2022-10-30 Thread Nicholas Piggin
The interrupt frame detection and loads from the hypothetical pt_regs are not bounds-checked. The next-frame validation only bounds-checks STACK_FRAME_OVERHEAD, which does not include the pt_regs. Add another test for this. Signed-off-by: Nicholas Piggin --- Could the user set r1 to be equal to

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

2022-10-30 Thread Michael Ellerman
Andreas Schwab writes: > On Okt 30 2022, Arnd Bergmann wrote: > >> On Sun, Oct 30, 2022, at 16:34, Andreas Schwab wrote: >>> This breaks powerpc32. The fallocate syscall misinterprets its >>> arguments. >> >> It was fixed in > > Nope. Ack.

Re: [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings

2022-10-30 Thread chenlifu
在 2022/8/19 21:06, Chen Lifu 写道: 1. ppc_override_l2cr and ppc_override_l2cr_value are only used in l2cr_init() function, remove them and used *l2cr directly. 2. has_l2cache is not used outside of the file, so mark it static and do not initialise statics to 0. Fixes the following warning:

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

2022-10-30 Thread Mike Kravetz
On 10/30/22 15:45, Peter Xu wrote: > On Fri, Oct 28, 2022 at 11:11:08AM -0700, Mike Kravetz wrote: > > + } else { > > + if (is_hugetlb_entry_migration(entry)) { > > + spin_unlock(ptl); > > + hugetlb_vma_unlock_read(vma); > > Just noticed it when pull

[PATCH v5] hugetlb: simplify hugetlb handling in follow_page_mask

2022-10-30 Thread Mike Kravetz
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 the only architecture which provides a follow_h

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

2022-10-30 Thread Andreas Schwab
On Okt 30 2022, Arnd Bergmann wrote: > On Sun, Oct 30, 2022, at 16:34, Andreas Schwab wrote: >> This breaks powerpc32. The fallocate syscall misinterprets its >> arguments. > > It was fixed in Nope. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 D

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

2022-10-30 Thread Peter Xu
On Fri, Oct 28, 2022 at 11:11:08AM -0700, Mike Kravetz wrote: > +struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, > + unsigned long address, unsigned int flags) > +{ > + struct hstate *h = hstate_vma(vma); > + struct mm_struct *mm = vma->vm_mm; >

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

2022-10-30 Thread Arnd Bergmann
On Sun, Oct 30, 2022, at 16:34, Andreas Schwab wrote: > This breaks powerpc32. The fallocate syscall misinterprets its > arguments. It was fixed in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e237506238352f3bfa9cf3983cdab873e35651eb Arnd

Re: Issues with the first PowerPC updates for the kernel 6.1 #forregzbot

2022-10-30 Thread Thorsten Leemhuis
[Note: this mail is primarily send for documentation purposes and/or for regzbot, my Linux kernel regression tracking bot. That's why I removed most or all folks from the list of recipients, but left any that looked like a mailing lists. These mails usually contain '#forregzbot' in the subject, to

Re: [PATCH 1/2] powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs

2022-10-30 Thread Andreas Schwab
On Okt 12 2022, Nicholas Piggin wrote: > diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl > b/arch/powerpc/kernel/syscalls/syscall.tbl > index 2bca64f96164..e9e0df4f9a61 100644 > --- a/arch/powerpc/kernel/syscalls/syscall.tbl > +++ b/arch/powerpc/kernel/syscalls/syscall.tbl > @@ -228,8 +228,

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

2022-10-30 Thread Andreas Schwab
It probably breaks every syscall with a 64-bit argument. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

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

2022-10-30 Thread Andreas Schwab
This breaks powerpc32. The fallocate syscall misinterprets its arguments. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-30 Thread Christian Zigotzky
On 29 October 2022 at 01:44 pm, Christian Zigotzky wrote: On 17 October 2022 at 09:53 am, Christian Zigotzky wrote: On 17. Oct 2022, at 02:43, Michael Ellerman wrote: Previously BIG_ENDIAN && GENERIC_CPU would use -mcpu=power5, now it uses -mcpu=power4. Maybe this is the issue. We will wait a

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-30 Thread Christian Zigotzky
On 29 October 2022 at 5:33 pm, Segher Boessenkool wrote: On Mon, Oct 17, 2022 at 09:53:04AM +0200, Christian Zigotzky wrote: On 17. Oct 2022, at 02:43, Michael Ellerman wrote: Previously BIG_ENDIAN && GENERIC_CPU would use -mcpu=power5, now it uses -mcpu=power4. Maybe this is the issue. We wil