Re: Re: [PATCH 5/5] powerpc/8xx: fix possible object reference leak

2019-03-22 Thread wen.yang99
Hi, Christophe, >> The call to of_find_compatible_node returns a node pointer with refcount >> incremented thus it must be explicitly decremented after the last >> usage. >> irq_domain_add_linear also calls of_node_get to increase refcount, >> so irq_domain will not be affected when it is

[PATCH 2/2] pci: rpaphp: get/put device node reference during slot alloc/dealloc

2019-03-22 Thread Tyrel Datwyler
When allocating the slot structure we store a pointer to the associated device_node. We really should be incrementing the reference count, so add an of_node_get() during slot alloc and an of_node_put() during slot dealloc. Signed-off-by: Tyrel Datwyler --- drivers/pci/hotplug/rpaphp_slot.c | 3

[PATCH 1/2] pci: rpadlpar: fix leaked device_node references in add/remove paths

2019-03-22 Thread Tyrel Datwyler
The find_dlpar_node() helper returns a device node with its reference incremented. Both the add and remove paths use this helper for find the appropriate node, but fail to release the reference when done. Annotate the find_dlpar_node() helper with a comment about the incremented reference count,

Re: [PATCH kernel RFC 2/2] vfio-pci-nvlink2: Implement interconnect isolation

2019-03-22 Thread Alex Williamson
On Fri, 22 Mar 2019 14:08:38 +1100 David Gibson wrote: > On Thu, Mar 21, 2019 at 12:19:34PM -0600, Alex Williamson wrote: > > On Thu, 21 Mar 2019 10:56:00 +1100 > > David Gibson wrote: > > > > > On Wed, Mar 20, 2019 at 01:09:08PM -0600, Alex Williamson wrote: > > > > On Wed, 20 Mar 2019

Re: [RESEND 6/7] IB/qib: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against > FS DAX pages being mapped. > > Signed-off-by: Ira Weiny Looks good modulo potential __get_user_pages_fast() suggestion.

Re: [RESEND 5/7] IB/hfi1: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against > FS DAX pages being mapped. > > Signed-off-by: Ira Weiny > --- > drivers/infiniband/hw/hfi1/user_pages.c | 6 -- > 1 file changed, 4 insertions(+), 2

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > DAX pages were previously unprotected from longterm pins when users > called get_user_pages_fast(). > > Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall > back to regular GUP processing if a DEVMAP page is

Re: [RESEND 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > To facilitate additional options to get_user_pages_fast() change the > singular write parameter to be gup_flags. > > This patch does not change any functionality. New functionality will > follow in subsequent patches. > > Some of

Re: [RESEND 2/7] mm/gup: Change write parameter to flags in fast walk

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > In order to support more options in the GUP fast walk, change > the write parameter to flags throughout the call stack. > > This patch does not change functionality and passes FOLL_WRITE > where write was previously used. > >

Re: [RESEND 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Rather than have a separate get_user_pages_longterm() call, > introduce FOLL_LONGTERM and change the longterm callers to use > it. > > This patch does not change any functionality. > > FOLL_LONGTERM can only be supported with

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.1-3 tag

2019-03-22 Thread pr-tracker-bot
The pull request you sent on Fri, 22 Mar 2019 23:58:08 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.1-3 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/a5ed1e96cafde5ba48638f486bfca0685dc6ddc9 Thank you! --

Re: [PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files

2019-03-22 Thread Waiman Long
On 03/22/2019 03:30 PM, Davidlohr Bueso wrote: > On Fri, 22 Mar 2019, Linus Torvalds wrote: >> Some of them _might_ be performance-critical. There's the one on >> mmap_sem in the fault handling path, for example. And yes, I'd expect >> the normal case to very much be "no other readers or writers"

Re: [PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files

2019-03-22 Thread Davidlohr Bueso
On Fri, 22 Mar 2019, Linus Torvalds wrote: Some of them _might_ be performance-critical. There's the one on mmap_sem in the fault handling path, for example. And yes, I'd expect the normal case to very much be "no other readers or writers" for that one. Yeah, the mmap_sem case in the fault

Re: powerpc32 boot crash in 5.1-rc1

2019-03-22 Thread LEROY Christophe
Meelis Roos a écrit : While 5.0.0 worked fine on my PowerMac G4, 5.0 + git (unknown rev as of Mar 13), 5.0.0-11520-gf261c4e and todays git all fail to boot. The problem seems to be in page fault handler in load_elf_binary() of init process. The patch at

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-22 Thread Segher Boessenkool
On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: > .Lcmp_rest_lt8bytes: > - /* Here we have only less than 8 bytes to compare with. at least s1 > - * Address is aligned with 8 bytes. > - * The next double words are load and shift right with appropriate > - *

Re: [PATCH v5 3/3] locking/rwsem: Optimize down_read_trylock()

2019-03-22 Thread Waiman Long
On 03/22/2019 01:25 PM, Russell King - ARM Linux admin wrote: > On Fri, Mar 22, 2019 at 10:30:08AM -0400, Waiman Long wrote: >> Modify __down_read_trylock() to optimize for an unlocked rwsem and make >> it generate slightly better code. >> >> Before this patch, down_read_trylock: >> >>

Re: [PATCH v2 3/7] ocxl: Create a clear delineation between ocxl backend & frontend

2019-03-22 Thread Frederic Barrat
Hi Alastair, I'm still seeing problems with the handling of the info structure and ref counting on the AFU. To make things easier, I'm attaching a patch. There's also a bunch of other review comments in the patch, check for the comments with the "fxb" marker. I've played a bit with driver

Re: [PATCH v5 3/3] locking/rwsem: Optimize down_read_trylock()

2019-03-22 Thread Russell King - ARM Linux admin
On Fri, Mar 22, 2019 at 10:30:08AM -0400, Waiman Long wrote: > Modify __down_read_trylock() to optimize for an unlocked rwsem and make > it generate slightly better code. > > Before this patch, down_read_trylock: > >0x <+0>: callq 0x5 >0x0005 <+5>:

Re: [PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files

2019-03-22 Thread Waiman Long
On 03/22/2019 01:01 PM, Linus Torvalds wrote: > On Fri, Mar 22, 2019 at 7:30 AM Waiman Long wrote: >> 19 files changed, 133 insertions(+), 930 deletions(-) > Lovely. And it all looks sane to me. > > So ack. > > The only comment I have is about __down_read_trylock(), which probably > isn't

Re: [PATCH v5 3/3] locking/rwsem: Optimize down_read_trylock()

2019-03-22 Thread Linus Torvalds
On Fri, Mar 22, 2019 at 7:30 AM Waiman Long wrote: > > Modify __down_read_trylock() to optimize for an unlocked rwsem and make > it generate slightly better code. Oh, that should teach me to read all patches in the series before starting to comment on them. So ignore my comment on #1.

Re: [PATCH v5 2/3] locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs

2019-03-22 Thread Linus Torvalds
On Fri, Mar 22, 2019 at 7:30 AM Waiman Long wrote: > > For simplication, we are going to remove rwsem-spinlock.c and make all > architectures use a single implementation of rwsem - rwsem-xadd.c. Ack. Linus

Re: [PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files

2019-03-22 Thread Linus Torvalds
On Fri, Mar 22, 2019 at 7:30 AM Waiman Long wrote: > > 19 files changed, 133 insertions(+), 930 deletions(-) Lovely. And it all looks sane to me. So ack. The only comment I have is about __down_read_trylock(), which probably isn't critical enough to actually care about, but: > +static inline

[PATCH v5 3/3] locking/rwsem: Optimize down_read_trylock()

2019-03-22 Thread Waiman Long
Modify __down_read_trylock() to optimize for an unlocked rwsem and make it generate slightly better code. Before this patch, down_read_trylock: 0x <+0>: callq 0x5 0x0005 <+5>: jmp0x18 0x0007 <+7>: lea0x1(%rdx),%rcx

[PATCH v5 2/3] locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs

2019-03-22 Thread Waiman Long
Currently, we have two different implementation of rwsem: 1) CONFIG_RWSEM_GENERIC_SPINLOCK (rwsem-spinlock.c) 2) CONFIG_RWSEM_XCHGADD_ALGORITHM (rwsem-xadd.c) As we are going to use a single generic implementation for rwsem-xadd.c and no architecture-specific code will be needed, there is no

[PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files

2019-03-22 Thread Waiman Long
As the generic rwsem-xadd code is using the appropriate acquire and release versions of the atomic operations, the arch specific rwsem.h files will not be that much faster than the generic code as long as the atomic functions are properly implemented. So we can remove those arch specific rwsem.h

[PATCH v5 0/3] locking/rwsem: Rwsem rearchitecture part 0

2019-03-22 Thread Waiman Long
v5: - Rebase to the latest v5.1 tree and fix conflicts in arch/{xtensa,s390}/include/asm/Kbuild. v4: - Remove rwsem-spinlock.c and make all archs use rwsem-xadd.c. v3: - Optimize __down_read_trylock() for the uncontended case as suggested by Linus. v2: - Add patch 2 to optimize

Re: powerpc32 boot crash in 5.1-rc1

2019-03-22 Thread Meelis Roos
While 5.0.0 worked fine on my PowerMac G4, 5.0 + git (unknown rev as of Mar 13), 5.0.0-11520-gf261c4e and todays git all fail to boot. The problem seems to be in page fault handler in load_elf_binary() of init process. The patch at https://patchwork.ozlabs.org/patch/1053385/ should fix it

[RFC PATCH v1 3/3] kasan: add interceptors for all string functions

2019-03-22 Thread Christophe Leroy
In the same spirit as commit 393f203f5fd5 ("x86_64: kasan: add interceptors for memset/memmove/memcpy functions"), this patch adds interceptors for string manipulation functions so that we can compile lib/string.o without kasan support hence allow the string functions to also be used from places

[RFC PATCH v1 1/3] kasan: move memset/memmove/memcpy interceptors in a dedicated file

2019-03-22 Thread Christophe Leroy
In preparation of the addition of interceptors for other string functions, this patch moves memset/memmove/memcpy interceptions in string.c Signed-off-by: Christophe Leroy --- mm/kasan/Makefile | 5 - mm/kasan/common.c | 26 -- mm/kasan/string.c | 35

[RFC PATCH v1 2/3] lib/string: move sysfs string functions out of string.c

2019-03-22 Thread Christophe Leroy
In order to implement interceptors for string functions, move higher level sysfs related string functions out of string.c This patch creates a new file named string_sysfs.c Signed-off-by: Christophe Leroy --- lib/Makefile | 3 ++- lib/string.c | 79

Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode

2019-03-22 Thread Herbert Xu
On Fri, Mar 15, 2019 at 01:09:01PM +1100, Daniel Axtens wrote: > The original assembly imported from OpenSSL has two copy-paste > errors in handling CTR mode. When dealing with a 2 or 3 block tail, > the code branches to the CBC decryption exit path, rather than to > the CTR exit path. > > This

Re: [PATCH 1/2] cpuidle : auto-promotion for cpuidle states

2019-03-22 Thread Daniel Lezcano
On 22/03/2019 10:45, Rafael J. Wysocki wrote: > On Fri, Mar 22, 2019 at 8:31 AM Abhishek Goel > wrote: >> >> Currently, the cpuidle governors (menu /ladder) determine what idle state >> an idling CPU should enter into based on heuristics that depend on the >> idle history on that CPU. Given that

[GIT PULL] Please pull powerpc/linux.git powerpc-5.1-3 tag

2019-03-22 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Linus, Please pull some powerpc fixes for 5.1: The following changes since commit 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b: Linux 5.1-rc1 (2019-03-17 14:22:26 -0700) are available in the git repository at:

[PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-22 Thread Michael Ellerman
Chandan reported that fstests' generic/026 test hit a crash: BUG: Unable to handle kernel data access at 0xc0062ac4 Faulting instruction address: 0xc0092240 Oops: Kernel access of bad area, sig: 11 [#1] LE SMP NR_CPUS=2048 DEBUG_PAGEALLOC NUMA pSeries CPU: 0 PID: 27828

Re: powerpc/security: Fix spectre_v2 reporting

2019-03-22 Thread Michael Ellerman
On Thu, 2019-03-21 at 04:24:33 UTC, Michael Ellerman wrote: > When I updated the spectre_v2 reporting to handle software count cache > flush I got the logic wrong when there's no software count cache > enabled at all. > > The result is that on systems with the software count cache flush >

Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-03-22 Thread Michael Ellerman
On Sun, 2019-03-17 at 01:17:56 UTC, Ben Hutchings wrote: > MAX_PHYSMEM_BITS only needs to be defined if CONFIG_SPARSEMEM is > enabled, and that was the case before commit 4ffe713b7587 > ("powerpc/mm: Increase the max addressable memory to 2PB"). > > On 32-bit systems, where CONFIG_SPARSEMEM is

Re: [PATCH 1/2] cpuidle : auto-promotion for cpuidle states

2019-03-22 Thread Rafael J. Wysocki
On Fri, Mar 22, 2019 at 8:31 AM Abhishek Goel wrote: > > Currently, the cpuidle governors (menu /ladder) determine what idle state > an idling CPU should enter into based on heuristics that depend on the > idle history on that CPU. Given that no predictive heuristic is perfect, > there are cases

[RFC PATCH 3/3] powenv/mce: print additional information about mce error.

2019-03-22 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Print more information about mce error whether it is an hardware or software error. Some of the mce errors can be easily categorized as hardware or software errors e.g. UEs are due to hardware error, where as error triggered due to invalid usage of tlbie is a pure

[RFC PATCH 2/3] powernv/mce: Print correct severity for mce error.

2019-03-22 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Currently all machine check errors are printed as severe errors which isn't correct. Print soft errors as warning instead of severe errors. Signed-off-by: Mahesh Salgaonkar --- arch/powerpc/include/asm/mce.h| 26 +++--- arch/powerpc/kernel/mce.c |

[RFC PATCH 1/3] powernv/mce: reduce mce console logs to lesser lines.

2019-03-22 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Also add cpu number while displaying mce log. This will help cleaner logs when mce hits on multiple cpus simultaneously. Signed-off-by: Mahesh Salgaonkar --- arch/powerpc/include/asm/mce.h |2 - arch/powerpc/kernel/mce.c | 86

[PATCH 7/7] powerpc/setup: replace ifdefs by IS_ENABLED() wherever possible.

2019-03-22 Thread Christophe Leroy
Compared to ifdefs, IS_ENABLED() provide a cleaner code and allows to detect compilation failure regardless of the selected options. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 39 ++ 1 file changed, 18 insertions(+), 21

[PATCH 6/7] powerpc/setup: cleanup the #ifdef CONFIG_TAU block

2019-03-22 Thread Christophe Leroy
Use cpu_has_feature() instead of opencoding Use IS_ENABLED() instead of #ifdef for CONFIG_TAU_AVERAGE Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH 5/7] powerpc/setup: cleanup ifdef mess in check_cache_coherency()

2019-03-22 Thread Christophe Leroy
Use IS_ENABLED() instead of #ifdefs Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index fa90585760c0..95d545e94c28

[PATCH 4/7] powerpc/setup: Remove unnecessary #ifdef CONFIG_ALTIVEC

2019-03-22 Thread Christophe Leroy
CPU_FTR_ALTIVEC is only set when CONFIG_ALTIVEC is selected, so the ifdef is unnecessary. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index

[PATCH 1/7] powerpc/fadump: define an empty fadump_cleanup()

2019-03-22 Thread Christophe Leroy
To avoid #ifdefs, define an static inline fadump_cleanup() function when CONFIG_FADUMP is not selected Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/fadump.h | 1 + arch/powerpc/kernel/setup-common.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 3/7] powerpc/setup: define cpu_pvr at all time

2019-03-22 Thread Christophe Leroy
To avoid ifdefs, define cpu_pvr at all time. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index

[PATCH 2/7] powerpc/mm: define an empty mm_iommu_init()

2019-03-22 Thread Christophe Leroy
To avoid ifdefs, define a empty static inline mm_iommu_init() function when CONFIG_SPAPR_TCE_IOMMU is not selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu_context.h | 1 + arch/powerpc/kernel/setup-common.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)

Re: [PATCH 13/38] vfs: Convert cxl to fs_context

2019-03-22 Thread Frederic Barrat
Le 14/03/2019 à 17:10, David Howells a écrit : Signed-off-by: David Howells cc: Frederic Barrat cc: Andrew Donnellan cc: linuxppc-dev@lists.ozlabs.org --- Acked-by: Frederic Barrat drivers/misc/cxl/api.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

Re: [PATCH 0/2] Auto-promotion logic for cpuidle states

2019-03-22 Thread Abhishek
Please ignore this set as this is incomplete. I have resent the patches. --Abhishek On 03/22/2019 11:55 AM, Abhishek Goel wrote: Currently, the cpuidle governors (menu/ladder) determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that

[PATCH 2/2] cpuidle : Add auto-promotion flag to cpuidle flags

2019-03-22 Thread Abhishek Goel
This patch sets up flags for the state which needs to be auto-promoted. For powernv systems, lite states do not even lose user context. That information has been used to set the flag for lite states. Signed-off-by: Abhishek Goel --- arch/powerpc/include/asm/opal-api.h | 1 +

[PATCH 1/2] cpuidle : auto-promotion for cpuidle states

2019-03-22 Thread Abhishek Goel
Currently, the cpuidle governors (menu /ladder) determine what idle state an idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that

[PATCH 0/2] Auto-promotion logic for cpuidle states

2019-03-22 Thread Abhishek Goel
Currently, the cpuidle governors (menu/ladder) determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that the

Re: [PATCH 5/5] powerpc/8xx: fix possible object reference leak

2019-03-22 Thread Christophe Leroy
On 03/22/2019 03:05 AM, Wen Yang wrote: The call to of_find_compatible_node returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. irq_domain_add_linear also calls of_node_get to increase refcount, so irq_domain will not be affected when

[PATCH 0/2] Auto-promotion logic for cpuidle states

2019-03-22 Thread Abhishek Goel
Currently, the cpuidle governors (menu/ladder) determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that the

[PATCH 2/2] cpuidle : Add auto-promotion flag to cpuidle flags

2019-03-22 Thread Abhishek Goel
This patch sets up flags for the state which needs to be auto-promoted. For powernv systems, lite states do not even lose user context. That information has been used to set the flag for lite states. Signed-off-by: Abhishek Goel --- arch/powerpc/include/asm/opal-api.h | 1 +

[PATCH 1/2] cpuidle : auto-promotion for cpuidle states

2019-03-22 Thread Abhishek Goel
Currently, the cpuidle governors (menu /ladder) determine what idle state an idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that