[PATCH] mm/hugetlb: Fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

2020-03-17 Thread Christophe Leroy
When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the following build failure is encoutered: In file included from arch/powerpc/mm/fault.c:33:0: ./include/linux/hugetlb.h: In function 'hstate_inode': ./include/linux/hugetlb.h:477:9: error: implicit declaration of function 'HUGETLBFS_SB' [

Re: [PATCH] mm/hugetlb: Fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

2020-03-17 Thread Baoquan He
On 03/17/20 at 08:04am, Christophe Leroy wrote: > When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the > following build failure is encoutered: >From the definition of HUGETLB_PAGE, isn't it relying on HUGETLBFS? I could misunderstand the def_bool, please correct me if I am wrong. config

Re: [PATCH] mm/hugetlb: Fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

2020-03-17 Thread Christophe Leroy
Le 17/03/2020 à 09:25, Baoquan He a écrit : On 03/17/20 at 08:04am, Christophe Leroy wrote: When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the following build failure is encoutered: From the definition of HUGETLB_PAGE, isn't it relying on HUGETLBFS? I could misunderstand the def

[PATCH 0/7] powerpc/64: machine check and other RAS fixes

2020-03-17 Thread Nicholas Piggin
There's a bunch of problems we hit bringing up fwnmi sreset and mces on QEMU, these apply to PowerVM as well, but I haven't done much testing there and it's much harder. This series of fixes applies on top of next-test, the machine check reconcile patch won't apply cleanly to previous kernels but

[PATCH 1/7] powerpc/64: mark emergency stacks valid to unwind

2020-03-17 Thread Nicholas Piggin
Before: WARNING: CPU: 0 PID: 494 at arch/powerpc/kernel/irq.c:343 CPU: 0 PID: 494 Comm: a Tainted: GW NIP: c001ed2c LR: c0d13190 CTR: c003f910 REGS: c001fffd3870 TRAP: 0700 Tainted: GW MSR: 80021003 CR: 28000488 XER: C

[PATCH 2/7] powerpc/pseries/ras: avoid calling rtas_token in NMI paths

2020-03-17 Thread Nicholas Piggin
In the interest of reducing code and possible failures in the machine check and system reset paths, grab the "ibm,nmi-interlock" token at init time. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/firmware.h| 1 + arch/powerpc/platforms/pseries/ras.c | 2 +- arch/powerpc/plat

[PATCH 3/7] powerpc/64s: Change irq reconcile for NMIs from reusing _DAR to RESULT

2020-03-17 Thread Nicholas Piggin
A spare interrupt stack slot is needed to save irq state when reconciling NMIs (sreset and decrementer soft-nmi). _DAR is used for this, but we want to reconcile machine checks as well, which do use _DAR. Switch to using RESULT instead, as it's used by system calls. Signed-off-by: Nicholas Piggin

[PATCH 4/7] powerpc/64s: machine check reconcile irq state

2020-03-17 Thread Nicholas Piggin
pseries fwnmi machine check code pops the soft-irq checks in rtas_call (after the previous patch to remove rtas_token from this call path). Rather than play whack a mole with these and forever having fragile code, it seems better to have the early machine check handler perform the same kind of reco

[PATCH 5/7] powerpc/pseries/ras: FWNMI_VALID off by one

2020-03-17 Thread Nicholas Piggin
This was discovered developing qemu fwnmi sreset support. This off-by-one bug means the last 16 bytes of the rtas area can not be used for a 16 byte save area. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 6/7] powerpc/pseries/ras: fwnmi avoid modifying r3 in error case

2020-03-17 Thread Nicholas Piggin
If there is some error with the fwnmi save area, r3 has already been modified which doesn't help with debugging. Only update r3 when to restore the saved value. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[PATCH 7/7] powerpc/pseries/ras: fwnmi sreset should not interlock

2020-03-17 Thread Nicholas Piggin
PAPR does not specify that fwnmi sreset should be interlocked, and PowerVM (and therefore now QEMU) do not require it. These "ibm,nmi-interlock" calls are ignored by firmware, but there is a possibility that the sreset could have interrupted a machine check and release the machine check's interloc

Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Bharata B Rao
Hi, We are seeing an increased slab memory consumption on PowerPC guest LPAR (on PowerVM) having an uncommon topology where one NUMA node has no CPUs or any memory and the other node has all the CPUs and memory. Though QEMU prevents such topologies for KVM guest, I hacked QEMU to allow such topolo

Re: [PATCH] powerpc/pseries: Fix MCE handling on pseries

2020-03-17 Thread Nicholas Piggin
Ganesh's on March 16, 2020 9:47 pm: > > > On 3/14/20 9:18 AM, Nicholas Piggin wrote: >> Ganesh Goudar's on March 14, 2020 12:04 am: >>> MCE handling on pSeries platform fails as recent rework to use common >>> code for pSeries and PowerNV in machine check error handling tries to >>> access per-cp

Re: [PATCH 01/15] powerpc/watchpoint: Rename current DAWR macros

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : Future Power architecture is introducing second DAWR. Rename current DAWR macros as: s/SPRN_DAWR/SPRN_DAWR0/ s/SPRN_DAWRX/SPRN_DAWRX0/ I think you should tell that DAWR0 and DAWRX0 is the real name of the register as documented in (at least

Re: [PATCH 02/15] powerpc/watchpoint: Add SPRN macros for second DAWR

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : Future Power architecture is introducing second DAWR. Add SPRN_ macros for the same. I'm not sure this is called 'macros'. For me a macro is something more complex. For me those are 'constants'. Christophe Signed-off-by: Ravi Bangoria --

Re: [PATCH 03/15] powerpc/watchpoint: Introduce function to get nr watchpoints dynamically

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : So far we had only one watchpoint, so we have hardcoded HBP_NUM to 1. But future Power architecture is introducing 2nd DAWR and thus kernel should be able to dynamically find actual number of watchpoints supported by hw it's running on. Introduce

Re: [PATCH 05/15] powerpc/watchpoint: Provide DAWR number to set_dawr

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : Introduce new parameter 'nr' to set_dawr() which indicates which DAWR should be programed. While we are at it (In another patch I think), we should do the same to set_dabr() so that we can use both DABR and DABR2 Christophe

Re: [PATCH 07/15] powerpc/watchpoint: Get watchpoint count dynamically while disabling them

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : Instead of disabling only one watchpooint, get num of available watchpoints dynamically and disable all of them. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 15 +++ 1 file changed, 7 insertions(+),

Re: [PATCH 08/15] powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : Instead of disabling only first watchpoint, disable all available watchpoints while clearing dawr_force_enable. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/dawr.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff

Re: [PATCH 09/15] powerpc/watchpoint: Convert thread_struct->hw_brk to an array

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : So far powerpc hw supported only one watchpoint. But Future Power architecture is introducing 2nd DAWR. Convert thread_struct->hw_brk into an array. Looks like you are doing a lot more than that in this patch. Should this patch be splitted in t

Re: [PATCH 10/15] powerpc/watchpoint: Use loop for thread_struct->ptrace_bps

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : ptrace_bps is already an array of size HBP_NUM_MAX. But we use hardcoded index 0 while fetching/updating it. Convert such code to loop over array. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 7 +-- arch/powerpc

Re: [PATCH 11/15] powerpc/watchpoint: Introduce is_ptrace_bp() function

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : Introduce is_ptrace_bp() function and move the check inside the function. We will utilize it more in later set of patches. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 7 ++- 1 file changed, 6 insertions(+), 1 de

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

2020-03-17 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 v2 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-17 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 v2 2/8] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-17 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 v2 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-17 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 v2 4/8] powernv/memtrace: always online added memory blocks

2020-03-17 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 v2 5/8] hv_balloon: don't check for memhp_auto_online manually

2020-03-17 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 v2 6/8] mm/memory_hotplug: unexport memhp_auto_online

2020-03-17 Thread David Hildenbrand
All in-tree users except the mm-core are gone. Let's drop the export. 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 file changed, 1 deletion(-) diff --git a/mm/mem

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

2020-03-17 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 Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hilde

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

2020-03-17 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: [PATCH v2 4/8] powernv/memtrace: always online added memory blocks

2020-03-17 Thread Michal Hocko
On Tue 17-03-20 11:49:38, David Hildenbrand wrote: > 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

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

2020-03-17 Thread Michal Hocko
On Tue 17-03-20 11:49:40, David Hildenbrand wrote: > All in-tree users except the mm-core are gone. Let's drop the export. > > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael J. Wysocki" > Cc: Baoquan He > Cc: Wei Yang > Signed-off-by: David Hildenbrand Acked-by: Mi

Re: [PATCH 12/15] powerpc/watchpoint: Prepare handler to handle more than one watcnhpoint

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : Currently we assume that we have only one watchpoint supported by hw. Get rid of that assumption and use dynamic loop instead. This should make supporting more watchpoints very easy. I think using 'we' is to be avoided in commit message. Could

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

2020-03-17 Thread Michal Hocko
On Tue 17-03-20 11:49:41, David Hildenbrand wrote: > ... and rename it to memhp_default_online_type. This is a preparation > for more detailed default online behavior. > > Reviewed-by: Wei Yang > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael

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

2020-03-17 Thread Michal Hocko
On Tue 17-03-20 11:49:42, David Hildenbrand wrote: > 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 t

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

2020-03-17 Thread David Hildenbrand
On 17.03.20 12:01, Michal Hocko wrote: > On Tue 17-03-20 11:49:42, David Hildenbrand wrote: >> 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) >>

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

2020-03-17 Thread David Hildenbrand
On 17.03.20 11:49, David Hildenbrand wrote: > 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

Re: [PATCH 13/15] powerpc/watchpoint: Don't allow concurrent perf and ptrace events

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : ptrace and perf watchpoints on powerpc behaves differently. Ptrace On the 8xx, ptrace generates signal after executing the instruction. watchpoint works in one-shot mode and generates signal before executing instruction. It's ptrace user's job

Re: [PATCH 14/15] powerpc/watchpoint/xmon: Don't allow breakpoint overwriting

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : Xmon allows overwriting breakpoints because it's supported by only one dawr. But with multiple dawrs, overwriting becomes ambiguous or unnecessary complicated. So let's not allow it. Could we drop this completely (I mean the functionnality, not

Re: [PATCH 15/15] powerpc/watchpoint/xmon: Support 2nd dawr

2020-03-17 Thread Christophe Leroy
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : Add support for 2nd DAWR in xmon. With this, we can have two simultaneous breakpoints from xmon. Signed-off-by: Ravi Bangoria --- arch/powerpc/xmon/xmon.c | 101 ++- 1 file changed, 69 insertions(+), 32 del

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

2020-03-17 Thread Borislav Petkov
Hi all, this hasn't been fully tested yet but it is mechanical rename only so there shouldn't be any problems (famous last words :-)). I'll run it through the randconfig bench today and take it through tip if there are no objections. Thx. --- Back then when the whole SME machinery started gett

Re: [PATCH v3] powerpc/fsl-85xx: fix compile error

2020-03-17 Thread Michael Ellerman
王文虎 writes: > From: Michael Ellerman > Date: 2020-03-16 17:41:12 > To:WANG Wenhu ,Benjamin Herrenschmidt > ,Paul Mackerras ,WANG Wenhu > ,Allison Randal ,Richard Fontana > ,Greg Kroah-Hartman ,Thomas > Gleixner > ,linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org > cc: triv...@ker

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Bharata B Rao
On Tue, Mar 17, 2020 at 02:56:28PM +0530, Bharata B Rao wrote: > Case 1: 2 node NUMA, node0 empty > > # numactl -H > available: 2 nodes (0-1) > node 0 cpus: > node 0 size: 0 MB > node 0 free: 0 MB > node 1 cpus: 0 1 2 3 4 5 6 7 > node 1 size: 16294 MB > node 1 free:

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

2020-03-17 Thread Stefan Berger
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/Makefile.modpost:94: __modpost] Error 1 make: *** [Makefile:1298: modules] Error 2

[PATCH 08/12] docs: fix broken references to text files

2020-03-17 Thread Mauro Carvalho Chehab
Several references got broken due to txt to ReST conversion. Several of them can be automatically fixed with: scripts/documentation-file-ref-check --fix Signed-off-by: Mauro Carvalho Chehab --- Documentation/admin-guide/kernel-parameters.txt | 2 +- Documentation/memory-barriers.

[PATCH 11/12] docs: filesystems: fix renamed references

2020-03-17 Thread Mauro Carvalho Chehab
Some filesystem references got broken by a previous patch series I submitted. Address those. Signed-off-by: Mauro Carvalho Chehab --- Documentation/ABI/stable/sysfs-devices-node | 2 +- Documentation/ABI/testing/procfs-smaps_rollup | 2 +- Documentation/admin-guide/cpu-load.rst| 2 +

Re: [PATCH] powerpc/pmac/smp: avoid unused-variable warnings

2020-03-17 Thread Michael Ellerman
On Fri, 2019-09-20 at 15:39:51 UTC, Ilie Halip wrote: > When building with ppc64_defconfig, the compiler reports > that these 2 variables are not used: > warning: unused variable 'core99_l2_cache' [-Wunused-variable] > warning: unused variable 'core99_l3_cache' [-Wunused-variable] > > They

Re: [PATCH] evh_bytechan: fix out of bounds accesses

2020-03-17 Thread Michael Ellerman
On Thu, 2020-01-09 at 07:39:12 UTC, Stephen Rothwell wrote: > ev_byte_channel_send() assumes that its third argument is a 16 byte array. > Some places where it is called it may not be (or we can't easily tell > if it is). Newer compilers have started producing warnings about this, > so make sure w

Re: [PATCH] powerpc/fsl_booke: avoid creating duplicate tlb1 entry

2020-03-17 Thread Michael Ellerman
On Thu, 2020-01-23 at 11:19:25 UTC, Laurentiu Tudor wrote: > In the current implementation, the call to loadcam_multi() is wrapped > between switch_to_as1() and restore_to_as0() calls so, when it tries > to create its own temporary AS=3D1 TLB1 entry, it ends up duplicating the > existing one create

Re: [PATCH 1/2] cpufreq/powernv: Fix use-after-free

2020-03-17 Thread Michael Ellerman
On Thu, 2020-02-06 at 06:26:21 UTC, Oliver O'Halloran wrote: > The cpufreq driver has a use-after-free that we can hit if: > > a) There's an OCC message pending when the notifier is registered, and > b) The cpufreq driver fails to register with the core. > > When a) occurs the notifier schedules

Re: [PATCH] powerpc/vdso: remove deprecated VDS64_HAS_DESCRIPTORS references

2020-03-17 Thread Michael Ellerman
On Mon, 2020-02-24 at 21:18:48 UTC, Joe Lawrence wrote: > The original 2005 patch that introduced the powerpc vdso, pre-git > ("ppc64: Implement a vDSO and use it for signal trampoline") notes that: > > ... symbols exposed by the vDSO aren't "normal" function symbols, apps > can't be expected

Re: [PATCH] powerpc: fix emulate_step std test

2020-03-17 Thread Michael Ellerman
On Wed, 2020-02-26 at 05:53:02 UTC, Nicholas Piggin wrote: > Signed-off-by: Nicholas Piggin Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/59ed2adf393109c56d383e568f2e57bb5ad6d901 cheers

Re: [PATCH] selftests: powerpc: Add tlbie_test in .gitignore

2020-03-17 Thread Michael Ellerman
On Fri, 2020-02-28 at 00:00:09 UTC, Christophe Leroy wrote: > The commit identified below added tlbie_test but > forgot to add it in .gitignore. > > Fixes: 93cad5f78995 ("selftests/powerpc: Add test case for tlbie vs mtpidr > ordering issue") > Cc: sta...@vger.kernel.org > Signed-off-by: Christop

Re: [PATCH] powerpc/64s/radix: Fix !SMP build

2020-03-17 Thread Michael Ellerman
On Mon, 2020-03-02 at 01:04:10 UTC, Nicholas Piggin wrote: > Signed-off-by: Nicholas Piggin Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/993cfecc59e57de237ae27fadc84ed24efa87a4d cheers

Re: [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier

2020-03-17 Thread Michael Ellerman
On Tue, 2020-03-03 at 08:56:04 UTC, YueHaibing wrote: > core99_l2_cache/core99_l3_cache no need to mark as volatile, > just remove it. > > Signed-off-by: YueHaibing Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/a4037d1f1fc4e92b69d7196d4568c33078d465ea cheers

Re: [PATCH] powerpc/32: Fix missing NULL pmd check in virt_to_kpte()

2020-03-17 Thread Michael Ellerman
On Sat, 2020-03-07 at 10:09:15 UTC, Christophe Leroy wrote: > Commit 2efc7c085f05 ("powerpc/32: drop get_pteptr()"), > replaced get_pteptr() by virt_to_kpte(). But virt_to_kpte() lacks a > NULL pmd check and returns an invalid non NULL pointer when there > is no page table. > > Reported-by: Nick D

[PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Srikar Dronamraju
Currently while allocating a slab for a offline node, we use its associated node_numa_mem to search for a partial slab. If we don't find a partial slab, we try allocating a slab from the offline node using __alloc_pages_node. However this is bound to fail. NIP [c039a300] __alloc_pages_node

[PATCH 0/4] Fix kmalloc_node on offline nodes

2020-03-17 Thread Srikar Dronamraju
Sachin recently reported that linux-next was no more bootable on few systems. https://lore.kernel.org/linux-next/3381cd91-ab3d-4773-ba04-e7a072a63...@linux.vnet.ibm.com/ # numactl -H available: 2 nodes (0-1) node 0 cpus: node 0 size: 0 MB node 0 free: 0 MB node 1 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12

[PATCH 3/4] mm: Implement reset_numa_mem

2020-03-17 Thread Srikar Dronamraju
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 API cannot be used for offline nodes. Hence all offline nodes will have their node_numa_mem set to 0. However syste

[PATCH 4/4] powerpc/numa: Set fallback nodes for offline nodes

2020-03-17 Thread Srikar Dronamraju
Currently fallback nodes for offline nodes aren't set. Hence by default node 0 ends up being the default node. However node 0 might be offline. Fix this by explicitly setting fallback node. Ensure first_memory_node is set before kernel does explicit setting of fallback node. Cc: Andrew Morton Cc

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

2020-03-17 Thread Srikar Dronamraju
Calling a kmalloc_node on a possible node which is not yet onlined can lead to panic. Currently node_present_pages() doesn't verify the node is online before accessing the pgdat for the node. However pgdat struct may not be available resulting in a crash. NIP [c03d55f4] ___slab_alloc+0x1f4

Re: [PATCH 08/12] docs: fix broken references to text files

2020-03-17 Thread Jason Gunthorpe
On Tue, Mar 17, 2020 at 02:10:47PM +0100, Mauro Carvalho Chehab wrote: > Several references got broken due to txt to ReST conversion. > > Several of them can be automatically fixed with: > > scripts/documentation-file-ref-check --fix > > Signed-off-by: Mauro Carvalho Chehab > Documentati

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Vlastimil Babka
On 3/17/20 2:17 PM, Srikar Dronamraju wrote: > Currently while allocating a slab for a offline node, we use its > associated node_numa_mem to search for a partial slab. If we don't find > a partial slab, we try allocating a slab from the offline node using > __alloc_pages_node. However this is boun

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

2020-03-17 Thread Srikar Dronamraju
* Srikar Dronamraju [2020-03-17 18:47:50]: > > Reported-by: Sachin Sant > Tested-by: Sachin Sant > Signed-off-by: Srikar Dronamraju > --- > include/linux/mmzone.h | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h >

Re: [PATCH 1/3] powerpc/numa: Set numa_node for all possible cpus

2020-03-17 Thread Vlastimil Babka
On 3/16/20 10:06 AM, Michal Hocko wrote: > On Thu 12-03-20 17:41:58, Vlastimil Babka wrote: > [...] >> with nid present in: >> N_POSSIBLE - pgdat might not exist, node_to_mem_node() must return some >> online > > I would rather have a dummy pgdat for those. Have a look at > $ git grep "NODE_DATA

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Srikar Dronamraju
* Vlastimil Babka [2020-03-17 14:34:25]: > On 3/17/20 2:17 PM, Srikar Dronamraju wrote: > > Currently while allocating a slab for a offline node, we use its > > associated node_numa_mem to search for a partial slab. If we don't find > > a partial slab, we try allocating a slab from the offline no

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Vlastimil Babka
On 3/17/20 2:45 PM, Srikar Dronamraju wrote: > * Vlastimil Babka [2020-03-17 14:34:25]: > >> On 3/17/20 2:17 PM, Srikar Dronamraju wrote: >> > Currently while allocating a slab for a offline node, we use its >> > associated node_numa_mem to search for a partial slab. If we don't find >> > a parti

Re: [PATCH 1/3] powerpc/numa: Set numa_node for all possible cpus

2020-03-17 Thread Michal Hocko
On Tue 17-03-20 14:44:45, Vlastimil Babka wrote: > On 3/16/20 10:06 AM, Michal Hocko wrote: > > On Thu 12-03-20 17:41:58, Vlastimil Babka wrote: > > [...] > >> with nid present in: > >> N_POSSIBLE - pgdat might not exist, node_to_mem_node() must return some > >> online > > > > I would rather have

Re: [PATCH v4 3/3] powerpc/powernv: Parse device tree, population of SPR support

2020-03-17 Thread Pratik Sampat
Thank you Michael for the review. On 17/03/20 8:43 am, Michael Ellerman wrote: Pratik Rajesh Sampat writes: Parse the device tree for nodes self-save, self-restore and populate support for the preferred SPRs based what was advertised by the device tree. These should be documented in: Docu

[PATCH v5 1/3] powerpc/powernv: Interface to define support and preference for a SPR

2020-03-17 Thread Pratik Rajesh Sampat
Define a bitmask interface to determine support for the Self Restore, Self Save or both. Also define an interface to determine the preference of that SPR to be strictly saved or restored or encapsulated with an order of preference. The preference bitmask is shown as below: ---

[PATCH v5 2/3] powerpc/powernv: Introduce Self save support

2020-03-17 Thread Pratik Rajesh Sampat
This commit introduces and leverages the Self save API which OPAL now supports. Add the new Self Save OPAL API call in the list of OPAL calls. Implement the self saving of the SPRs based on the support populated while respecting it's preferences. This implementation allows mixing of support for t

[PATCH v5 3/3] powerpc/powernv: Parse device tree, population of SPR support

2020-03-17 Thread Pratik Rajesh Sampat
Parse the device tree for nodes self-save, self-restore and populate support for the preferred SPRs based what was advertised by the device tree. Signed-off-by: Pratik Rajesh Sampat Reviewed-by: Ram Pai --- .../bindings/powerpc/opal/power-mgt.txt | 10 +++ arch/powerpc/platforms/powernv/i

[PATCH v5 0/3] Introduce Self-Save API for deep stop states

2020-03-17 Thread Pratik Rajesh Sampat
Skiboot patches v4: https://lists.ozlabs.org/pipermail/skiboot/2020-February/016404.html Linux patches v4: https://lkml.org/lkml/2020/2/12/446 Changelog v4 --> v5 Based on Michael Ellerman's comments, in patch3: 1. Added documentation in power-mgt.txt for self-save and self-restore 2. Used bitmap

Re: [PATCH 4/4] powerpc/numa: Set fallback nodes for offline nodes

2020-03-17 Thread Bharata B Rao
This patchset can also fix a related problem that I reported earlier at https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-March/206076.html with an additional change, suggested by Srikar as shown below: On Tue, Mar 17, 2020 at 06:47:53PM +0530, Srikar Dronamraju wrote: > Currently fallback node

Re:Re: [PATCH v3] powerpc/fsl-85xx: fix compile error

2020-03-17 Thread 王文虎
From: Michael Ellerman Date: 2020-03-17 19:22:13 To:"王文虎" cc: Benjamin Herrenschmidt ,Paul Mackerras ,Allison Randal ,Richard Fontana ,Greg Kroah-Hartman ,Thomas Gleixner ,linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org,triv...@kernel.org,ker...@vivo.com,stable Subject: Re: [PA

Re: [PATCH 4/4] powerpc/numa: Set fallback nodes for offline nodes

2020-03-17 Thread Srikar Dronamraju
* Bharata B Rao [2020-03-17 19:52:32]: Thanks Bharata. > This patchset can also fix a related problem that I reported earlier at > https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-March/206076.html > with an additional change, suggested by Srikar as shown below: > > > > > - for_each_onl

Re: [PATCH v1 46/46] powerpc/32s: Implement dedicated kasan_init_region()

2020-03-17 Thread Christophe Leroy
Le 16/03/2020 à 13:36, Christophe Leroy a écrit : Implement a kasan_init_region() dedicated to book3s/32 that allocates KASAN regions using BATs. Signed-off-by: Christophe Leroy Note that the sparse warning on pmac32_defconfig is definitely a false positive. See details patch 16/46 ("powe

Re: [PATCH 08/12] docs: fix broken references to text files

2020-03-17 Thread Mathieu Poirier
On Tue, Mar 17, 2020 at 02:10:47PM +0100, Mauro Carvalho Chehab wrote: > Several references got broken due to txt to ReST conversion. > > Several of them can be automatically fixed with: > > scripts/documentation-file-ref-check --fix > > Signed-off-by: Mauro Carvalho Chehab > --- > Docum

Re: [PATCH v1 16/46] powerpc/mm: Allocate static page tables for fixmap

2020-03-17 Thread Christophe Leroy
Le 16/03/2020 à 13:36, Christophe Leroy a écrit : Allocate static page tables for the fixmap area. This allows setting mappings through page tables before memblock is ready. That's needed to use early_ioremap() early and to use standard page mappings with fixmap. Signed-off-by: Christophe Ler

Re: [PATCH v1 39/46] powerpc/8xx: Add a function to early map kernel via huge pages

2020-03-17 Thread Christophe Leroy
note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/Use-hugepages-to-map-kernel-mem-on-8xx/20200317-0

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Srikar Dronamraju
* Vlastimil Babka [2020-03-17 14:53:26]: > >> > > >> > Mitigate this by allocating the new slab from the node_numa_mem. > >> > >> Are you sure this is really needed and the other 3 patches are not enough > >> for > >> the current SLUB code to work as needed? It seems you are changing the > >>

Re: [PATCH v5 09/11] perf/tools: Enhance JSON/metric infrastructure to handle "?"

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:31AM +0530, Kajol Jain wrote: SNIP > diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h > index 0938ad166ece..7786829b048b 100644 > --- a/tools/perf/util/expr.h > +++ b/tools/perf/util/expr.h > @@ -17,12 +17,13 @@ struct expr_parse_ctx { > > struct expr_

Re: [PATCH v5 09/11] perf/tools: Enhance JSON/metric infrastructure to handle "?"

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:31AM +0530, Kajol Jain wrote: SNIP > diff --git a/tools/perf/arch/powerpc/util/header.c > b/tools/perf/arch/powerpc/util/header.c > index 3b4cdfc5efd6..dcc3c6ab2e67 100644 > --- a/tools/perf/arch/powerpc/util/header.c > +++ b/tools/perf/arch/powerpc/util/header.c >

Re: [PATCH v5 08/11] perf/tools: Refactoring metricgroup__add_metric function

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:30AM +0530, Kajol Jain wrote: > This patch refactor metricgroup__add_metric function where > some part of it move to function metricgroup__add_metric_param. > No logic change. can't compile this change: [jolsa@krava perf]$ make JOBS=1 BUILD: Doing 'make -j1' para

Re: [PATCH v5 08/11] perf/tools: Refactoring metricgroup__add_metric function

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:30AM +0530, Kajol Jain wrote: > This patch refactor metricgroup__add_metric function where > some part of it move to function metricgroup__add_metric_param. > No logic change. > > Signed-off-by: Kajol Jain > --- > tools/perf/util/metricgroup.c | 63 +

Re: [PATCH v5 08/11] perf/tools: Refactoring metricgroup__add_metric function

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:30AM +0530, Kajol Jain wrote: > This patch refactor metricgroup__add_metric function where > some part of it move to function metricgroup__add_metric_param. > No logic change. > > Signed-off-by: Kajol Jain > --- > tools/perf/util/metricgroup.c | 63 +

Re: [PATCH v5 09/11] perf/tools: Enhance JSON/metric infrastructure to handle "?"

2020-03-17 Thread Jiri Olsa
On Tue, Mar 17, 2020 at 11:53:31AM +0530, Kajol Jain wrote: SBIP > +static int metricgroup__add_metric_runtime_param(struct strbuf *events, > + struct list_head *group_list, struct pmu_event *pe) > +{ > + int i, count; > + int ret = -EINVAL; > + > + count = arch_ge

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

2020-03-17 Thread Sachin Sant
> On 17-Mar-2020, at 6:38 PM, 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/Makefile.m

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Vlastimil Babka
On 3/17/20 3:51 PM, Srikar Dronamraju wrote: > * Vlastimil Babka [2020-03-17 14:53:26]: > >> >> > >> >> > Mitigate this by allocating the new slab from the node_numa_mem. >> >> >> >> Are you sure this is really needed and the other 3 patches are not enough >> >> for >> >> the current SLUB code

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

2020-03-17 Thread Stefan Berger
On 3/17/20 11:22 AM, Sachin Sant wrote: On 17-Mar-2020, at 6:38 PM, 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]: ***

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Vlastimil Babka
On 3/17/20 12:53 PM, Bharata B Rao wrote: > On Tue, Mar 17, 2020 at 02:56:28PM +0530, Bharata B Rao wrote: >> Case 1: 2 node NUMA, node0 empty >> >> # numactl -H >> available: 2 nodes (0-1) >> node 0 cpus: >> node 0 size: 0 MB >> node 0 free: 0 MB >> node 1 cpus: 0

Re: [PATCH v1 16/46] powerpc/mm: Allocate static page tables for fixmap

2020-03-17 Thread Luc Van Oostenryck
On Tue, Mar 17, 2020 at 03:38:46PM +0100, Christophe Leroy wrote: > > diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c > > index f62de06e3d07..9934659cb871 100644 > > --- a/arch/powerpc/mm/pgtable_32.c > > +++ b/arch/powerpc/mm/pgtable_32.c > > @@ -29,11 +29,27 @@ > > #inc

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Srikar Dronamraju
* Vlastimil Babka [2020-03-17 16:56:04]: > > I wonder why do you get a memory leak while Sachin in the same situation [1] > gets a crash? I don't understand anything anymore. Sachin was testing on linux-next which has Kirill's patch which modifies slub to use kmalloc_node instead of kmalloc. Wh

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

2020-03-17 Thread Vitaly Kuznetsov
David Hildenbrand writes: > 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 >

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

2020-03-17 Thread David Hildenbrand
On 17.03.20 17:29, Vitaly Kuznetsov wrote: > David Hildenbrand writes: > >> 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)

Re: [PATCH] mm/hugetlb: Fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

2020-03-17 Thread Mike Kravetz
On 3/17/20 1:43 AM, Christophe Leroy wrote: > > > Le 17/03/2020 à 09:25, Baoquan He a écrit : >> On 03/17/20 at 08:04am, Christophe Leroy wrote: >>> When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the >>> following build failure is encoutered: >> >> From the definition of HUGETLB_PAGE,

Re: [PATCH 2/4] mm/slub: Use mem_node to allocate a new slab

2020-03-17 Thread Srikar Dronamraju
* Vlastimil Babka [2020-03-17 14:34:25]: > > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -1970,14 +1970,8 @@ static void *get_partial(struct kmem_cache *s, gfp_t > > flags, int node, > > struct kmem_cache_cpu *c) > > { > > void *object; > > - int searchnode = node; > > > >

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Vlastimil Babka
On 3/17/20 5:25 PM, Srikar Dronamraju wrote: > * Vlastimil Babka [2020-03-17 16:56:04]: > >> >> I wonder why do you get a memory leak while Sachin in the same situation [1] >> gets a crash? I don't understand anything anymore. > > Sachin was testing on linux-next which has Kirill's patch which

Re: [PATCH] mm/hugetlb: Fix build failure with HUGETLB_PAGE but not HUGEBTLBFS

2020-03-17 Thread Christophe Leroy
Le 17/03/2020 à 17:40, Mike Kravetz a écrit : On 3/17/20 1:43 AM, Christophe Leroy wrote: Le 17/03/2020 à 09:25, Baoquan He a écrit : On 03/17/20 at 08:04am, Christophe Leroy wrote: When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the following build failure is encoutered: Fr

  1   2   >