Re: [PATCH] powerpc/Kconfig: Force THREAD_SHIFT to at least 14 with KASAN

2022-05-31 Thread Christoph Hellwig
On Tue, May 31, 2022 at 04:16:19PM +1000, Michael Ellerman wrote: > I was thinking of doing it in C, similar to the way arm64 handles it. > > Something like below. It means we always double the stack size when > KASAN is enabled. I think it's preferable, as it will always work > regardless of whet

Re: [PATCH] powerpc/perf: Give generic PMU a nice name

2022-05-31 Thread Madhavan Srinivasan
On 5/26/22 12:07 PM, Joel Stanley wrote: When booting on a machine that uses the compat pmu driver we see this: [0.071192] GENERIC_COMPAT performance monitor hardware support registered Sorry that was my mistake. I agree having it as ISAv3 is better. Maddy Which is a bit shouty. Giv

[PATCH] powerpc/papr_scm: use dev_get_drvdata

2022-05-31 Thread Haowen Bai
Eliminate direct accesses to the driver_data field. Signed-off-by: Haowen Bai --- arch/powerpc/platforms/pseries/papr_scm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index 181b855b305

Re: [PATCH] powerpc/Kconfig: Force THREAD_SHIFT to at least 14 with KASAN

2022-05-31 Thread Christophe Leroy
Le 31/05/2022 à 09:41, Christoph Hellwig a écrit : > On Tue, May 31, 2022 at 04:16:19PM +1000, Michael Ellerman wrote: >> I was thinking of doing it in C, similar to the way arm64 handles it. >> >> Something like below. It means we always double the stack size when >> KASAN is enabled. I think it

Re: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19

2022-05-31 Thread Rob Herring
On Mon, May 30, 2022 at 12:26 AM Christian Zigotzky wrote: > > On 27 May 2022 at 04:23 pm, Rob Herring wrote: > > The issue is in drivers/usb/host/fsl-mph-dr-of.c which copies the > > resources to a child platform device. Can you try the following > > change: > > > > diff --git a/drivers/usb/host/

Re: [PATCH] RISC-V: Prepare dropping week attribute from arch_kexec_apply_relocations[_add]

2022-05-31 Thread Palmer Dabbelt
On Mon, 30 May 2022 22:58:03 PDT (-0700), u.kleine-koe...@pengutronix.de wrote: On Mon, May 30, 2022 at 04:11:27PM -0700, Palmer Dabbelt wrote: On Mon, 30 May 2022 12:41:33 PDT (-0700), u.kleine-koe...@pengutronix.de wrote: > Hello, > > On Mon, May 30, 2022 at 11:58:16AM -0700, Palmer Dabbelt w

Re: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19

2022-05-31 Thread Christian Zigotzky
> On 31. May 2022, at 15:46, Rob Herring wrote: > > On Mon, May 30, 2022 at 12:26 AM Christian Zigotzky > wrote: >> >>> On 27 May 2022 at 04:23 pm, Rob Herring wrote: >>> The issue is in drivers/usb/host/fsl-mph-dr-of.c which copies the >>> resources to a child platform device. Can you try

[PATCH 1/2] powerpc/irq: Make __do_irq() static

2022-05-31 Thread Christophe Leroy
Since commit 48cf12d88969 ("powerpc/irq: Inline call_do_irq() and call_do_softirq()"), __do_irq() is not used outside irq.c Reorder functions and make __do_irq() static and drop the declaration in irq.h. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/irq.h | 1 - arch/powerpc/ker

[PATCH 2/2] powerpc/irq: Perform stack_overflow detection after switching to IRQ stack

2022-05-31 Thread Christophe Leroy
When KASAN is enabled, as shown by the Oops below, the 2k limit is not enough to allow stack dump after a stack overflow detection when CONFIG_DEBUG_STACKOVERFLOW is selected: do_IRQ: stack overflow: 1984 CPU: 0 PID: 126 Comm: systemd-udevd Not tainted 5.18.0-gentoo-PMacG4 #1

Re: [PATCH] xen: replace xen_remap() with memremap()

2022-05-31 Thread Boris Ostrovsky
On 5/30/22 4:26 AM, Juergen Gross wrote: xen_remap() is used to establish mappings for frames not under direct control of the kernel: for Xenstore and console ring pages, and for grant pages of non-PV guests. Today xen_remap() is defined to use ioremap() on x86 (doing uncached mappings), and i

Re: [PATCH v5] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-31 Thread Russell King (Oracle)
l Simek , Thomas Bogendoerfer , linux-par...@vger.kernel.org, Max Filippov , linux-ker...@vger.kernel.org, Dinh Nguyen , linux-ri...@lists.infradead.org, Palmer Dabbelt , Sven Schnelle , Guo Ren , linux-hexa...@vger.kernel.org, Ivan Kokshaysky , Johannes Berg , linuxppc-dev@lists.ozlabs.org,

Re: [PATCH v5] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-31 Thread Heiko Carstens
hal Simek , Thomas Bogendoerfer , linux-par...@vger.kernel.org, Max Filippov , linux-ker...@vger.kernel.org, Dinh Nguyen , linux-ri...@lists.infradead.org, Palmer Dabbelt , Sven Schnelle , Guo Ren , linux-hexa...@vger.kernel.org, Ivan Kokshaysky , Johannes Berg , linuxppc-dev@lists.ozlabs.org

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Segher Boessenkool
Hi! On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > More problematically it doesn't compile at all with GCC 12, due to the > fact that it returns the char buffer declared inside the macro: It returns a pointer to a buffer on stack. It is not valid C to access that buffer afte

Re: [PATCH] xen: replace xen_remap() with memremap()

2022-05-31 Thread Stefano Stabellini
On Mon, 30 May 2022, Juergen Gross wrote: > xen_remap() is used to establish mappings for frames not under direct > control of the kernel: for Xenstore and console ring pages, and for > grant pages of non-PV guests. > > Today xen_remap() is defined to use ioremap() on x86 (doing uncached > mapping

Re: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19

2022-05-31 Thread Christian Zigotzky
On 31. May 2022, at 15:46, Rob Herring wrote: Do you have a dmesg log? The other way to fix is creating a IRQ resource and adding it to the child device resources. Rob —— Rob, Do you mean a dmesg from the boot loop? The other way is a good idea. Cheers, Christian

outside array bounds error on ppc64_defconfig, GCC 12.1.0

2022-05-31 Thread Bagas Sanjaya
Hi, I'm trying to verify Drop ppc_inst_as_str() patch on [1] by performing ppc64_defconfig build with powerpc64-unknown-linux-gnu-gcc (GCC 12.1.0). The patch is applied on top of powerpc tree, next branch. I got outside array bounds error: CC arch/powerpc/kernel/dbell.o In function 'do_by

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Bagas Sanjaya
Hi, On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > The ppc_inst_as_str() macro tries to make printing variable length, > aka "prefixed", instructions convenient. It mostly succeeds, but it does > hide an on-stack buffer, which triggers stack protector. > > More problematicall

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Bagas Sanjaya
On 6/1/22 10:03, Bagas Sanjaya wrote: >> >> Reported-by: Bagas Sanjaya >> Reported-by: Petr Mladek >> Signed-off-by: Michael Ellerman > > The arch/powerpc/kernel/trace/ftrace.c builds successfully, however > there is also other build error for which I have reported at [1]. > > Thanks. > > Tes

[PATCH kernel] powerpc/pseries/iommu: Print ibm,query-pe-dma-windows parameters

2022-05-31 Thread Alexey Kardashevskiy
PowerVM has a stricter policy about allocating TCEs for LPARs and often there is not enough TCEs for 1:1 mapping, this adds the supported numbers into dev_info() to help analyzing bugreports. Signed-off-by: Alexey Kardashevskiy --- A PowerVM admin can enable "enlarged IO capacity" for a passed t

[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/incl

[PATCH 2/6] powerpc: Provide syscall wrapper

2022-05-31 Thread Rohan McLure
Syscall wrapper implemented as per s390, x86, arm64, providing the option for gprs to be cleared on entry to the kernel, reducing caller influence influence on speculation within syscall routine. The wrapper is a macro that emits syscall handler implementations with parameters passed by stack point

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

2022-05-31 Thread Rohan McLure
Clears user state in gprs to reduce the influence of user registers on speculation within kernel syscall handlers. Remove conditional branches on result of `syscall_exit_prepare` to restore non-volatile gprs, as these registers are always cleared and hence always must be restored. Signed-off-by:

[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/inte

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

2022-05-31 Thread Rohan McLure
Since some power syscall handlers call into other syscall handlers with the usual in-register calling convention, emit symbols for both conventions when required. The prototypes for handlers supporting in-register parameters should exist in a header rather than immediately preceding their usage. S

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

2022-05-31 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