Re: [PATCH 1/4] hugetlbfs: add arch_hugetlb_valid_size

2020-03-19 Thread Christophe Leroy
Le 18/03/2020 à 23:06, Mike Kravetz a écrit : The architecture independent routine hugetlb_default_setup sets up the default huge pages size. It has no way to verify if the passed value is valid, so it accepts it and attempts to validate at a later time. This requires undocumented cooperatio

[PATCH] Fix "[v3, 28/32] powerpc/64s: interrupt implement exit logic in C"

2020-03-19 Thread Nicholas Piggin
Accessing thread_info flags can cause an SLB fault, so it must not be done with MSR[RI]=0, which leads to SLB unrecoverable fault error. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/syscall_64.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/power

Re: [PATCH 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-03-19 Thread Christophe Leroy
Le 18/03/2020 à 23:06, Mike Kravetz a écrit : Now that architectures provide arch_hugetlb_valid_size(), parsing of "hugepagesz=" can be done in architecture independent code. Create a single routine to handle hugepagesz= parsing and remove all arch specific routines. We can also remove the in

Re: [PATCH v2 3/4] mm: Implement reset_numa_mem

2020-03-19 Thread Michal Hocko
On Wed 18-03-20 19:20:41, Cristopher Lameter wrote: > On Wed, 18 Mar 2020, Srikar Dronamraju wrote: > > > For a memoryless or offline nodes, node_numa_mem refers to a N_MEMORY > > fallback node. Currently kernel has an API set_numa_mem that sets > > node_numa_mem for memoryless node. However this

Re: [PATCH v3] ocxl: control via sysfs whether the FPGA is reloaded on a link reset

2020-03-19 Thread Frederic Barrat
Le 18/03/2020 à 11:02, Frederic Barrat a écrit : From: Philippe Bergheaud Some opencapi FPGA images allow to control if the FPGA should be reloaded on the next adapter reset. If it is supported, the image specifies it through a Vendor Specific DVSEC in the config space of function 0. Signed

Re: [patch V2 04/15] orinoco_usb: Use the regular completion interfaces

2020-03-19 Thread Greg Kroah-Hartman
On Wed, Mar 18, 2020 at 09:43:06PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > The completion usage in this driver is interesting: > > - it uses a magic complete function which according to the comment was > implemented by invoking complete() four times in a row because >

Re: [patch V2 03/15] usb: gadget: Use completion interface instead of open coding it

2020-03-19 Thread Greg Kroah-Hartman
On Wed, Mar 18, 2020 at 09:43:05PM +0100, Thomas Gleixner wrote: > ep_io() uses a completion on stack and open codes the waiting with: > > wait_event_interruptible (done.wait, done.done); > and > wait_event (done.wait, done.done); > > This waits in non-exclusive mode for complete(), but there

Re: [patch V2 11/15] completion: Use simple wait queues

2020-03-19 Thread Greg Kroah-Hartman
On Wed, Mar 18, 2020 at 09:43:13PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > completion uses a wait_queue_head_t to enqueue waiters. > > wait_queue_head_t contains a spinlock_t to protect the list of waiters > which excludes it from being used in truly atomic context on a PREEMPT

Re: [patch V2 08/15] Documentation: Add lock ordering and nesting documentation

2020-03-19 Thread Davidlohr Bueso
On Wed, 18 Mar 2020, Thomas Gleixner wrote: +Owner semantics +=== + +Most lock types in the Linux kernel have strict owner semantics, i.e. the +context (task) which acquires a lock has to release it. + +There are two exceptions: + + - semaphores + - rwsems + +semaphores have no stri

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Sachin Sant
> OK how about this version? It's somewhat ugly, but important is that the fast > path case (c->page exists) is unaffected and another common case (c->page is > NULL, but node is NUMA_NO_NODE) is just one extra check - impossible to avoid > at > some point anyway. > I attempted the suggested t

Re: [PATCH v3 25/32] powerpc/64: system call implement entry/exit logic in C

2020-03-19 Thread Christophe Leroy
Le 25/02/2020 à 18:35, Nicholas Piggin a écrit : System call entry and particularly exit code is beyond the limit of what is reasonable to implement in asm. This conversion moves all conditional branches out of the asm code, except for the case that all GPRs should be restored at exit. Null

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Peter Zijlstra
On Thu, Mar 19, 2020 at 10:00:24AM +0100, Sebastian Andrzej Siewior wrote: > On 2020-03-18 21:43:09 [+0100], Thomas Gleixner wrote: > > --- a/arch/powerpc/platforms/ps3/device-init.c > > +++ b/arch/powerpc/platforms/ps3/device-init.c > > @@ -725,12 +728,12 @@ static int ps3_notification_read_write(

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Davidlohr Bueso
On Wed, 18 Mar 2020, Thomas Gleixner wrote: AFAICT the kthread uses TASK_INTERRUPTIBLE to not increase loadavg, kthreads cannot receive signals by default and this one doesn't look different. Use TASK_IDLE instead. Hmm it seems in general this needs to be done kernel-wide. This kthread abuse of

Re: [PATCH v2 1/4] mm: Check for node_online in node_present_pages

2020-03-19 Thread Vlastimil Babka
On 3/19/20 1:32 AM, Michael Ellerman wrote: > Seems like a nice solution to me Thanks :) >> 8< >> diff --git a/mm/slub.c b/mm/slub.c >> index 17dc00e33115..1d4f2d7a0080 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -1511,7 +1511,7 @@ static inline struct page *alloc_slab_page(struct

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Sebastian Andrzej Siewior
On 2020-03-18 21:43:09 [+0100], Thomas Gleixner wrote: > --- a/arch/powerpc/platforms/ps3/device-init.c > +++ b/arch/powerpc/platforms/ps3/device-init.c > @@ -725,12 +728,12 @@ static int ps3_notification_read_write(s > unsigned long flags; > int res; > > - init_completion(&dev->d

Re: [PATCH v2 4/8] powernv/memtrace: always online added memory blocks

2020-03-19 Thread Michael Ellerman
David Hildenbrand writes: > Let's always try to online the re-added memory blocks. In case add_memory() > already onlined the added memory blocks, the first device_online() call > will fail and stop processing the remaining memory blocks. > > This avoids manually having to check memhp_auto_online.

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Christoph Hellwig
On Wed, Mar 18, 2020 at 09:43:09PM +0100, Thomas Gleixner wrote: > The PS3 notification interrupt and kthread use a hacked up completion to > communicate. Since we're wanting to change the completion implementation and > this is abuse anyway, replace it with a simple rcuwait since there is only >

[PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Borislav Petkov
Hi, here's v2 with build breakage fixed on ppc and s390 (obviously I can't grep :-\) and commit message extended to explain more why. Thx. --- From: Borislav Petkov Date: Tue, 17 Mar 2020 12:03:05 +0100 Back then when the whole SME machinery started getting mainlined, it was agreed that for si

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Christoph Hellwig
On Thu, Mar 19, 2020 at 11:16:57AM +0100, Borislav Petkov wrote: > Hi, > > here's v2 with build breakage fixed on ppc and s390 (obviously I can't > grep :-\) and commit message extended to explain more why. I thought we agreed that decrypted is absolutely the wrong term. So NAK - if you want to

Re: [PATCH] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn

2020-03-19 Thread Rafael J. Wysocki
On Monday, March 16, 2020 2:57:43 PM CET Pratik Rajesh Sampat wrote: > The patch avoids allocating cpufreq_policy on stack hence fixing frame > size overflow in 'powernv_cpufreq_work_fn' > > Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur > on unthrottling") > Signed-

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Sebastian Andrzej Siewior
On 2020-03-19 03:04:59 [-0700], Christoph Hellwig wrote: > But I wonder how alive the whole PS3 support is to start with.. OtherOS can only be used on "old" PS3 which do not have have their firmware upgraded past version 3.21, released April 1, 2010 [0]. It was not possible to install OtherOS on P

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Borislav Petkov
On Thu, Mar 19, 2020 at 11:20:11AM +0100, Christoph Hellwig wrote: > I thought we agreed that decrypted is absolutely the wrong term. I don't think we did. At least I don't know where we did that. > So NAK - if you want to change things it needs to go the other way. We are already using "decrypt

Re: [PATCH v3] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events

2020-03-19 Thread Michael Ellerman
Hi Athira, Athira Rajeev writes: > Sampled Instruction Event Register (SIER), is a PMU register, ^ that > captures architecture state for a given sample. And sier_user_mas

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Robin Murphy
[since this is in my inbox...] On 2020-03-19 10:28 am, Borislav Petkov wrote: On Thu, Mar 19, 2020 at 11:20:11AM +0100, Christoph Hellwig wrote: I thought we agreed that decrypted is absolutely the wrong term. I don't think we did. At least I don't know where we did that. So NAK - if you wa

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Borislav Petkov
On Thu, Mar 19, 2020 at 11:06:15AM +, Robin Murphy wrote: > Let me add another vote from a native English speaker that "unencrypted" is > the appropriate term to imply the *absence* of encryption, whereas > "decrypted" implies the *reversal* of applied encryption. > > Naming things is famously

Re: [RFC 00/11] perf: Enhancing perf to export processor hazard information

2020-03-19 Thread Michael Ellerman
Kim Phillips writes: > On 3/17/20 1:50 AM, maddy wrote: >> On 3/13/20 4:08 AM, Kim Phillips wrote: >>> On 3/11/20 11:00 AM, Ravi Bangoria wrote: >>> information on each sample using PMI at periodic intervals. Hence proposing PERF_SAMPLE_PIPELINE_HAZ. >>> >>> And that's fine for any extra

[PATCH v11 1/8] powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro

2020-03-19 Thread Michal Suchanek
This partially reverts commit caf6f9c8a326 ("asm-generic: Remove unneeded __ARCH_WANT_SYS_LLSEEK macro") When CONFIG_COMPAT is disabled on ppc64 the kernel does not build. There is resistance to both removing the llseek syscall from the 64bit syscall tables and building the llseek interface uncon

[PATCH v11 0/8] Disable compat cruft on ppc64le v11

2020-03-19 Thread Michal Suchanek
Less code means less bugs so add a knob to skip the compat stuff. Changes in v2: saner CONFIG_COMPAT ifdefs Changes in v3: - change llseek to 32bit instead of builing it unconditionally in fs - clanup the makefile conditionals - remove some ifdefs or convert to IS_DEFINED where possible Changes

[PATCH v11 2/8] powerpc: move common register copy functions from signal_32.c to signal.c

2020-03-19 Thread Michal Suchanek
These functions are required for 64bit as well. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 141 arch/powerpc/kernel/signal_32.c | 140 --- 2 files changed, 141 insertions(+), 140

[PATCH v11 3/8] powerpc/perf: consolidate read_user_stack_32

2020-03-19 Thread Michal Suchanek
There are two almost identical copies for 32bit and 64bit. The function is used only in 32bit code which will be split out in next patch so consolidate to one function. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v6: new patch v8: move the consolidated function out of the

[PATCH v11 5/8] powerpc/64: make buildable without CONFIG_COMPAT

2020-03-19 Thread Michal Suchanek
There are numerous references to 32bit functions in generic and 64bit code so ifdef them out. Signed-off-by: Michal Suchanek --- v2: - fix 32bit ifdef condition in signal.c - simplify the compat ifdef condition in vdso.c - 64bit is redundant - simplify the compat ifdef condition in callchain.c -

[PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Michal Suchanek
Merge the 32bit and 64bit version. Halve the check constants on 32bit. Use STACK_TOP since it is defined. Passing is_64 is now redundant since is_32bit_task() is used to determine which callchain variant should be used. Use STACK_TOP and is_32bit_task() directly. This removes a page from the va

[PATCH v11 6/8] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2020-03-19 Thread Michal Suchanek
On bigendian ppc64 it is common to have 32bit legacy binaries but much less so on littleendian. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v3: make configurable --- arch/powerpc/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/K

[PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- v10: new patch --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bc8dbe4fe4c9..329bf4a31412 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13088,6 +13088,8 @@ F: arch/*/kernel/*/perf_event*.c F: arch/

[PATCH v11 7/8] powerpc/perf: split callchain.c by bitness

2020-03-19 Thread Michal Suchanek
Building callchain.c with !COMPAT proved quite ugly with all the defines. Splitting out the 32bit and 64bit parts looks better. No code change intended. Signed-off-by: Michal Suchanek --- v6: - move current_is_64bit consolidetaion to earlier patch - move defines to the top of callchain_32.c -

[PATCH v11 0/8] Disable compat cruft on ppc64le v11

2020-03-19 Thread Michal Suchanek
Less code means less bugs so add a knob to skip the compat stuff. Changes in v2: saner CONFIG_COMPAT ifdefs Changes in v3: - change llseek to 32bit instead of builing it unconditionally in fs - clanup the makefile conditionals - remove some ifdefs or convert to IS_DEFINED where possible Changes

[PATCH v11 1/8] powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro

2020-03-19 Thread Michal Suchanek
This partially reverts commit caf6f9c8a326 ("asm-generic: Remove unneeded __ARCH_WANT_SYS_LLSEEK macro") When CONFIG_COMPAT is disabled on ppc64 the kernel does not build. There is resistance to both removing the llseek syscall from the 64bit syscall tables and building the llseek interface uncon

[PATCH v11 2/8] powerpc: move common register copy functions from signal_32.c to signal.c

2020-03-19 Thread Michal Suchanek
These functions are required for 64bit as well. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 141 arch/powerpc/kernel/signal_32.c | 140 --- 2 files changed, 141 insertions(+), 140

[PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Michal Suchanek
Merge the 32bit and 64bit version. Halve the check constants on 32bit. Use STACK_TOP since it is defined. Passing is_64 is now redundant since is_32bit_task() is used to determine which callchain variant should be used. Use STACK_TOP and is_32bit_task() directly. This removes a page from the va

[PATCH v11 3/8] powerpc/perf: consolidate read_user_stack_32

2020-03-19 Thread Michal Suchanek
There are two almost identical copies for 32bit and 64bit. The function is used only in 32bit code which will be split out in next patch so consolidate to one function. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v6: new patch v8: move the consolidated function out of the

[PATCH v11 5/8] powerpc/64: make buildable without CONFIG_COMPAT

2020-03-19 Thread Michal Suchanek
There are numerous references to 32bit functions in generic and 64bit code so ifdef them out. Signed-off-by: Michal Suchanek --- v2: - fix 32bit ifdef condition in signal.c - simplify the compat ifdef condition in vdso.c - 64bit is redundant - simplify the compat ifdef condition in callchain.c -

[PATCH v11 6/8] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2020-03-19 Thread Michal Suchanek
On bigendian ppc64 it is common to have 32bit legacy binaries but much less so on littleendian. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v3: make configurable --- arch/powerpc/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/K

[PATCH v11 7/8] powerpc/perf: split callchain.c by bitness

2020-03-19 Thread Michal Suchanek
Building callchain.c with !COMPAT proved quite ugly with all the defines. Splitting out the 32bit and 64bit parts looks better. No code change intended. Signed-off-by: Michal Suchanek --- v6: - move current_is_64bit consolidetaion to earlier patch - move defines to the top of callchain_32.c -

[PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- v10: new patch --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bc8dbe4fe4c9..329bf4a31412 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13088,6 +13088,8 @@ F: arch/*/kernel/*/perf_event*.c F: arch/

Re: [PATCH v11 0/8] Disable compat cruft on ppc64le v11

2020-03-19 Thread Michal Suchánek
Lost some headers so will resend. On Thu, Mar 19, 2020 at 12:52:20PM +0100, Michal Suchanek wrote: > Less code means less bugs so add a knob to skip the compat stuff. > > Changes in v2: saner CONFIG_COMPAT ifdefs > Changes in v3: > - change llseek to 32bit instead of builing it unconditionally i

Re: [PATCH v11 0/8] Disable compat cruft on ppc64le v11

2020-03-19 Thread Christophe Leroy
You sent it twice ? Any difference between the two dispatch ? Christophe Le 19/03/2020 à 13:19, Michal Suchanek a écrit : Less code means less bugs so add a knob to skip the compat stuff. Changes in v2: saner CONFIG_COMPAT ifdefs Changes in v3: - change llseek to 32bit instead of builing it

[PATCH v3 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-19 Thread David Hildenbrand
The name is misleading and it's not really clear what is "kept". Let's just name it like the online_type name we expose to user space ("online"). Add some documentation to the types. Reviewed-by: Wei Yang Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafae

[PATCH v3 0/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-19 Thread David Hildenbrand
Distributions nowadays use udev rules ([1] [2]) to specify if and how to online hotplugged memory. The rules seem to get more complex with many special cases. Due to the various special cases, CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE cannot be used. All memory hotplug is handled via udev rules. Everyt

[PATCH v3 2/8] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-19 Thread David Hildenbrand
Historically, we used the value -1. Just treat 0 as the special case now. Clarify a comment (which was wrong, when we come via device_online() the first time, the online_type would have been 0 / MEM_ONLINE). The default is now always MMOP_OFFLINE. This removes the last user of the manual "-1", whic

[PATCH v3 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-19 Thread David Hildenbrand
Let's use a simple array which we can reuse soon. While at it, move the string->mmop conversion out of the device hotplug lock. Reviewed-by: Wei Yang Acked-by: Michal Hocko Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He C

[PATCH v3 4/8] powernv/memtrace: always online added memory blocks

2020-03-19 Thread David Hildenbrand
Let's always try to online the re-added memory blocks. In case add_memory() already onlined the added memory blocks, the first device_online() call will fail and stop processing the remaining memory blocks. This avoids manually having to check memhp_auto_online. Note: PPC always onlines all hotpl

[PATCH v3 6/8] mm/memory_hotplug: unexport memhp_auto_online

2020-03-19 Thread David Hildenbrand
All in-tree users except the mm-core are gone. Let's drop the export. Reviewed-by: Wei Yang Acked-by: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 1 - 1 f

[PATCH v3 5/8] hv_balloon: don't check for memhp_auto_online manually

2020-03-19 Thread David Hildenbrand
We get the MEM_ONLINE notifier call if memory is added right from the kernel via add_memory() or later from user space. Let's get rid of the "ha_waiting" flag - the wait event has an inbuilt mechanism (->done) for that. Initialize the wait event only once and reinitialize before adding memory. Unc

[PATCH v3 7/8] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-19 Thread David Hildenbrand
... and rename it to memhp_default_online_type. This is a preparation for more detailed default online behavior. Reviewed-by: Wei Yang Acked-by: Michal Hocko Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Si

[PATCH v3 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-19 Thread David Hildenbrand
For now, distributions implement advanced udev rules to essentially - Don't online any hotplugged memory (s390x) - Online all memory to ZONE_NORMAL (e.g., most virt environments like hyperv) - Online all memory to ZONE_MOVABLE in case the zone imbalance is taken care of (e.g., bare metal, speci

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Vlastimil Babka
On 3/19/20 9:52 AM, Sachin Sant wrote: > >> OK how about this version? It's somewhat ugly, but important is that the fast >> path case (c->page exists) is unaffected and another common case (c->page is >> NULL, but node is NUMA_NO_NODE) is just one extra check - impossible to >> avoid at >> some

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Sachin Sant
> On 19-Mar-2020, at 6:53 PM, Vlastimil Babka wrote: > > On 3/19/20 9:52 AM, Sachin Sant wrote: >> >>> OK how about this version? It's somewhat ugly, but important is that the >>> fast >>> path case (c->page exists) is unaffected and another common case (c->page is >>> NULL, but node is NUMA

Re: [PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Andy Shevchenko
On Thu, Mar 19, 2020 at 1:54 PM Michal Suchanek wrote: > > Merge the 32bit and 64bit version. > > Halve the check constants on 32bit. > > Use STACK_TOP since it is defined. > > Passing is_64 is now redundant since is_32bit_task() is used to > determine which callchain variant should be used. Use S

Re: [PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Andy Shevchenko
On Thu, Mar 19, 2020 at 2:21 PM Michal Suchanek wrote: > > Signed-off-by: Michal Suchanek > --- > v10: new patch > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index bc8dbe4fe4c9..329bf4a31412 100644 > --- a/MAINTAINERS > +++ b/MAINTAIN

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Vlastimil Babka
On 3/19/20 2:26 PM, Sachin Sant wrote: > > >> On 19-Mar-2020, at 6:53 PM, Vlastimil Babka wrote: >> >> On 3/19/20 9:52 AM, Sachin Sant wrote: >>> OK how about this version? It's somewhat ugly, but important is that the fast path case (c->page exists) is unaffected and another c

Re: [PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Michal Suchánek
On Thu, Mar 19, 2020 at 03:37:03PM +0200, Andy Shevchenko wrote: > On Thu, Mar 19, 2020 at 2:21 PM Michal Suchanek wrote: > > > > Signed-off-by: Michal Suchanek > > --- > > v10: new patch > > --- > > MAINTAINERS | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/MAINTAINERS b/MAINT

Re: [PATCH v11 0/8] Disable compat cruft on ppc64le v11

2020-03-19 Thread Michal Suchánek
On Thu, Mar 19, 2020 at 01:36:56PM +0100, Christophe Leroy wrote: > You sent it twice ? Any difference between the two dispatch ? Some headers were broken the first time around. Thanks Michal > > Christophe > > Le 19/03/2020 à 13:19, Michal Suchanek a écrit : > > Less code means less bugs so ad

Re: [PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Michal Suchánek
On Thu, Mar 19, 2020 at 03:35:03PM +0200, Andy Shevchenko wrote: > On Thu, Mar 19, 2020 at 1:54 PM Michal Suchanek wrote: > > > > Merge the 32bit and 64bit version. > > > > Halve the check constants on 32bit. > > > > Use STACK_TOP since it is defined. > > > > Passing is_64 is now redundant since i

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Srikar Dronamraju
* Vlastimil Babka [2020-03-19 14:47:58]: > 8< > diff --git a/mm/slub.c b/mm/slub.c > index 17dc00e33115..7113b1f9cd77 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1973,8 +1973,6 @@ static void *get_partial(struct kmem_cache *s, gfp_t > flags, int node, > > if (node == NUMA_NO_

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Vlastimil Babka
On 3/19/20 3:05 PM, Srikar Dronamraju wrote: > * Vlastimil Babka [2020-03-19 14:47:58]: > >> 8< >> diff --git a/mm/slub.c b/mm/slub.c >> index 17dc00e33115..7113b1f9cd77 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -1973,8 +1973,6 @@ static void *get_partial(struct kmem_cache *s, gf

Re: [PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Christophe Leroy
Le 19/03/2020 à 14:35, Andy Shevchenko a écrit : On Thu, Mar 19, 2020 at 1:54 PM Michal Suchanek wrote: Merge the 32bit and 64bit version. Halve the check constants on 32bit. Use STACK_TOP since it is defined. Passing is_64 is now redundant since is_32bit_task() is used to determine whic

Re: [PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Andy Shevchenko
On Thu, Mar 19, 2020 at 03:00:08PM +0100, Michal Suchánek wrote: > On Thu, Mar 19, 2020 at 03:37:03PM +0200, Andy Shevchenko wrote: > > On Thu, Mar 19, 2020 at 2:21 PM Michal Suchanek wrote: > > > > > > Signed-off-by: Michal Suchanek > > > --- > > > v10: new patch > > > --- > > > MAINTAINERS | 2

Re: [PATCH] tpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-03-19 Thread Jarkko Sakkinen
On Wed, Mar 18, 2020 at 03:53:54PM -0400, Stefan Berger wrote: > On 3/18/20 3:42 PM, Jarkko Sakkinen wrote: > > On Tue, Mar 17, 2020 at 09:08:19AM -0400, Stefan Berger wrote: > > > From: Stefan Berger > > > > > > This patch fixes the following problem when the ibmvtpm driver > > > is built as a m

Re: [PATCH v11 4/8] powerpc/perf: consolidate valid_user_sp

2020-03-19 Thread Michal Suchánek
On Thu, Mar 19, 2020 at 03:16:03PM +0100, Christophe Leroy wrote: > > > Le 19/03/2020 à 14:35, Andy Shevchenko a écrit : > > On Thu, Mar 19, 2020 at 1:54 PM Michal Suchanek wrote: > > > > > > Merge the 32bit and 64bit version. > > > > > > Halve the check constants on 32bit. > > > > > > Use ST

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Sachin Sant
>>> Great, thanks! Can I add your Tested-by: then? >> >> Sure. >> Tested-by: Sachin Sant >> >> Thank you for the fix. > > Thanks! Sorry to bother, but in the end I decided to do further change so I > would appreciate verification if it still works as intended. Works as expected. I am able to b

Re: [patch V2 08/15] Documentation: Add lock ordering and nesting documentation

2020-03-19 Thread Jonathan Corbet
On Wed, 18 Mar 2020 21:43:10 +0100 Thomas Gleixner wrote: > From: Thomas Gleixner > > The kernel provides a variety of locking primitives. The nesting of these > lock types and the implications of them on RT enabled kernels is nowhere > documented. > > Add initial documentation. ...time to ad

Re: [PATCH] tpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-03-19 Thread Stefan Berger
On 3/19/20 10:27 AM, Jarkko Sakkinen wrote: On Wed, Mar 18, 2020 at 03:53:54PM -0400, Stefan Berger wrote: On 3/18/20 3:42 PM, Jarkko Sakkinen wrote: On Tue, Mar 17, 2020 at 09:08:19AM -0400, Stefan Berger wrote: From: Stefan Berger This patch fixes the following problem when the ibmvtpm dri

Re: [PATCH v11 8/8] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2020-03-19 Thread Joe Perches
On Thu, 2020-03-19 at 13:19 +0100, Michal Suchanek wrote: > Signed-off-by: Michal Suchanek > --- > v10: new patch > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index bc8dbe4fe4c9..329bf4a31412 100644 > --- a/MAINTAINERS > +++ b/MAINTAI

Re: [PATCH 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-03-19 Thread Mike Kravetz
On 3/19/20 12:04 AM, Christophe Leroy wrote: > > > Le 18/03/2020 à 23:06, Mike Kravetz a écrit : >> Now that architectures provide arch_hugetlb_valid_size(), parsing >> of "hugepagesz=" can be done in architecture independent code. >> Create a single routine to handle hugepagesz= parsing and remo

Re: [patch V2 11/15] completion: Use simple wait queues

2020-03-19 Thread Linus Torvalds
On Wed, Mar 18, 2020 at 1:47 PM Thomas Gleixner wrote: > > There is no semantical or functional change: Ack, with just the explanation, I'm no longer objecting to this. Plus you fixed and cleaned up the odd usb gadget code separately (well, most of it). Linus

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Thomas Gleixner
Borislav Petkov writes: > On Thu, Mar 19, 2020 at 11:06:15AM +, Robin Murphy wrote: >> Let me add another vote from a native English speaker that "unencrypted" is >> the appropriate term to imply the *absence* of encryption, whereas >> "decrypted" implies the *reversal* of applied encryption.

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Borislav Petkov
On Thu, Mar 19, 2020 at 06:25:49PM +0100, Thomas Gleixner wrote: > TBH, I don't see how > > if (force_dma_decrypted(dev)) > set_memory_encrypted((unsigned long)cpu_addr, 1 << page_order); > > makes more sense than the above. It's both non-sensical unless there is 9087c37584fb

Re: [patch V2 08/15] Documentation: Add lock ordering and nesting documentation

2020-03-19 Thread Thomas Gleixner
Paul, "Paul E. McKenney" writes: > On Wed, Mar 18, 2020 at 09:43:10PM +0100, Thomas Gleixner wrote: > > Mostly native-English-speaker services below, so please feel free to > ignore. The one place I made a substantive change, I marked it "@@@". > I only did about half of this document, but shou

Re: [patch V2 08/15] Documentation: Add lock ordering and nesting documentation

2020-03-19 Thread Thomas Gleixner
Jonathan Corbet writes: > On Wed, 18 Mar 2020 21:43:10 +0100 > Thomas Gleixner wrote: >> Add initial documentation. > > ...time to add a a couple of nits...:) ...time Is that valid RST? >> +++ b/Documentation/locking/locktypes.rst >> @@ -0,0 +1,298 @@ >> +.. _kernel_hacking_locktypes: >> + > >

Re: [PATCH 1/4] hugetlbfs: add arch_hugetlb_valid_size

2020-03-19 Thread Mike Kravetz
On 3/19/20 12:00 AM, Christophe Leroy wrote: > > Le 18/03/2020 à 23:06, Mike Kravetz a écrit : >> The architecture independent routine hugetlb_default_setup sets up >> the default huge pages size. It has no way to verify if the passed >> value is valid, so it accepts it and attempts to validate a

Re: [PATCH v2] qtpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-03-19 Thread Jarkko Sakkinen
On Wed, Mar 18, 2020 at 09:00:17PM -0400, Stefan Berger wrote: > From: Stefan Berger > > This patch fixes the following problem when the ibmvtpm driver > is built as a module: > > ERROR: modpost: "tpm2_get_cc_attrs_tbl" [drivers/char/tpm/tpm_ibmvtpm.ko] > undefined! > make[1]: *** [scripts/Make

[Bug 206669] Little-endian kernel crashing on POWER8 on heavy big-endian PowerKVM load

2020-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206669 --- Comment #13 from John Paul Adrian Glaubitz (glaub...@physik.fu-berlin.de) --- watson login: [30887.552539] KVM: CPU 4 seems to be stuck [30900.094713] watchdog: CPU 8 detected hard LOCKUP on other CPUs 0 [30900.094730] watchdog: CPU 8 TB:1586

Re: [PATCH v3 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-19 Thread Pankaj Gupta
> The name is misleading and it's not really clear what is "kept". Let's just > name it like the online_type name we expose to user space ("online"). > > Add some documentation to the types. > > Reviewed-by: Wei Yang > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Sa

Re: [PATCH v3 2/8] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-19 Thread Pankaj Gupta
> Historically, we used the value -1. Just treat 0 as the special > case now. Clarify a comment (which was wrong, when we come via > device_online() the first time, the online_type would have been 0 / > MEM_ONLINE). The default is now always MMOP_OFFLINE. This removes the > last user of the manual

Re: [PATCH v3 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-19 Thread Pankaj Gupta
> Let's use a simple array which we can reuse soon. While at it, move the > string->mmop conversion out of the device hotplug lock. > > Reviewed-by: Wei Yang > Acked-by: Michal Hocko > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael J. Wysocki"

Re: [PATCH v3 6/8] mm/memory_hotplug: unexport memhp_auto_online

2020-03-19 Thread Pankaj Gupta
> All in-tree users except the mm-core are gone. Let's drop the export. > > Reviewed-by: Wei Yang > Acked-by: Michal Hocko > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael J. Wysocki" > Cc: Baoquan He > Cc: Wei Yang > Signed-off-by: David Hildenbrand > --- > mm/me

Re: [PATCH v3 7/8] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-19 Thread Pankaj Gupta
> ... and rename it to memhp_default_online_type. This is a preparation > for more detailed default online behavior. > > Reviewed-by: Wei Yang > Acked-by: Michal Hocko > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael J. Wysocki" > Cc: Baoquan

Re: [PATCH v3 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-19 Thread Pankaj Gupta
> For now, distributions implement advanced udev rules to essentially > - Don't online any hotplugged memory (s390x) > - Online all memory to ZONE_NORMAL (e.g., most virt environments like > hyperv) > - Online all memory to ZONE_MOVABLE in case the zone imbalance is taken > care of (e.g., bare

Re: [PATCH] tpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-03-19 Thread Jarkko Sakkinen
On Thu, Mar 19, 2020 at 11:56:11AM -0400, Stefan Berger wrote: > On 3/19/20 10:27 AM, Jarkko Sakkinen wrote: > > On Wed, Mar 18, 2020 at 03:53:54PM -0400, Stefan Berger wrote: > > > On 3/18/20 3:42 PM, Jarkko Sakkinen wrote: > > > > On Tue, Mar 17, 2020 at 09:08:19AM -0400, Stefan Berger wrote: > >

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Michal Suchánek
On Thu, Mar 19, 2020 at 06:25:49PM +0100, Thomas Gleixner wrote: > Borislav Petkov writes: > > > On Thu, Mar 19, 2020 at 11:06:15AM +, Robin Murphy wrote: > >> Let me add another vote from a native English speaker that "unencrypted" is > >> the appropriate term to imply the *absence* of encry

[PATCH] KVM: PPC: Book3S HV: Skip kvmppc_uvmem_free if Ultravisor is not supported

2020-03-19 Thread Fabiano Rosas
kvmppc_uvmem_init checks for Ultravisor support and returns early if it is not present. Calling kvmppc_uvmem_free at module exit will cause an Oops: $ modprobe -r kvm-hv Oops: Kernel access of bad area, sig: 11 [#1] NIP: c0789e90 LR: c0789e8c CTR: c0401030 REGS:

Re: [patch V2 11/15] completion: Use simple wait queues

2020-03-19 Thread Julian Calaby
Hi Thomas, On Thu, Mar 19, 2020 at 7:48 AM Thomas Gleixner wrote: > > From: Thomas Gleixner > > completion uses a wait_queue_head_t to enqueue waiters. > > wait_queue_head_t contains a spinlock_t to protect the list of waiters > which excludes it from being used in truly atomic context on a PREE

Re: [PATCH v3] KVM: PPC: Book3S HV: Treat TM-related invalid form instructions on P9 like the valid ones

2020-03-19 Thread Paul Mackerras
On Fri, Feb 21, 2020 at 11:29:50AM -0500, Gustavo Romero wrote: > On P9 DD2.2 due to a CPU defect some TM instructions need to be emulated by > KVM. This is handled at first by the hardware raising a softpatch interrupt > when certain TM instructions that need KVM assistance are executed in the > g

Re: [PATCH] KVM: PPC: Book3S HV: Fix H_CEDE return code for nested guests

2020-03-19 Thread Paul Mackerras
On Tue, Mar 10, 2020 at 04:11:28PM -0500, Michael Roth wrote: > The h_cede_tm kvm-unit-test currently fails when run inside an L1 guest > via the guest/nested hypervisor. > > ./run-tests.sh -v > ... > TESTNAME=h_cede_tm TIMEOUT=90s ACCEL= ./powerpc/run powerpc/tm.elf -smp > 2,threads=2 -mac

Re: [PATCH -next 016/491] KERNEL VIRTUAL MACHINE FOR POWERPC (KVM/powerpc): Use fallthrough;

2020-03-19 Thread Paul Mackerras
On Wed, Mar 18, 2020 at 06:22:29PM -0700, Joe Perches wrote: > On Thu, 2020-03-19 at 12:18 +1100, Paul Mackerras wrote: > > On Tue, Mar 10, 2020 at 09:51:30PM -0700, Joe Perches wrote: > > > Convert the various uses of fallthrough comments to fallthrough; > > > > > > Done via script > > > Link: >

Re: [PATCH] KVM: PPC: Book3S HV: Use RADIX_PTE_INDEX_SIZE in Radix MMU code

2020-03-19 Thread Paul Mackerras
On Tue, Feb 18, 2020 at 03:36:50PM +1100, Michael Ellerman wrote: > In kvmppc_unmap_free_pte() in book3s_64_mmu_radix.c, we use the > non-constant value PTE_INDEX_SIZE to clear a PTE page. > > We can instead use the constant RADIX_PTE_INDEX_SIZE, because we know > this code will only be running wh

Re: [PATCH 0/3] KVM: PPC: Fix host kernel crash with PR KVM

2020-03-19 Thread Paul Mackerras
On Wed, Mar 18, 2020 at 06:43:24PM +0100, Greg Kurz wrote: > Recent cleanup from Sean Christopherson introduced a use-after-free > condition that crashes the kernel when shutting down the VM with > PR KVM. It went unnoticed so far because PR isn't tested/used much > these days (mostly used for nest

Re: [PATCH -v2] treewide: Rename "unencrypted" to "decrypted"

2020-03-19 Thread Thomas Gleixner
Borislav Petkov writes: > On Thu, Mar 19, 2020 at 06:25:49PM +0100, Thomas Gleixner wrote: >> TBH, I don't see how >> >> if (force_dma_decrypted(dev)) >> set_memory_encrypted((unsigned long)cpu_addr, 1 << page_order); >> >> makes more sense than the above. It's both non-sensical

Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait

2020-03-19 Thread Geoff Levand
Hi, On 3/19/20 3:26 AM, Sebastian Andrzej Siewior wrote: > On 2020-03-19 03:04:59 [-0700], Christoph Hellwig wrote: >> But I wonder how alive the whole PS3 support is to start with.. > > OtherOS can only be used on "old" PS3 which do not have have their > firmware upgraded past version 3.21, rele

Re: [PATCH] KVM: PPC: Book3S HV: Skip kvmppc_uvmem_free if Ultravisor is not supported

2020-03-19 Thread Paul Mackerras
On Thu, Mar 19, 2020 at 07:55:10PM -0300, Fabiano Rosas wrote: > kvmppc_uvmem_init checks for Ultravisor support and returns early if > it is not present. Calling kvmppc_uvmem_free at module exit will cause > an Oops: > > $ modprobe -r kvm-hv > > Oops: Kernel access of bad area, sig: 11 [#1] >

  1   2   >