[PATCH] selftests/powerpc: Fix uninitialized variable warning

2020-12-01 Thread Harish
Patch fixes uninitialized variable warning in bad_accesses test which causes the selftests build to fail in older distibutions bad_accesses.c: In function ‘bad_access’: bad_accesses.c:52:9: error: ‘x’ may be used uninitialized in this function [-Werror=maybe-uninitialized] printf("Bad - no SEG

[PATCH] powerpc/perf: Invoke per-CPU variable access with disabled interrupts

2020-12-01 Thread Athira Rajeev
The power_pmu_event_init() callback access per-cpu variable (cpu_hw_events) to check for event constraints and Branch Stack (BHRB). Current usage is to disable preemption when accessing the per-cpu variable, but this does not prevent timer callback from interrupting event_init. Fix this by using 'l

Re: [PATCH kernel v2] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Cédric Le Goater
On 12/1/20 8:39 AM, Alexey Kardashevskiy wrote: > From: Oliver O'Halloran > > When a passthrough IO adapter is removed from a pseries machine using hash > MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS > to clear all page table entries related to the adapter. If some a

Re: [PATCH kernel v2] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Frederic Barrat
On 01/12/2020 08:39, Alexey Kardashevskiy wrote: From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table entries related to the adapter. If some are s

[PATCH] powerpc/mm: Don't see NULL pointer dereference as a KUAP fault

2020-12-01 Thread Christophe Leroy
Sometimes, NULL pointer dereferences are expected. Even when they are accidental they are unlikely an exploit attempt because the first page is never mapped. The exemple below shows what we get when invoking the "show task" sysrq handler, by writing 't' in /proc/sysrq-trigger [ 1117.202054] -

Re: [PATCH v2] clk: renesas: r9a06g032: Drop __packed for portability

2020-12-01 Thread Stephen Rothwell
Hi Geert, On Mon, 30 Nov 2020 09:57:43 +0100 Geert Uytterhoeven wrote: > > The R9A06G032 clock driver uses an array of packed structures to reduce > kernel size. However, this array contains pointers, which are no longer > aligned naturally, and cannot be relocated on PPC64. Hence when > compi

Re: [PATCH 0/5] drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Daniel Thompson
On Mon, Nov 30, 2020 at 03:21:32PM +, Andrey Zhizhikin wrote: > Since the removal of generic_bl driver from the source tree in commit > 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is > unused") BACKLIGHT_GENERIC config option became obsolete as well and > therefore subject to

Re: [RFC PATCH] powerpc: show registers when unwinding interrupt frames

2020-12-01 Thread Christophe Leroy
Le 07/11/2020 à 03:33, Nicholas Piggin a écrit : It's often useful to know the register state for interrupts in the stack frame. In the below example (with this patch applied), the important information is the state of the page fault. A blatant case like this probably rather should have the p

[RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Shivaprasad G Bhat
Tha patch implements SCM async-flush hcall and sets the ND_REGION_ASYNC capability when the platform device tree has "ibm,async-flush-required" set. The below demonstration shows the map_sync behavior when ibm,async-flush-required is present in device tree. (https://github.com/avocado-framework-te

Re: [RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Pankaj Gupta
> Tha patch implements SCM async-flush hcall and sets the > ND_REGION_ASYNC capability when the platform device tree > has "ibm,async-flush-required" set. So, you are reusing the existing ND_REGION_ASYNC flag for the hypercall based async flush with device tree discovery? Out of curiosity, does v

Re: [RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Aneesh Kumar K.V
On 12/1/20 6:17 PM, Pankaj Gupta wrote: Tha patch implements SCM async-flush hcall and sets the ND_REGION_ASYNC capability when the platform device tree has "ibm,async-flush-required" set. So, you are reusing the existing ND_REGION_ASYNC flag for the hypercall based async flush with device tree

Re: [RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Pankaj Gupta
> >> Tha patch implements SCM async-flush hcall and sets the > >> ND_REGION_ASYNC capability when the platform device tree > >> has "ibm,async-flush-required" set. > > > > So, you are reusing the existing ND_REGION_ASYNC flag for the > > hypercall based async flush with device tree discovery? > > >

Re: [PATCH v2 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-12-01 Thread Masahiro Yamada
On Wed, Nov 25, 2020 at 7:22 AM Kees Cook wrote: > > On Thu, Nov 19, 2020 at 01:13:27PM -0800, Nick Desaulniers wrote: > > On Thu, Nov 19, 2020 at 12:57 PM Nathan Chancellor > > wrote: > > > > > > ld.lld 10.0.1 spews a bunch of various warnings about .rela sections, > > > along with a few others.

Re: [PATCH v2 1/2] kbuild: Hoist '--orphan-handling' into Kconfig

2020-12-01 Thread Masahiro Yamada
On Sat, Nov 21, 2020 at 9:08 AM Kees Cook wrote: > > On Thu, Nov 19, 2020 at 01:46:56PM -0700, Nathan Chancellor wrote: > > Currently, '--orphan-handling=warn' is spread out across four different > > architectures in their respective Makefiles, which makes it a little > > unruly to deal with in ca

Re: [RFC PATCH 01/14] ftrace: Fix updating FTRACE_FL_TRAMP

2020-12-01 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 26 Nov 2020 23:38:38 +0530 "Naveen N. Rao" wrote: On powerpc, kprobe-direct.tc triggered FTRACE_WARN_ON() in ftrace_get_addr_new() followed by the below message: Bad trampoline accounting at: 4222522f (wake_up_process+0xc/0x20) (f001) The set of st

Re: [PATCH v8 05/12] mm: HUGE_VMAP arch support cleanup

2020-12-01 Thread Catalin Marinas
On Sun, Nov 29, 2020 at 01:25:52AM +1000, Nicholas Piggin wrote: > This changes the awkward approach where architectures provide init > functions to determine which levels they can provide large mappings for, > to one where the arch is queried for each call. > > This removes code and indirection,

Re: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Catalin Marinas
On Mon, Nov 30, 2020 at 07:50:25PM +, ZHIZHIKIN Andrey wrote: > From Krzysztof Kozlowski : > > On Mon, Nov 30, 2020 at 03:21:33PM +, Andrey Zhizhikin wrote: > > > Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is > > > unused") removed geenric_bl driver from the tree,

[PATCH] powerpc/feature-fixups: use a semicolon rather than a comma

2020-12-01 Thread Daniel Axtens
In a bunch of our security flushes, we use a comma rather than a semicolon to 'terminate' an assignment. Nothing breaks, but checkpatch picks it up if you copy it into another flush. Switch to semicolons for ending statements. Cc: Nick Piggin Cc: Russell Currey Signed-off-by: Daniel Axtens ---

[PATCH] selftests/powerpc: update .gitignore

2020-12-01 Thread Daniel Axtens
I did an in-place build of the self-tests and found that it left the tree dirty. Add missed test binaries to .gitignore Signed-off-by: Daniel Axtens --- tools/testing/selftests/powerpc/nx-gzip/.gitignore | 3 +++ tools/testing/selftests/powerpc/security/.gitignore | 1 + tools/testing/selftest

Re: [PATCH v6 0/5] PCI: Unify ECAM constants in native PCI Express drivers

2020-12-01 Thread Lorenzo Pieralisi
On Sun, 29 Nov 2020 23:07:38 +, Krzysztof Wilczyński wrote: > Unify ECAM-related constants into a single set of standard constants > defining memory address shift values for the byte-level address that can > be used when accessing the PCI Express Configuration Space, and then > move native PCI

Re: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Alexandre Belloni
On 01/12/2020 14:40:53+, Catalin Marinas wrote: > On Mon, Nov 30, 2020 at 07:50:25PM +, ZHIZHIKIN Andrey wrote: > > From Krzysztof Kozlowski : > > > On Mon, Nov 30, 2020 at 03:21:33PM +, Andrey Zhizhikin wrote: > > > > Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as i

Re: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Arnd Bergmann
On Tue, Dec 1, 2020 at 4:41 PM Alexandre Belloni wrote: > On 01/12/2020 14:40:53+, Catalin Marinas wrote: > > On Mon, Nov 30, 2020 at 07:50:25PM +, ZHIZHIKIN Andrey wrote: > > > From Krzysztof Kozlowski : > > I tried to convince them before, it didn't work. I guess they don't like > > to

[PATCH net v3 2/2] ibmvnic: Fix TX completion error handling

2020-12-01 Thread Thomas Falcon
TX completions received with an error return code are not being processed properly. When an error code is seen, do not proceed to the next completion before cleaning up the existing entry's data structures. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Thomas Falco

[PATCH net v3 0/2] ibmvnic: Bug fixes for queue descriptor processing

2020-12-01 Thread Thomas Falcon
This series resolves a few issues in the ibmvnic driver's RX buffer and TX completion processing. The first patch includes memory barriers to synchronize queue descriptor reads. The second patch fixes a memory leak that could occur if the device returns a TX completion with an error code in the des

[PATCH net v3 1/2] ibmvnic: Ensure that SCRQ entry reads are correctly ordered

2020-12-01 Thread Thomas Falcon
Ensure that received Subordinate Command-Response Queue (SCRQ) entries are properly read in order by the driver. These queues are used in the ibmvnic device to process RX buffer and TX completion descriptors. dma_rmb barriers have been added after checking for a pending descriptor to ensure the cor

[PATCH v9 0/6] KASAN for powerpc64 radix

2020-12-01 Thread Daniel Axtens
Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. This is a significant reworking of the previous versions. Instead of the previous approach which supported inline instrumentation, this series provides only outline instrumen

[PATCH v9 1/6] kasan: allow an architecture to disable inline instrumentation

2020-12-01 Thread Daniel Axtens
For annoying architectural reasons, it's very difficult to support inline instrumentation on powerpc64. Add a Kconfig flag to allow an arch to disable inline. (It's a bit annoying to be 'backwards', but I'm not aware of any way to have an arch force a symbol to be 'n', rather than 'y'.) Signed-of

[PATCH v9 2/6] kasan: allow architectures to provide an outline readiness check

2020-12-01 Thread Daniel Axtens
Allow architectures to define a kasan_arch_is_ready() hook that bails out of any function that's about to touch the shadow unless the arch says that it is ready for the memory to be accessed. This is fairly uninvasive and should have a negligible performance penalty. This will only work in outline

[PATCH v9 3/6] kasan: define and use MAX_PTRS_PER_* for early shadow tables

2020-12-01 Thread Daniel Axtens
powerpc has a variable number of PTRS_PER_*, set at runtime based on the MMU that the kernel is booted under. This means the PTRS_PER_* are no longer constants, and therefore breaks the build. Define default MAX_PTRS_PER_*s in the same style as MAX_PTRS_PER_P4D. As KASAN is the only user at the m

[PATCH v9 4/6] kasan: Document support on 32-bit powerpc

2020-12-01 Thread Daniel Axtens
KASAN is supported on 32-bit powerpc and the docs should reflect this. Document s390 support while we're at it. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy Signed-off-by: Daniel Axtens --- Documentation/dev-tools/kasan.rst | 7 +-- Documentation/powerpc/kasan.txt | 12

[PATCH v9 5/6] powerpc/mm/kasan: rename kasan_init_32.c to init_32.c

2020-12-01 Thread Daniel Axtens
kasan is already implied by the directory name, we don't need to repeat it. Suggested-by: Christophe Leroy Signed-off-by: Daniel Axtens --- arch/powerpc/mm/kasan/Makefile | 2 +- arch/powerpc/mm/kasan/{kasan_init_32.c => init_32.c} | 0 2 files changed, 1 insertion(+), 1 d

[PATCH v9 6/6] powerpc: Book3S 64-bit outline-only KASAN support

2020-12-01 Thread Daniel Axtens
Implement a limited form of KASAN for Book3S 64-bit machines running under the Radix MMU, supporting only outline mode. - Enable the compiler instrumentation to check addresses and maintain the shadow region. (This is the guts of KASAN which we can easily reuse.) - Require kasan-vmalloc supp

Re: [PATCH v9 1/6] kasan: allow an architecture to disable inline instrumentation

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : For annoying architectural reasons, it's very difficult to support inline instrumentation on powerpc64. Add a Kconfig flag to allow an arch to disable inline. (It's a bit annoying to be 'backwards', but I'm not aware of any way to have an arch fo

Re: [PATCH v9 2/6] kasan: allow architectures to provide an outline readiness check

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : Allow architectures to define a kasan_arch_is_ready() hook that bails out of any function that's about to touch the shadow unless the arch says that it is ready for the memory to be accessed. This is fairly uninvasive and should have a negligible

Re: [PATCH v9 3/6] kasan: define and use MAX_PTRS_PER_* for early shadow tables

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : powerpc has a variable number of PTRS_PER_*, set at runtime based on the MMU that the kernel is booted under. This means the PTRS_PER_* are no longer constants, and therefore breaks the build. Define default MAX_PTRS_PER_*s in the same style as

Re: [PATCH v9 4/6] kasan: Document support on 32-bit powerpc

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : KASAN is supported on 32-bit powerpc and the docs should reflect this. Document s390 support while we're at it. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy My new address is Signed-off-by: Daniel Axtens --- Documentati

Re: [PATCH v9 5/6] powerpc/mm/kasan: rename kasan_init_32.c to init_32.c

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : kasan is already implied by the directory name, we don't need to repeat it. Suggested-by: Christophe Leroy My new address is Signed-off-by: Daniel Axtens --- arch/powerpc/mm/kasan/Makefile | 2 +- arch/powerpc/mm/

Re: [PATCH v9 6/6] powerpc: Book3S 64-bit outline-only KASAN support

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 17:16, Daniel Axtens a écrit : Implement a limited form of KASAN for Book3S 64-bit machines running under the Radix MMU, supporting only outline mode. - Enable the compiler instrumentation to check addresses and maintain the shadow region. (This is the guts of KASAN whic

Re: powerpc32: BUG: KASAN: use-after-free in test_bpf_init+0x6f8/0xde8 [test_bpf]

2020-12-01 Thread Christophe Leroy
Le 01/12/2020 à 15:03, Christophe Leroy a écrit : I've got the following KASAN error while running test_bpf module on a powerpc 8xx (32 bits). That's reproductible, happens each time at the same test. Can someone help me to investigate and fix that ? [  209.381037] test_bpf: #298 LD_IND by

Re: [PATCH net v3 0/2] ibmvnic: Bug fixes for queue descriptor processing

2020-12-01 Thread David Miller
From: Thomas Falcon Date: Tue, 1 Dec 2020 09:52:09 -0600 > This series resolves a few issues in the ibmvnic driver's > RX buffer and TX completion processing. The first patch > includes memory barriers to synchronize queue descriptor > reads. The second patch fixes a memory leak that could > occ

RE: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread ZHIZHIKIN Andrey
Hello Arnd, > -Original Message- > From: Arnd Bergmann > Sent: Tuesday, December 1, 2020 4:50 PM > To: Alexandre Belloni > Cc: Catalin Marinas ; ZHIZHIKIN Andrey > ; Krzysztof Kozlowski > ; li...@armlinux.org.uk; nicolas.fe...@microchip.com; > ludovic.desroc...@microchip.com; t...@atomid

Re: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Arnd Bergmann
On Tue, Dec 1, 2020 at 8:48 PM ZHIZHIKIN Andrey wrote: > Hello Arnd, > > > > Or rather, SoC-specific patches, even to defconfig, should go > > > > through the specific SoC maintainers. However, there are occasional > > > > defconfig patches which are more generic or affecting multiple SoCs. > > >

Re: [PATCH v2 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-12-01 Thread Kees Cook
On Tue, Dec 01, 2020 at 10:31:37PM +0900, Masahiro Yamada wrote: > On Wed, Nov 25, 2020 at 7:22 AM Kees Cook wrote: > > > > On Thu, Nov 19, 2020 at 01:13:27PM -0800, Nick Desaulniers wrote: > > > On Thu, Nov 19, 2020 at 12:57 PM Nathan Chancellor > > > wrote: > > > > > > > > ld.lld 10.0.1 spews a

Re: CONFIG_PPC_VAS depends on 64k pages...?

2020-12-01 Thread Bulent Abali
I don't know anything about VAS page size requirements in the kernel. I checked the user compression library and saw that we do a sysconf to get the page size; so the library should be immune to page size by design. But it wouldn't surprise me if a 64KB constant is inadvertently hardcoded somew

Re: CONFIG_PPC_VAS depends on 64k pages...?

2020-12-01 Thread Carlos Eduardo de Paula
On Tue, Dec 1, 2020 at 2:54 AM Sukadev Bhattiprolu wrote: > > Christophe Leroy [christophe.le...@csgroup.eu] wrote: > > Hi, > > > > Le 19/11/2020 à 11:58, Will Springer a écrit : > > > I learned about the POWER9 gzip accelerator a few months ago when the > > > support hit upstream Linux 5.8. Howe

Re: [PATCH 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Krzysztof Kozlowski
On Tue, Dec 01, 2020 at 04:50:22PM +0100, Arnd Bergmann wrote: > On Tue, Dec 1, 2020 at 4:41 PM Alexandre Belloni > wrote: > > On 01/12/2020 14:40:53+, Catalin Marinas wrote: > > > On Mon, Nov 30, 2020 at 07:50:25PM +, ZHIZHIKIN Andrey wrote: > > > > From Krzysztof Kozlowski : > > > > I t

Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-12-01 Thread Will Deacon
On Mon, Nov 30, 2020 at 10:31:51AM -0800, Andy Lutomirski wrote: > other arch folk: there's some background here: > > https://lkml.kernel.org/r/calcetrvxube8lfnn-qs+dzroqaiw+sfug1j047ybyv31sat...@mail.gmail.com > > On Sun, Nov 29, 2020 at 12:16 PM Andy Lutomirski wrote: > > > > On Sat, Nov 28, 2

Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-12-01 Thread Andy Lutomirski
On Tue, Dec 1, 2020 at 1:28 PM Will Deacon wrote: > > On Mon, Nov 30, 2020 at 10:31:51AM -0800, Andy Lutomirski wrote: > > other arch folk: there's some background here: > > > > https://lkml.kernel.org/r/calcetrvxube8lfnn-qs+dzroqaiw+sfug1j047ybyv31sat...@mail.gmail.com > > > > On Sun, Nov 29, 202

[PATCH v2 0/5] drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Since the removal of generic_bl driver from the source tree in commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") BACKLIGHT_GENERIC config option became obsolete as well and therefore subject to clean-up from all configuration files. This series introduces patches to

[PATCH v2 1/5] ARM: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") removed geenric_bl driver from the tree, together with corresponding config option. Remove BACKLIGHT_GENERIC config item from all ARM configurations. Fixes: 7ecdea4a0226 ("backlight: generic_bl: Remove this driver a

[PATCH v2 2/5] arm64: defconfig: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") removed geenric_bl driver from the tree, together with corresponding config option. Remove BACKLIGHT_GENERIC config item from arm64 configuration. Fixes: 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as i

[PATCH v2 3/5] MIPS: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") removed geenric_bl driver from the tree, together with corresponding config option. Remove BACKLIGHT_GENERIC config item from all MIPS configurations. Fixes: 7ecdea4a0226 ("backlight: generic_bl: Remove this driver

[PATCH v2 4/5] parisc: configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") removed geenric_bl driver from the tree, together with corresponding config option. Remove BACKLIGHT_GENERIC config item from generic-64bit_defconfig. Fixes: 7ecdea4a0226 ("backlight: generic_bl: Remove this driver

[PATCH v2 5/5] powerpc/configs: drop unused BACKLIGHT_GENERIC option

2020-12-01 Thread Andrey Zhizhikin
Commit 7ecdea4a0226 ("backlight: generic_bl: Remove this driver as it is unused") removed geenric_bl driver from the tree, together with corresponding config option. Remove BACKLIGHT_GENERIC config item from generic-64bit_defconfig. Fixes: 7ecdea4a0226 ("backlight: generic_bl: Remove this driver

Re: [PATCH kernel v2] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Alexey Kardashevskiy
On 01/12/2020 20:31, Cédric Le Goater wrote: On 12/1/20 8:39 AM, Alexey Kardashevskiy wrote: From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table

Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-12-01 Thread Will Deacon
On Tue, Dec 01, 2020 at 01:50:38PM -0800, Andy Lutomirski wrote: > On Tue, Dec 1, 2020 at 1:28 PM Will Deacon wrote: > > > > On Mon, Nov 30, 2020 at 10:31:51AM -0800, Andy Lutomirski wrote: > > > other arch folk: there's some background here: > > > > > > https://lkml.kernel.org/r/calcetrvxube8lfnn

[PATCH kernel v3] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Alexey Kardashevskiy
From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table entries related to the adapter. If some are still present, the RTAS call which isolates the PCI slo

[PATCH v2 06/17] ibmvfc: add handlers to drain and complete Sub-CRQ responses

2020-12-01 Thread Tyrel Datwyler
The logic for iterating over the Sub-CRQ responses is similiar to that of the primary CRQ. Add the necessary handlers for processing those responses. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 77 ++ 1 file changed, 77 insertions(+) diff -

[PATCH v2 04/17] ibmvfc: add alloc/dealloc routines for SCSI Sub-CRQ Channels

2020-12-01 Thread Tyrel Datwyler
Allocate a set of Sub-CRQs in advance. During channel setup the client and VIOS negotiate the number of queues the VIOS supports and the number that the client desires to request. Its possible that the final channel resources allocated is less than requested, but the client is still responsible for

[PATCH v2 00/17] ibmvfc: initial MQ development

2020-12-01 Thread Tyrel Datwyler
Recent updates in pHyp Firmware and VIOS releases provide new infrastructure towards enabling Subordinate Command Response Queues (Sub-CRQs) such that each Sub-CRQ is a channel backed by an actual hardware queue in the FC stack on the partner VIOS. Sub-CRQs are registered with the firmware via hype

[PATCH v2 12/17] ibmvfc: send commands down HW Sub-CRQ when channelized

2020-12-01 Thread Tyrel Datwyler
When the client has negotiated the use of channels all vfcFrames are required to go down a Sub-CRQ channel or it is a protocoal violation. If the adapter state is channelized submit vfcFrames to the appropriate Sub-CRQ via the h_send_sub_crq() helper. Signed-off-by: Tyrel Datwyler Reviewed-by: Br

[PATCH v2 09/17] ibmvfc: implement channel enquiry and setup commands

2020-12-01 Thread Tyrel Datwyler
New NPIV_ENQUIRY_CHANNEL and NPIV_SETUP_CHANNEL management datagrams (MADs) were defined in a previous patchset. If the client advertises a desire to use channels and the partner VIOS is channel capable then the client must proceed with channel enquiry to determine the maximum number of channels th

[PATCH v2 11/17] ibmvfc: set and track hw queue in ibmvfc_event struct

2020-12-01 Thread Tyrel Datwyler
Extract the hwq id from a SCSI command and store it in the ibmvfc_event structure to identify which Sub-CRQ to send the command down when channels are being utilized. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 5 + drivers/scsi/ibmvscsi/ibmvfc

[PATCH v2 07/17] ibmvfc: define Sub-CRQ interrupt handler routine

2020-12-01 Thread Tyrel Datwyler
Simple handler that calls Sub-CRQ drain routine directly. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index e9da3f60c793..

[PATCH v2 08/17] ibmvfc: map/request irq and register Sub-CRQ interrupt handler

2020-12-01 Thread Tyrel Datwyler
Create an irq mapping for the hw_irq number provided from phyp firmware. Request an irq assigned our Sub-CRQ interrupt handler. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/dr

[PATCH v2 16/17] ibmvfc: enable MQ and set reasonable defaults

2020-12-01 Thread Tyrel Datwyler
Turn on MQ by default and set sane values for the upper limit on hw queues for the scsi host, and number of hw scsi channels to request from the partner VIOS. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v2 13/17] ibmvfc: register Sub-CRQ handles with VIOS during channel setup

2020-12-01 Thread Tyrel Datwyler
If the ibmvfc client adapter requests channels it must submit a number of Sub-CRQ handles matching the number of channels being requested. The VIOS in its response will overwrite the actual number of channel resources allocated which may be less than what was requested. The client then must store t

[PATCH v2 17/17] ibmvfc: provide modules parameters for MQ settings

2020-12-01 Thread Tyrel Datwyler
Add the various module parameter toggles for adjusting the MQ characteristics at boot/load time as well as a device attribute for changing the client scsi channel request amount. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 75 +- 1 file chan

[PATCH v2 14/17] ibmvfc: add cancel mad initialization helper

2020-12-01 Thread Tyrel Datwyler
Add a helper routine for initializing a Cancel MAD. This will be useful for a channelized client that needs to send a Cancel commands down every channel commands were sent for a particular LUN. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 67

[PATCH v2 15/17] ibmvfc: send Cancel MAD down each hw scsi channel

2020-12-01 Thread Tyrel Datwyler
In general the client needs to send Cancel MADs and task management commands down the same channel as the command(s) intended to cancel or abort. The client assigns cancel keys per LUN and thus must send a Cancel down each channel commands were submitted for that LUN. Further, the client then must

[PATCH v2 02/17] ibmvfc: define hcall wrapper for registering a Sub-CRQ

2020-12-01 Thread Tyrel Datwyler
Sub-CRQs are registred with firmware via a hypercall. Abstract that interface into a simpler helper function. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc

[PATCH v2 01/17] ibmvfc: add vhost fields and defaults for MQ enablement

2020-12-01 Thread Tyrel Datwyler
Introduce several new vhost fields for managing MQ state of the adapter as well as initial defaults for MQ enablement. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 9 - drivers/scsi/ibmvscsi/ibmvfc.h | 13 +++-- 2 files changed, 19 insertions(+), 3 deletion

[PATCH v2 10/17] ibmvfc: advertise client support for using hardware channels

2020-12-01 Thread Tyrel Datwyler
Previous patches have plumbed the necessary Sub-CRQ interface and channel negotiation MADs to fully channelized hardware queues. Advertise client support via NPIV Login capability IBMVFC_CAN_USE_CHANNELS when the client bits have MQ enabled via vhost->mq_enabled, or when channels were already in u

[PATCH v2 05/17] ibmvfc: add Sub-CRQ IRQ enable/disable routine

2020-12-01 Thread Tyrel Datwyler
Each Sub-CRQ has its own interrupt. A hypercall is required to toggle the IRQ state. Provide the necessary mechanism via a helper function. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 20 1 file changed, 20 insertions(+) diff

Re: [net-next PATCH] net: freescale: ucc_geth: remove unused SKB_ALLOC_TIMEOUT

2020-12-01 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Mon, 30 Nov 2020 13:10:10 +1300 you wrote: > This was added in commit ce973b141dfa ("[PATCH] Freescale QE UCC gigabit > ethernet driver") but doesn't appear to have been used. Remove it now. > > Signed-off-by: Chris Pac

[PATCH v2 03/17] ibmvfc: add Subordinate CRQ definitions

2020-12-01 Thread Tyrel Datwyler
Subordinate Command Response Queues (Sub CRQ) are used in conjunction with the primary CRQ when more than one queue is needed by the virtual IO adapter. Recent phyp firmware versions support Sub CRQ's with ibmvfc adapters. This feature is a prerequisite for supporting multiple hardware backed submi

[PATCH kernel] powerpc/kuap: Restore AMR after replaying soft interrupts

2020-12-01 Thread Alexey Kardashevskiy
When interrupted in raw_copy_from_user()/... after user memory access is enabled, a nested handler may also access user memory (perf is one example) and when it does so, it calls prevent_read_from_user() which prevents the upper handler from accessing user memory. This saves/restores AMR when repl

Re: [PATCH v2 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-12-01 Thread Masahiro Yamada
On Wed, Dec 2, 2020 at 5:56 AM Kees Cook wrote: > > On Tue, Dec 01, 2020 at 10:31:37PM +0900, Masahiro Yamada wrote: > > On Wed, Nov 25, 2020 at 7:22 AM Kees Cook wrote: > > > > > > On Thu, Nov 19, 2020 at 01:13:27PM -0800, Nick Desaulniers wrote: > > > > On Thu, Nov 19, 2020 at 12:57 PM Nathan C

Re: [PATCH 5/8] lazy tlb: allow lazy tlb mm switching to be configurable

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 10:36 am: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> 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. I >> haven't flipped them over be

Re: [PATCH 2/8] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 3:55 am: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> And get rid of the generic sync_core_before_usermode facility. This is >> functionally a no-op in the core scheduler code, but it also catches >> >> This helper is t

Re: [PATCH 1/8] lazy tlb: introduce exit_lazy_tlb

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 10:38 am: > On Sat, Nov 28, 2020 at 8:01 AM Nicholas Piggin wrote: >> >> This is called at points where a lazy mm is switched away or made not >> lazy (by its owner switching back). >> >> Signed-off-by: Nicholas Piggin >> --- >> arch/a

Re: [PATCH kernel] powerpc/perf: Stop crashing with generic_compat_pmu

2020-12-01 Thread Alexey Kardashevskiy
Hi Maddy, I just noticed that I still have "powerpc/perf: Add checks for reserved values" in my pile (pushed here https://github.com/aik/linux/commit/61e1bc3f2e19d450e2e2d39174d422160b21957b ), do we still need it? The lockups I saw were fixed by https://github.com/aik/linux/commit/17899eaf88

Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 1:54 pm: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> On big systems, the mm refcount can become highly contented when doing >> a lot of context switching with threaded applications (particularly >> switching between th

Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 1, 2020 4:31 am: > other arch folk: there's some background here: > > https://lkml.kernel.org/r/calcetrvxube8lfnn-qs+dzroqaiw+sfug1j047ybyv31sat...@mail.gmail.com > > On Sun, Nov 29, 2020 at 12:16 PM Andy Lutomirski wrote: >> >> On Sat, Nov 28,

[PATCH v7 updated 21/22 ] powerpc/book3s64/kup: Check max key supported before enabling kup

2020-12-01 Thread Aneesh Kumar K.V
Don't enable KUEP/KUAP if we support less than or equal to 3 keys. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/kup.h | 3 +++ arch/powerpc/mm/book3s64/pkeys.c | 33 arch/powerpc/mm/init-common.c| 4 ++-- 3 files changed, 26 insertions(+),

[PATCH v2 0/4] Powerpc: Better preemption for shared processor

2020-12-01 Thread Srikar Dronamraju
Currently, vcpu_is_preempted will return the yield_count for shared_processor. On a PowerVM LPAR, Phyp schedules at SMT8 core boundary i.e all CPUs belonging to a core are either group scheduled in or group scheduled out. This can be used to better predict non-preempted CPUs on PowerVM shared LPARs

[PATCH v2 4/4] powerpc/paravirt: Use is_kvm_guest in vcpu_is_preempted

2020-12-01 Thread Srikar Dronamraju
If its a shared lpar but not a KVM guest, then see if the vCPU is related to the calling vCPU. On PowerVM, only cores can be preempted. So if one vCPU is a non-preempted state, we can decipher that all other vCPUs sharing the same core are in non-preempted state. Cc: linuxppc-dev Cc: LKML Cc: Mi

[PATCH v2 2/4] powerpc: Rename is_kvm_guest to check_kvm_guest

2020-12-01 Thread Srikar Dronamraju
is_kvm_guest() will be reused in subsequent patch in a new avatar. Hence rename is_kvm_guest to check_kvm_guest. No additional changes. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch Cc: Gautham R Shenoy Cc: Peter Zijlstra Cc: Valentin Schneider Cc: Ju

[PATCH v2 1/4] powerpc: Refactor is_kvm_guest declaration to new header

2020-12-01 Thread Srikar Dronamraju
Only code/declaration movement, in anticipation of doing a kvm-aware vcpu_is_preempted. No additional changes. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch Cc: Gautham R Shenoy Cc: Peter Zijlstra Cc: Valentin Schneider Cc: Juri Lelli Cc: Waiman Long

[PATCH v2 3/4] powerpc: Reintroduce is_kvm_guest in a new avatar

2020-12-01 Thread Srikar Dronamraju
Introduce a static branch that would be set during boot if the OS happens to be a KVM guest. Subsequent checks to see if we are on KVM will rely on this static branch. This static branch would be used in vcpu_is_preempted in a subsequent patch. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc:

[powerpc:fixes-test] BUILD SUCCESS f54db39fbe40731c40aefdd3bc26e7d56d668c64

2020-12-01 Thread kernel test robot
randconfig-a004-20201201 i386 randconfig-a005-20201201 i386 randconfig-a001-20201201 i386 randconfig-a002-20201201 i386 randconfig-a006-20201201 i386 randconfig-a003-20201201 x86_64

[powerpc:next-test] BUILD SUCCESS 72e886545963b33dd5e1d92ee9c77dadb51adc4e

2020-12-01 Thread kernel test robot
powerpc allmodconfig powerpc allnoconfig i386 randconfig-a004-20201201 i386 randconfig-a005-20201201 i386 randconfig-a001-20201201 i386 randconfig-a002-20201201 i386

Re: [RFC PATCH] powerpc: show registers when unwinding interrupt frames

2020-12-01 Thread Michael Ellerman
Christophe Leroy writes: > Le 07/11/2020 à 03:33, Nicholas Piggin a écrit : >> It's often useful to know the register state for interrupts in >> the stack frame. In the below example (with this patch applied), >> the important information is the state of the page fault. >> >> A blatant case like