[PATCH] KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors

2021-06-01 Thread Nicholas Piggin
From: Suraj Jitindar Singh The POWER9 vCPU TLB management code assumes all threads in a core share a TLB, and that TLBIEL execued by one thread will invalidate TLBs for all threads. This is not the case for SMT8 capable POWER9 and POWER10 (big core) processors, where the TLB is split between

[PATCH] powerpc: 52xx: add fallthrough in mpc52xx_wdt_ioctl()

2021-06-01 Thread trix
From: Tom Rix With gcc 10.3, there is this compiler error compiler.h:56:26: error: this statement may fall through [-Werror=implicit-fallthrough=] mpc52xx_gpt.c:586:2: note: here 586 | case WDIOC_GETTIMEOUT: | ^~~~ So add the fallthrough pseudo keyword. Signed-off-by: Tom Rix ---

[PATCH] powerpc/8xx: select CPM1 for MPC8XXFADS

2021-06-01 Thread trix
From: Tom Rix With MPC8XXFADS, there is this linker error ppc64-linux-ld: m8xx_setup.o: in function `cpm_cascade': m8xx_setup.c: undefined reference to `cpm_get_irq' cpm_get_irq() is conditionally complied by CPM1 So add a select, like the other plaforms Signed-off-by: Tom Rix ---

[PATCH 2/5] powerpc/ps3: Warn on PS3 device errors

2021-06-01 Thread Geoff Levand
To aid debugging PS3 boot problems change the log level of several PS3 device errors from pr_debug to pr_warn. Signed-off-by: Geoff Levand --- arch/powerpc/platforms/ps3/system-bus.c | 9 + drivers/ps3/ps3-vuart.c | 2 +- drivers/ps3/ps3av.c | 22

[PATCH 1/5] powerpc/ps3: Add CONFIG_PS3_VERBOSE_RESULT option

2021-06-01 Thread Geoff Levand
To aid debugging, add a new PS3 kernel config option PS3_VERBOSE_RESULT that, when enabled, will print more verbose messages for the result of LV1 hypercalls. Signed-off-by: Geoff Levand --- arch/powerpc/include/asm/ps3.h | 2 +- arch/powerpc/platforms/ps3/Kconfig | 9 + 2 files

[PATCH 4/5] net/ps3_gelic: Add gelic_descr structures

2021-06-01 Thread Geoff Levand
Create two new structures, struct gelic_hw_regs and struct gelic_chain_link, and replace the corresponding members of struct gelic_descr with the new structures. struct gelic_hw_regs holds the register variables used by the gelic hardware device. struct gelic_chain_link holds variables used to

[PATCH 3/5] powerpc/ps3: Add dma_mask to ps3_dma_region

2021-06-01 Thread Geoff Levand
Commit f959dcd6ddfd29235030e8026471ac1b022ad2b0 (dma-direct: Fix potential NULL pointer dereference) added a null check on the dma_mask pointer of the kernel's device structure. Add a dma_mask variable to the ps3_dma_region structure and set the device structure's dma_mask pointer to point to

[PATCH 0/5] DMA fixes for PS3 device drivers

2021-06-01 Thread Geoff Levand
Hi, This is a set of patches that fix various DMA related problems in the PS3 device drivers, and add better error checking and improved message logging. The gelic network driver had a number of problems and most of the changes are in it's sources. Please consider. -Geoff The following

[PATCH 5/5] net/ps3_gelic: Cleanups, improve logging

2021-06-01 Thread Geoff Levand
General source cleanups and improved logging messages. Signed-off-by: Geoff Levand --- drivers/net/ethernet/toshiba/ps3_gelic_net.c | 395 ++- 1 file changed, 216 insertions(+), 179 deletions(-) diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c

Re: [PATCH] powerpc/barrier: Avoid collision with clang's __lwsync macro

2021-06-01 Thread Nick Desaulniers
On Fri, May 28, 2021 at 11:29 AM Nathan Chancellor wrote: > > A change in clang 13 results in the __lwsync macro being defined as > __builtin_ppc_lwsync, which emits 'lwsync' or 'msync' depending on what > the target supports. Indeed, $ clang --target=powerpc64le-linux-gnu -mcpu=e500 -m32 for

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-06-01 Thread Paul Moore
On Mon, May 31, 2021 at 4:24 AM Daniel Borkmann wrote: > On 5/29/21 8:48 PM, Paul Moore wrote: > [...] > > Daniel's patch side steps that worry by just doing the lockdown > > permission check when the BPF program is loaded, but that isn't a > > great solution if the policy changes afterward. I

Re: [PATCH] ASoC: fsl-asoc-card: Set .owner attribute when registering card.

2021-06-01 Thread Mark Brown
On Thu, 27 May 2021 18:34:09 +0200, Nicolas Cavallari wrote: > Otherwise, when compiled as module, a WARN_ON is triggered: > > WARNING: CPU: 0 PID: 5 at sound/core/init.c:208 snd_card_new+0x310/0x39c [snd] > [...] > CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.10.39 #1 > Hardware name: Freescale

Re: [PATCH] Documentation PCI: Fix typo in pci-error-recovery.rst

2021-06-01 Thread Bjorn Helgaas
On Mon, May 31, 2021 at 04:12:15PM +0800, Wesley Sheng wrote: > Replace "It" with "If", since it is a conditional statement. > > Signed-off-by: Wesley Sheng Applied to pci/error for v5.14 with Krzysztof's reviewed-by and subject "Documentation: PCI: Fix typo in pci-error-recovery.rst" to match

Re: [RFC PATCH 1/6] trace/stack: Move code to save the stack trace into a separate function

2021-06-01 Thread Steven Rostedt
On Fri, 21 May 2021 12:18:36 +0530 "Naveen N. Rao" wrote: > In preparation to add support for stack tracer to powerpc, move code to > save stack trace and to calculate the frame sizes into a separate weak > function. Also provide access to some of the data structures used by the > stack trace

Re: [PATCH] powerpc: make show_stack's stack walking KASAN-safe

2021-06-01 Thread Daniel Axtens
"Naveen N. Rao" writes: > Daniel Axtens wrote: >> Make our stack-walking code KASAN-safe by using READ_ONCE_NOCHECK - >> generic code, arm64, s390 and x86 all do this for similar sorts of >> reasons: when unwinding a stack, we might touch memory that KASAN has >> marked as being out-of-bounds.

Re: [RFC PATCH 2/6] powerpc/trace: Add support for stack tracer

2021-06-01 Thread Naveen N. Rao
Naveen N. Rao wrote: + +unsigned long ftrace_get_traced_func_if_no_stackframe(unsigned long ip, unsigned long *stack) +{ + if (!is_ftrace_entry(ip)) + return 0; + + if (IS_ENABLED(CONFIG_PPC32)) + return stack[11]; /* see MCOUNT_SAVE_FRAME */ + + if

Re: simplify gendisk and request_queue allocation for bio based drivers

2021-06-01 Thread Jens Axboe
On 5/20/21 11:50 PM, Christoph Hellwig wrote: > Hi all, > > this series is the first part of cleaning up lifetimes and allocation of > the gendisk and request_queue structure. It adds a new interface to > allocate the disk and queue together for bio based drivers, and a helper > for cleanup/free

Re: [PATCH] powerpc: make show_stack's stack walking KASAN-safe

2021-06-01 Thread Naveen N. Rao
Daniel Axtens wrote: Make our stack-walking code KASAN-safe by using READ_ONCE_NOCHECK - generic code, arm64, s390 and x86 all do this for similar sorts of reasons: when unwinding a stack, we might touch memory that KASAN has marked as being out-of-bounds. In ppc64 KASAN development, I hit this

[PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy'

2021-06-01 Thread Baokun Li
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppu_mb_stat': arch/powerpc/platforms/cell/spufs/switch.c:1660:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] arch/powerpc/platforms/cell/spufs/switch.c: In

[PATCH -next] powerpc/spider-pci: Remove set but not used variable 'val'

2021-06-01 Thread Baokun Li
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/platforms/cell/spider-pci.c: In function 'spiderpci_io_flush': arch/powerpc/platforms/cell/spider-pci.c:28:6: warning: variable ‘val’ set but not used [-Wunused-but-set-variable] It never used since introduction. Signed-off-by: Baokun

Re: [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy'

2021-06-01 Thread Arnd Bergmann
On Tue, Jun 1, 2021 at 10:43 AM Baokun Li wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppu_mb_stat': > arch/powerpc/platforms/cell/spufs/switch.c:1660:6: warning: > variable ‘dummy’ set but not used

[PATCH] powerpc/xmon: Add support for running a command on all cpus in xmon

2021-06-01 Thread Naveen N. Rao
It is sometimes desirable to run a command on all cpus in xmon. A typical scenario is to obtain the backtrace from all cpus in xmon if there is a soft lockup. Add rudimentary support for the same. The command to be run on all cpus should be prefixed with 'c#'. As an example, 'c#t' will run 't'

Re: [PATCH] Revert "powerpc: Switch to relative jump labels"

2021-06-01 Thread Michael Ellerman
Roman Bolshakov writes: > On Sat, May 29, 2021 at 09:39:49AM +1000, Michael Ellerman wrote: >> Roman Bolshakov writes: >> > This reverts commit b0b3b2c78ec075cec4721986a95abbbac8c3da4f. >> > >> > Otherwise, direct kernel boot with initramfs no longer works in QEMU. >> > It's broken in some

Re: [PATCH] powerpc: make show_stack's stack walking KASAN-safe

2021-06-01 Thread Christophe Leroy
Le 28/05/2021 à 09:48, Daniel Axtens a écrit : Make our stack-walking code KASAN-safe by using READ_ONCE_NOCHECK - generic code, arm64, s390 and x86 all do this for similar sorts of reasons: when unwinding a stack, we might touch memory that KASAN has marked as being out-of-bounds. In ppc64

[PATCH] selftests/powerpc: Remove the repeated declaration

2021-06-01 Thread Shaokun Zhang
Function 'event_ebb_init' and 'event_leader_ebb_init' are declared twice in the header file, so remove the repeated declaration. Cc: Michael Ellerman Signed-off-by: Shaokun Zhang --- tools/testing/selftests/powerpc/pmu/ebb/ebb.h | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH v3 4/4] powerpc/64s: enable MMU_LAZY_TLB_SHOOTDOWN

2021-06-01 Thread Nicholas Piggin
On a 16-socket 192-core POWER8 system, a context switching benchmark with as many software threads as CPUs (so each switch will go in and out of idle), upstream can achieve a rate of about 1 million context switches per second. After this patch it goes up to 118 million. Signed-off-by: Nicholas

[PATCH v3 3/4] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2021-06-01 Thread Nicholas Piggin
On big systems, the mm refcount can become highly contented when doing a lot of context switching with threaded applications (particularly switching between the idle thread and an application thread). Abandoning lazy tlb slows switching down quite a bit in the important user->idle->user cases, so

[PATCH v3 2/4] lazy tlb: allow lazy tlb mm switching to be configurable

2021-06-01 Thread Nicholas Piggin
Add CONFIG_MMU_LAZY_TLB which can be configured out to disable the lazy tlb mechanism entirely, and switches to init_mm when switching to a kernel thread. NOMMU systems could easily go without this and save a bit of code and the refcount atomics, because their mm switch is a no-op. They have not

[PATCH v3 1/4] lazy tlb: introduce lazy mm refcount helper functions

2021-06-01 Thread Nicholas Piggin
Add explicit _lazy_tlb annotated functions for lazy mm refcounting. This makes lazy mm references more obvious, and allows explicit refcounting to be removed if it is not used. Signed-off-by: Nicholas Piggin --- arch/arm/mach-rpc/ecard.c| 2 +- arch/powerpc/kernel/smp.c

[PATCH v3 0/4] shoot lazy tlbs

2021-06-01 Thread Nicholas Piggin
There haven't been objections to the series since last posting, this is just a rebase and tidies up a few comments minor patch rearranging. Thanks, Nick Nicholas Piggin (4): lazy tlb: introduce lazy mm refcount helper functions lazy tlb: allow lazy tlb mm switching to be configurable lazy