Re: [PATCH] mm: check for memory's node later during boot

2020-09-07 Thread Laurent Dufour
Le 03/09/2020 à 23:35, Andrew Morton a écrit : On Wed, 2 Sep 2020 11:09:11 +0200 Laurent Dufour wrote: register_mem_sect_under_nodem() is checking the memory block's node id only if the system state is "SYSTEM_BOOTING". On PowerPC, the memory blocks are registered while the system state is "S

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-07 Thread Michael Ellerman
Alexey Kardashevskiy writes: > There are 2 problems with it: > 1. "<" vs expected "<<" > 2. the shift number is an IOMMU page number mask, not an address mask > as the IOMMU page shift is missing. > > This did not hit us before f1565c24b596 ("powerpc: use the generic > dma_ops_bypass mode") becaus

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-07 Thread Christoph Hellwig
On Tue, Sep 08, 2020 at 11:51:06AM +1000, Alexey Kardashevskiy wrote: > What is dma_get_required_mask() for anyway? What "requires" what here? Yes, it is a really odd API. It comes from classic old PCI where 64-bit addressing required an additional bus cycle, and various devices had different add

Re: [RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 22:12, Mike Rapoport a écrit : On Mon, Sep 07, 2020 at 08:00:55PM +0200, Gerald Schaefer wrote: This is v2 of an RFC previously discussed here: https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ Patch 1 is a fix for a regression in gup_fast on s

Re: [RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Since pXd_addr_end() macros take pXd page-table entry as a parameter it makes sense to check the entry type on compile. Even though most archs do not make use of page-table entries in pXd_addr_end() calls, checking the

Re: [RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Unlike all other page-table abstractions pXd_addr_end() do not take into account a particular table entry in which context the functions are called. On architectures with dynamic page-tables folding that might lead to l

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Commit 1a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code") introduced a subtle but severe bug on s390 with gup_fast, due to dynamic page table folding. The question "What would it require for the

Re: [RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : This is v2 of an RFC previously discussed here: https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ Patch 1 is a fix for a regression in gup_fast on s390, after our conversion to common gup_fast code. It will intro

[PATCH v2] kbuild: preprocess module linker script

2020-09-07 Thread Masahiro Yamada
There was a request to preprocess the module linker script like we do for the vmlinux one. (https://lkml.org/lkml/2020/8/21/512) The difference between vmlinux.lds and module.lds is that the latter is needed for external module builds, thus must be cleaned up by 'make mrproper' instead of 'make cl

Re: [PATCH v1 02/10] powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE on iommu_*_coherent()

2020-09-07 Thread Alexey Kardashevskiy
On 04/09/2020 16:04, Leonardo Bras wrote: On Thu, 2020-09-03 at 14:41 +1000, Alexey Kardashevskiy wrote: I am new to this, so I am trying to understand how a memory page mapped as DMA, and used for something else could be a problem. From the device prospective, there is PCI space and eve

[PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-07 Thread Alexey Kardashevskiy
There are 2 problems with it: 1. "<" vs expected "<<" 2. the shift number is an IOMMU page number mask, not an address mask as the IOMMU page shift is missing. This did not hit us before f1565c24b596 ("powerpc: use the generic dma_ops_bypass mode") because we had there additional code to handle by

Re: [PATCH AUTOSEL 5.8 14/53] ibmvnic fix NULL tx_pools and rx_tools issue at do_reset

2020-09-07 Thread Sasha Levin
On Mon, Sep 07, 2020 at 02:10:26PM -0700, Jakub Kicinski wrote: On Mon, 7 Sep 2020 12:31:40 -0400 Sasha Levin wrote: [ Upstream commit 9f13457377907fa253aef560e1a37e1ca4197f9b ] @@ -2024,10 +2033,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, } else {

Re: [PATCH AUTOSEL 5.8 14/53] ibmvnic fix NULL tx_pools and rx_tools issue at do_reset

2020-09-07 Thread Jakub Kicinski
On Mon, 7 Sep 2020 12:31:40 -0400 Sasha Levin wrote: > [ Upstream commit 9f13457377907fa253aef560e1a37e1ca4197f9b ] > @@ -2024,10 +2033,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, > } else { > rc = reset_tx_pools(adapter); >

Re: [RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions

2020-09-07 Thread Mike Rapoport
Hi, Some style comments below. On Mon, Sep 07, 2020 at 08:00:58PM +0200, Gerald Schaefer wrote: > From: Alexander Gordeev > > Since pXd_addr_end() macros take pXd page-table entry as a > parameter it makes sense to check the entry type on compile. > Even though most archs do not make use of pag

Re: [RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Mike Rapoport
On Mon, Sep 07, 2020 at 08:00:55PM +0200, Gerald Schaefer wrote: > This is v2 of an RFC previously discussed here: > https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ > > Patch 1 is a fix for a regression in gup_fast on s390, after our conversion > to common gup_fas

[RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Gerald Schaefer
This is v2 of an RFC previously discussed here: https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ Patch 1 is a fix for a regression in gup_fast on s390, after our conversion to common gup_fast code. It will introduce special helper functions pXd_addr_end_folded(), w

[RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware

2020-09-07 Thread Gerald Schaefer
From: Alexander Gordeev Unlike all other page-table abstractions pXd_addr_end() do not take into account a particular table entry in which context the functions are called. On architectures with dynamic page-tables folding that might lead to lack of necessary information that is difficult to obta

[RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Gerald Schaefer
From: Alexander Gordeev Commit 1a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code") introduced a subtle but severe bug on s390 with gup_fast, due to dynamic page table folding. The question "What would it require for the generic code to work for s390" has already been discus

[RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions

2020-09-07 Thread Gerald Schaefer
From: Alexander Gordeev Since pXd_addr_end() macros take pXd page-table entry as a parameter it makes sense to check the entry type on compile. Even though most archs do not make use of page-table entries in pXd_addr_end() calls, checking the type in traversal code paths could help to avoid subtl

[PATCH AUTOSEL 5.4 11/43] ibmvnic fix NULL tx_pools and rx_tools issue at do_reset

2020-09-07 Thread Sasha Levin
From: Mingming Cao [ Upstream commit 9f13457377907fa253aef560e1a37e1ca4197f9b ] At the time of do_rest, ibmvnic tries to re-initalize the tx_pools and rx_pools to avoid re-allocating the long term buffer. However there is a window inside do_reset that the tx_pools and rx_pools were freed before

[PATCH AUTOSEL 5.8 14/53] ibmvnic fix NULL tx_pools and rx_tools issue at do_reset

2020-09-07 Thread Sasha Levin
From: Mingming Cao [ Upstream commit 9f13457377907fa253aef560e1a37e1ca4197f9b ] At the time of do_rest, ibmvnic tries to re-initalize the tx_pools and rx_pools to avoid re-allocating the long term buffer. However there is a window inside do_reset that the tx_pools and rx_pools were freed before

Re: fsl_espi errors on v5.7.15

2020-09-07 Thread Joakim Tjernlund
[SNIP] > > > > > Would you be able to ftrace the interrupt handler function and see if you > > > can see a difference in number or timing of interrupts? I'm at a bit of > > > a loss. > > > > I tried ftrace but I really wasn't sure what I was looking for. > > Capturing a "bad" case was pretty tri

[PATCH 2/2] powerpc/32: Fix vmap stack - Properly set r1 before activating MMU

2020-09-07 Thread Christophe Leroy
We need r1 to be properly set before activating MMU, otherwise any new exception taken while saving registers into the stack in exception prologs will use the user stack, which is wrong and will even lockup or crash when KUAP is selected. Do that by switching the meaning of r11 and r1 until we hav

[PATCH 1/2] powerpc/32: Fix vmap stack - Do not activate MMU before reading task struct

2020-09-07 Thread Christophe Leroy
We need r1 to be properly set before activating MMU, so reading task_struct->stack must be done with MMU off. This means we need an additional register to play with MSR bits while r11 now points to the stack. For that, move r10 back to CR (As is already done for hash MMU) and use r10. We still do

Re: [PATCH] kbuild: preprocess module linker script

2020-09-07 Thread Will Deacon
On Fri, Sep 04, 2020 at 10:31:21PM +0900, Masahiro Yamada wrote: > There was a request to preprocess the module linker script like we do > for the vmlinux one (https://lkml.org/lkml/2020/8/21/512). > > The difference between vmlinux.lds and module.lds is that the latter > is needed for external mo

Re: KVM on POWER8 host lock up since 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C")

2020-09-07 Thread Michal Suchánek
On Mon, Sep 07, 2020 at 11:13:47PM +1000, Nicholas Piggin wrote: > Excerpts from Michael Ellerman's message of August 31, 2020 8:50 pm: > > Michal Suchánek writes: > >> On Mon, Aug 31, 2020 at 11:14:18AM +1000, Nicholas Piggin wrote: > >>> Excerpts from Michal Suchánek's message of August 31, 2020

Re: KVM on POWER8 host lock up since 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C")

2020-09-07 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of August 31, 2020 8:50 pm: > Michal Suchánek writes: >> On Mon, Aug 31, 2020 at 11:14:18AM +1000, Nicholas Piggin wrote: >>> Excerpts from Michal Suchánek's message of August 31, 2020 6:11 am: >>> > Hello, >>> > >>> > on POWER8 KVM hosts lock up since com

Re: [RFC PATCH 12/12] powerpc/64s: power4 nap fixup in C

2020-09-07 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of September 7, 2020 2:48 pm: > > > Le 07/09/2020 à 06:02, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of September 6, 2020 5:32 pm: >>> >>> >>> Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : There is no need for this to be

Re: [PATCH] arch: vdso: add vdso linker script to 'targets' instead of extra-y

2020-09-07 Thread Masahiro Yamada
On Tue, Sep 1, 2020 at 3:23 AM Masahiro Yamada wrote: > > The vdso linker script is preprocessed on demand. > Adding it to 'targets' is enough to include the .cmd file. > > Signed-off-by: Masahiro Yamada > --- Applied to linux-kbuild. > arch/arm64/kernel/vdso/Makefile | 2 +- > arch/arm6

[PATCH] scsi: ibmvfc: Fix error return in ibmvfc_probe()

2020-09-07 Thread Jing Xiangfeng
Fix to return error code PTR_ERR() from the error handling case instead of 0. Signed-off-by: Jing Xiangfeng --- drivers/scsi/ibmvscsi/ibmvfc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index ea7c8930592d..70daa0605082 1006

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-07 Thread Christophe Leroy
On Mon, 2020-09-07 at 11:20 +0200, Christophe Leroy wrote: > > Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : > > Make interrupt handlers all just take the pt_regs * argument and load > > DAR/DSISR etc from that. Make those that return a value return long. > > I like this, it will likely simpli

[PATCH v2] powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute

2020-09-07 Thread Vaibhav Jain
The newly introduced 'perf_stats' attribute uses the default access mode of 0444 letting non-root users access performance stats of an nvdimm and potentially force the kernel into issuing large number of expensive HCALLs. Since the information exposed by this attribute cannot be cached hence its be

Re: fsl_espi errors on v5.7.15

2020-09-07 Thread Joakim Tjernlund
On Thu, 2020-09-03 at 23:58 +, Chris Packham wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > > > On 1/09/20 6:14 pm, Nicholas Piggin wrote: > > Excerpts from

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-07 Thread Christophe Leroy
Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : Make interrupt handlers all just take the pt_regs * argument and load DAR/DSISR etc from that. Make those that return a value return long. I like this, it will likely simplify a bit the VMAP_STACK mess. Not sure it is that easy. My board is s

Re: [RFC PATCH 09/12] powerpc: move NMI entry/exit code into wrapper

2020-09-07 Thread Christophe Leroy
On 9/5/20 5:43 PM, Nicholas Piggin wrote: This moves the common NMI entry and exit code into the interrupt handler wrappers. This changes the behaviour of soft-NMI (watchdog) and HMI interrupts, and also MCE interrupts on 64e, by adding missing parts of the NMI entry to them. Signed-off-by:

Re: [PATCH -next] powerpc/book3s64: fix link error with CONFIG_PPC_RADIX_MMU=n

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 03:51, Yang Yingliang a écrit : On 2020/9/6 14:50, Christophe Leroy wrote: Le 05/09/2020 à 13:25, Yang Yingliang a écrit : Fix link error when CONFIG_PPC_RADIX_MMU is disabled: powerpc64-linux-gnu-ld: arch/powerpc/platforms/pseries/lpar.o:(.toc+0x0): undefined reference

[PATCH] powerepc/book3s64/hash: Align start/end address correctly with bolt mapping

2020-09-07 Thread Aneesh Kumar K.V
This ensures we don't do a partial mapping of memory. With nvdimm, when creating namespaces with size not aligned to 16MB, the kernel ends up partially mapping the pages. This can result in kernel adding multiple hash page table entries for the same range. A new namespace will result in create_sect