[PATCH v4] powerpc: Replace setup_irq() by request_irq()

2020-03-11 Thread afzal mohammed
request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). [1] https://lk

Re: [PATCH v4 6/8] perf/tools: Enhance JSON/metric infrastructure to handle "?"

2020-03-11 Thread kajoljain
On 3/11/20 12:04 AM, Arnaldo Carvalho de Melo wrote: > Em Mon, Mar 09, 2020 at 11:55:50AM +0530, Kajol Jain escreveu: >> Patch enhances current metric infrastructure to handle "?" in the metric >> expression. The "?" can be use for parameters whose value not known while >> creating metric events

Re: [PATCH] powerpc/pseries: fix of_read_drc_info_cell() to point at next record

2020-03-11 Thread Michael Ellerman
Tyrel Datwyler writes: > On 3/10/20 10:25 AM, Nathan Lynch wrote: >> Tyrel Datwyler writes: >>> The expectation is that when calling of_read_drc_info_cell() >>> repeatedly to parse multiple drc-info records that the in/out curval >>> parameter points at the start of the next record on return. How

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

2020-03-11 Thread Srikar Dronamraju
* Michal Hocko [2020-03-11 12:57:35]: > On Wed 11-03-20 16:32:35, Srikar Dronamraju wrote: > > A Powerpc system with multiple possible nodes and with CONFIG_NUMA > > enabled always used to have a node 0, even if node 0 does not any cpus > > or memory attached to it. As per PAPR, node affinity of

Re: [RFC PATCH v1] pseries/drmem: don't cache node id in drmem_lmb struct

2020-03-11 Thread Michal Suchánek
On Wed, Mar 11, 2020 at 06:08:15PM -0500, Scott Cheloha wrote: > At memory hot-remove time we can retrieve an LMB's nid from its > corresponding memory_block. There is no need to store the nid > in multiple locations. > > Signed-off-by: Scott Cheloha > --- > The linear search in powerpc's memory

Re: [PATCH v3 23/27] powerpc/powernv/pmem: Add debug IOCTLs

2020-03-11 Thread Alastair D'Silva
On Thu, 2020-03-05 at 14:11 +1100, Andrew Donnellan wrote: > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > These IOCTLs provide low level access to the card to aid in > > debugging > > controller/FPGA firmware. > > > > Signed-off-by: Alastair D'Silva > > --- > >

Re: [PATCH v3 19/27] powerpc/powernv/pmem: Add an IOCTL to report controller statistics

2020-03-11 Thread Alastair D'Silva
On Thu, 2020-03-05 at 11:46 +1100, Andrew Donnellan wrote: > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > The controller can report a number of statistics that are useful > > in evaluating the performance and reliability of the card. > > > > This patch exposes t

Re: [PATCH v3 23/27] powerpc/powernv/pmem: Add debug IOCTLs

2020-03-11 Thread Alastair D'Silva
On Wed, 2020-03-04 at 16:21 +0100, Frederic Barrat wrote: > > Le 21/02/2020 à 04:27, Alastair D'Silva a écrit : > > From: Alastair D'Silva > > > > These IOCTLs provide low level access to the card to aid in > > debugging > > controller/FPGA firmware. > > > > Signed-off-by: Alastair D'Silva > >

Re: [PATCH v4 1/5] mm/memremap_pages: Introduce memremap_compat_align()

2020-03-11 Thread Michael Ellerman
Dan Williams writes: > The "sub-section memory hotplug" facility allows memremap_pages() users > like libnvdimm to compensate for hardware platforms like x86 that have a > section size larger than their hardware memory mapping granularity. The > compensation that sub-section support affords is be

Re: [PATCH v3 19/27] powerpc/powernv/pmem: Add an IOCTL to report controller statistics

2020-03-11 Thread Alastair D'Silva
On Wed, 2020-03-04 at 10:25 +0100, Frederic Barrat wrote: > > Le 21/02/2020 à 04:27, Alastair D'Silva a écrit : > > From: Alastair D'Silva > > > > The controller can report a number of statistics that are useful > > in evaluating the performance and reliability of the card. > > > > This patch e

[RFC PATCH v1] pseries/drmem: don't cache node id in drmem_lmb struct

2020-03-11 Thread Scott Cheloha
At memory hot-remove time we can retrieve an LMB's nid from its corresponding memory_block. There is no need to store the nid in multiple locations. Signed-off-by: Scott Cheloha --- The linear search in powerpc's memory_add_physaddr_to_nid() has become a bottleneck at boot on systems with many L

Re: [PATCH v3] ima: add a new CONFIG for loading arch-specific policies

2020-03-11 Thread Philipp Rudo
On Sun, 8 Mar 2020 20:57:51 -0400 Nayna Jain wrote: > From: Nayna Jain > > Every time a new architecture defines the IMA architecture specific > functions - arch_ima_get_secureboot() and arch_ima_get_policy(), the IMA > include file needs to be updated. To avoid this "noise", this patch > defi

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
On 11.03.20 17:55, Vitaly Kuznetsov wrote: > David Hildenbrand writes: > >> 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 mem

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

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

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

2020-03-11 Thread Ravi Bangoria
Hi Kim, On 3/6/20 3:36 AM, Kim Phillips wrote: On 3/3/20 3:55 AM, Kim Phillips wrote: On 3/2/20 2:21 PM, Stephane Eranian wrote: On Mon, Mar 2, 2020 at 2:13 AM Peter Zijlstra wrote: On Mon, Mar 02, 2020 at 10:53:44AM +0530, Ravi Bangoria wrote: Modern processors export such hazard data in

Re: [PATCH v3] ima: add a new CONFIG for loading arch-specific policies

2020-03-11 Thread Mimi Zohar
On Sun, 2020-03-08 at 20:57 -0400, Nayna Jain wrote: > From: Nayna Jain > > Every time a new architecture defines the IMA architecture specific > functions - arch_ima_get_secureboot() and arch_ima_get_policy(), the IMA > include file needs to be updated. To avoid this "noise", this patch > define

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
On 11.03.20 15:26, Wei Yang wrote: > On Wed, Mar 11, 2020 at 01:30:26PM +0100, 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 >>

Re: [PATCH] hwmon: (ibmpowernv) Use scnprintf() for avoiding potential buffer overflow

2020-03-11 Thread Guenter Roeck
On Wed, Mar 11, 2020 at 08:39:44AM +0100, Takashi Iwai wrote: > Since snprintf() returns the would-be-output size instead of the > actual output size, the succeeding calls may go beyond the given > buffer limit. Fix it by replacing with scnprintf(). > > Signed-off-by: Takashi Iwai Applied to hw

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

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 02:20:02PM +, Wei Yang wrote: >On Wed, Mar 11, 2020 at 01:30:24PM +0100, David Hildenbrand wrote: >>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. >> >>Cc: Greg Kroah-Hartman >>Cc: Andrew

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 01:30:26PM +0100, 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_MOVABL

Re: [PATCH v1 4/5] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 01:30:25PM +0100, David Hildenbrand wrote: >... and rename it to memhp_default_online_type. This is a preparation >for more detailed default online behavior. > >Cc: Greg Kroah-Hartman >Cc: Andrew Morton >Cc: Michal Hocko >Cc: Oscar Salvador >Cc: "Rafael J. Wysocki" >Cc:

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

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 01:30:24PM +0100, David Hildenbrand wrote: >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. > >Cc: Greg Kroah-Hartman >Cc: Andrew Morton >Cc: Michal Hocko >Cc: Oscar Salvador >Cc: "Rafael J.

Re: [PATCH v1 2/5] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 01:30:23PM +0100, David Hildenbrand wrote: >I have no idea why we have to start at -1. Just treat 0 as the special >case. 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 no

Re: [PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-11 Thread Wei Yang
On Wed, Mar 11, 2020 at 01:30:22PM +0100, David Hildenbrand wrote: >The name is misleading. Let's just name it like the online_type name we >expose to user space ("online"). > >Add some documentation to the types. > >Cc: Greg Kroah-Hartman >Cc: Andrew Morton >Cc: Michal Hocko >Cc: Oscar Salvador

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

2020-03-11 Thread 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. This patch adds an interface to sysfs to control that behavior, if possible. Signed-of

[PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 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

[PATCH v1 4/5] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-11 Thread David Hildenbrand
... and rename it to memhp_default_online_type. This is a preparation for more detailed default online behavior. Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Cc: Benjamin Herrenschmidt Cc: Paul Mackerras C

[PATCH v1 0/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 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 v1 2/5] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-11 Thread David Hildenbrand
I have no idea why we have to start at -1. Just treat 0 as the special case. 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 is a preparation to use the online_type as

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

2020-03-11 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. 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 Hildenbrand

[PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-11 Thread David Hildenbrand
The name is misleading. Let's just name it like the online_type name we expose to user space ("online"). Add some documentation to the types. 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: Davi

[PATCH 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-03-11 Thread Srikar Dronamraju
Currently Linux kernel with CONFIG_NUMA on a system with multiple possible nodes, marks node 0 as online at boot. However in practice, there are systems which have node 0 as memoryless and cpuless. This can cause numa_balancing to be enabled on systems with only one node with memory and CPUs. The

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

2020-03-11 Thread Michal Hocko
On Wed 11-03-20 16:32:35, Srikar Dronamraju wrote: > A Powerpc system with multiple possible nodes and with CONFIG_NUMA > enabled always used to have a node 0, even if node 0 does not any cpus > or memory attached to it. As per PAPR, node affinity of a cpu is only > available once its present / onl

[PATCH 2/3] powerpc/numa: Prefer node id queried from vphn

2020-03-11 Thread Srikar Dronamraju
Node id queried from the static device tree may not be correct. For example: it may always show 0 on a shared processor. Hence prefer the node id queried from vphn and fallback on the device tree based node id if vphn query fails. Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@kvack.org Cc: linux-

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

2020-03-11 Thread Srikar Dronamraju
A Powerpc system with multiple possible nodes and with CONFIG_NUMA enabled always used to have a node 0, even if node 0 does not any cpus or memory attached to it. As per PAPR, node affinity of a cpu is only available once its present / online. For all cpus that are possible but not present, cpu_to

[PATCH 0/3] Offline memoryless cpuless node 0

2020-03-11 Thread Srikar Dronamraju
Linux kernel configured with CONFIG_NUMA on a system with multiple possible nodes, marks node 0 as online at boot. However in practice, there are systems which have node 0 as memoryless and cpuless. This can cause 1. numa_balancing to be enabled on systems with only one online node. 2. Existence o

[PATCH v2] powerpc test_emulate_step: fix DS operand in ld encoding to appropriate value

2020-03-11 Thread Balamuruhan S
ld instruction should have 14 bit immediate field (DS) concatenated with 0b00 on the right, encode it accordingly. Introduce macro `IMM_DS()` to encode DS form instructions with 14 bit immediate field. Fixes: 4ceae137bdab ("powerpc: emulate_step() tests for load/store instructions") Reviewed-by:

[PATCH v3 6/6] pseries/sysfs: Minimise IPI noise while reading [idle_][s]purr

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently purr, spurr, idle_purr, idle_spurr are exposed for every CPU via the sysfs interface /sys/devices/system/cpu/cpuX/[idle_][s]purr. Each sysfs read currently generates an IPI to obtain the desired value from the target CPU X. Since these aforementioned sysfs file

[PATCH v3 0/6] Track and expose idle PURR and SPURR ticks

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the third version of the patches to track and expose idle PURR and SPURR ticks. These patches are required by tools such as lparstat to compute system utilization for capacity planning purposes. The previous versions can be found here: v2: https://lkml.org/

[PATCH v3 1/6] powerpc: Move idle_loop_prolog()/epilog() functions to header file

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently prior to entering an idle state on a Linux Guest, the pseries cpuidle driver implement an idle_loop_prolog() and idle_loop_epilog() functions which ensure that idle_purr is correctly computed, and the hypervisor is informed that the CPU cycles have been donated

[PATCH v3 5/6] Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Add documentation for the following sysfs interfaces: /sys/devices/system/cpu/cpuX/purr /sys/devices/system/cpu/cpuX/spurr /sys/devices/system/cpu/cpuX/idle_purr /sys/devices/system/cpu/cpuX/idle_spurr Signed-off-by: Gautham R. Shenoy --- Documentation/ABI/testing/sys

[PATCH v3 3/6] powerpc/pseries: Account for SPURR ticks on idle CPUs

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. Via pseries_idle_prolog(), pseries_idle_epilog(), we track the idle PURR ticks in the VPA variable "wait_state_cycles". This patch extends the support to accou

[PATCH v3 2/6] powerpc/idle: Add accessor function to always read latest idle PURR

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently when CPU goes idle, we take a snapshot of PURR via pseries_idle_prolog() which is used at the CPU idle exit to compute the idle PURR cycles via the function pseries_idle_epilog(). Thus, the value of idle PURR cycle thus read before pseries_idle_prolog() and af

[PATCH v3 4/6] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-03-11 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. The total PURR and SPURR ticks are already exposed via the per-cpu sysfs files "purr" and "spurr". This patch adds support for exposing the idle PURR and SPURR

[PATCH V16] mm/debug: Add tests validating architecture page table helpers

2020-03-11 Thread Anshuman Khandual
This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or addition of new ones. This test covers basic page table entry

Re: [PATCH -next 017/491] CELL BROADBAND ENGINE ARCHITECTURE: Use fallthrough;

2020-03-11 Thread Arnd Bergmann
On Wed, Mar 11, 2020 at 6:07 AM Joe Perches wrote: > > Convert the various uses of fallthrough comments to fallthrough; > > Done via script > Link: > https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ > > Signed-off-by: Joe Perches Acked-by: Arnd Bergm

[PATCH] hwmon: (ibmpowernv) Use scnprintf() for avoiding potential buffer overflow

2020-03-11 Thread Takashi Iwai
Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai --- drivers/hwmon/ibmpowernv.c | 8 1 file changed, 4 insertions(+), 4 delet

Re: [PATCH 1/2] powerpc test_emulate_step: fix DS operand in ld encoding to appropriate value

2020-03-11 Thread Balamuruhan S
On Wed, 2020-03-11 at 08:01 +0100, Christophe Leroy wrote: > > Le 11/03/2020 à 07:14, Balamuruhan S a écrit : > > ld instruction should have 14 bit immediate field (DS) concatenated > > with > > 0b00 on the right, encode it accordingly. > > > > Fixes: 4ceae137bdab ("powerpc: emulate_step() tests

Re: [PATCH 1/2] powerpc test_emulate_step: fix DS operand in ld encoding to appropriate value

2020-03-11 Thread Christophe Leroy
Le 11/03/2020 à 07:14, Balamuruhan S a écrit : ld instruction should have 14 bit immediate field (DS) concatenated with 0b00 on the right, encode it accordingly. Fixes: 4ceae137bdab ("powerpc: emulate_step() tests for load/store instructions") Reviewed-by: Sandipan Das Signed-off-by: Balamu