Re: [PATCH v2 13/16] powerpc/watchpoint: Prepare handler to handle more than one watcnhpoint

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 08:13, 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. With more than one watchpoint, exception handler need to know w

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

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 08:13, 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. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/processor.h | 2 +- arch/powe

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

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 08:13, Ravi Bangoria a écrit : Instead of disabling only first watchpoint, disable all available watchpoints while clearing dawr_force_enable. Can you also explain why you change the function name ? Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/dawr.c | 10 ++

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

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 08:13, Ravi Bangoria a écrit : Instead of disabling only one watchpoint, 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(+), 8

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

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 08:12, 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

[PATCH v2 16/16] powerpc/watchpoint/xmon: Support 2nd dawr

2020-03-31 Thread Ravi Bangoria
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 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arc

[PATCH v2 15/16] powerpc/watchpoint/xmon: Don't allow breakpoint overwriting

2020-03-31 Thread Ravi Bangoria
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. Signed-off-by: Ravi Bangoria --- arch/powerpc/xmon/xmon.c | 4 1 file changed, 4 insertions(+) diff --git a

[PATCH v2 14/16] powerpc/watchpoint: Don't allow concurrent perf and ptrace events

2020-03-31 Thread Ravi Bangoria
With Book3s DAWR, ptrace and perf watchpoints on powerpc behaves differently. Ptrace watchpoint works in one-shot mode and generates signal before executing instruction. It's ptrace user's job to single-step the instruction and re-enable the watchpoint. OTOH, in case of perf watchpoint, kernel emul

[PATCH v2 13/16] powerpc/watchpoint: Prepare handler to handle more than one watcnhpoint

2020-03-31 Thread Ravi Bangoria
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. With more than one watchpoint, exception handler need to know which DAWR caused the exception, and hw currently doe

[PATCH v2 12/16] powerpc/watchpoint: Use builtin ALIGN*() macros

2020-03-31 Thread Ravi Bangoria
Currently we calculate hw aligned start and end addresses manually. Replace them with builtin ALIGN_DOWN() and ALIGN() macros. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 5 +++-- arch/powerpc/kernel/hw_breakpoint.c | 6 +++--- arch/powerpc/kernel/process.c

[PATCH v2 11/16] powerpc/watchpoint: Introduce is_ptrace_bp() function

2020-03-31 Thread Ravi Bangoria
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 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpo

[PATCH v2 10/16] powerpc/watchpoint: Use loop for thread_struct->ptrace_bps

2020-03-31 Thread Ravi Bangoria
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/kernel/process.c | 6 - arch/po

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

2020-03-31 Thread Ravi Bangoria
So far powerpc hw supported only one watchpoint. But Future Power architecture is introducing 2nd DAWR. Convert thread_struct->hw_brk into an array. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/processor.h | 2 +- arch/powerpc/kernel/process.c | 61 ++--

[PATCH v2 08/16] powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable

2020-03-31 Thread Ravi Bangoria
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 --git a/arch/powerpc/kernel/dawr.c b/arch/powerpc/ker

[PATCH v2 07/16] powerpc/watchpoint: Get watchpoint count dynamically while disabling them

2020-03-31 Thread Ravi Bangoria
Instead of disabling only one watchpoint, 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(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/h

[PATCH v2 06/16] powerpc/watchpoint: Provide DAWR number to __set_breakpoint

2020-03-31 Thread Ravi Bangoria
Introduce new parameter 'nr' to __set_breakpoint() which indicates which DAWR should be programed. Also convert current_brk variable to an array. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/debug.h | 2 +- arch/powerpc/include/asm/hw_breakpoint.h | 2 +- arch/powerpc/kern

[PATCH v2 05/16] powerpc/watchpoint: Provide DAWR number to set_dawr

2020-03-31 Thread Ravi Bangoria
Introduce new parameter 'nr' to set_dawr() which indicates which DAWR should be programed. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 4 ++-- arch/powerpc/kernel/dawr.c | 15 ++- arch/powerpc/kernel/process.c| 2 +- 3 files

[PATCH v2 04/16] powerpc/watchpoint/ptrace: Return actual num of available watchpoints

2020-03-31 Thread Ravi Bangoria
User can ask for num of available watchpoints(dbginfo.num_data_bps) using ptrace(PPC_PTRACE_GETHWDBGINFO). Return actual number of available watchpoints on the machine rather than hardcoded 1. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/ptrace/ptrace-noadv.c | 2 +- 1 file changed, 1 in

[PATCH v2 03/16] powerpc/watchpoint: Introduce function to get nr watchpoints dynamically

2020-03-31 Thread Ravi Bangoria
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 function for the same. Also convert HBP_NUM macro to

[PATCH v2 02/16] powerpc/watchpoint: Add SPRN macros for second DAWR

2020-03-31 Thread Ravi Bangoria
Future Power architecture is introducing second DAWR. Add SPRN_ macros for the same. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/reg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 156ee89fa9be..062e74cf4

[PATCH v2 01/16] powerpc/watchpoint: Rename current DAWR macros

2020-03-31 Thread Ravi Bangoria
Future Power architecture is introducing second DAWR. Use real register names from ISA for current macros: s/SPRN_DAWR/SPRN_DAWR0/ s/SPRN_DAWRX/SPRN_DAWRX0/ Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/reg.h | 4 ++-- arch/powerpc/kernel/dawr.c | 4 ++--

[PATCH v2 00/16] powerpc/watchpoint: Preparation for more than one watchpoint

2020-03-31 Thread Ravi Bangoria
So far, powerpc Book3S code has been written with an assumption of only one watchpoint. But future power architecture is introducing second watchpoint register (DAWR). Even though this patchset does not enable 2nd DAWR, it make the infrastructure ready so that enabling 2nd DAWR should just be a mat

Re: [PATCH v2 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-03-31 Thread Michal Simek
On 01. 04. 20 4:07, Michael Ellerman wrote: > Michal Simek writes: >> Hi, >> >> recently we wanted to update xilinx intc driver and we found that function >> which we wanted to remove is still wired by ancient Xilinx PowerPC >> platforms. Here is the thread about it. >> https://lore.kernel.org/lin

Re: [PATCH v7 7/7] powerpc/32: use set_memory_attr()

2020-03-31 Thread Christophe Leroy
Le 01/04/2020 à 04:27, Russell Currey a écrit : On Tue, 2020-03-31 at 11:56 +0200, Christophe Leroy wrote: Le 31/03/2020 à 06:48, Russell Currey a écrit : From: Christophe Leroy Use set_memory_attr() instead of the PPC32 specific change_page_attr() change_page_attr() was checking that th

Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)

2020-03-31 Thread Baoquan He
On 04/01/20 at 12:56am, Mike Rapoport wrote: > On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote: > > > > What would it take to make ia64 use HAVE_MEMBLOCK_NODE_MAP? I would > > really love to see that thing go away. It is causing problems when > > people try to use memblock api. > > W

Re: [PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-31 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > This patch implements support for papr_scm command > 'DSM_PAPR_SCM_HEALTH' that returns a newly introduced 'struct > nd_papr_scm_dimm_health_stat' instance containing dimm health > information back to user space in response to ND_CMD_CALL. This > functionality is implemente

Re: [PATCH v5 3/4] powerpc/papr_scm,uapi: Add support for handling PAPR DSM commands

2020-03-31 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Implement support for handling PAPR DSM commands in papr_scm > module. We advertise support for ND_CMD_CALL for the dimm command mask > and implement necessary scaffolding in the module to handle ND_CMD_CALL > ioctl and DSM commands that we receive. > > The layout of the DS

Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-03-31 Thread Ram Pai
On Tue, Mar 31, 2020 at 08:53:07PM -0300, Thiago Jung Bauermann wrote: > > Hi Ram, > > Ram Pai writes: > > > diff --git a/arch/powerpc/sysdev/xive/spapr.c > > b/arch/powerpc/sysdev/xive/spapr.c > > index 55dc61c..608b52f 100644 > > --- a/arch/powerpc/sysdev/xive/spapr.c > > +++ b/arch/powerpc/

Re: [PATCH v5 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-31 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Add PAPR-scm family of DSM command-set to the white list of NVDIMM > command sets. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Vaibhav Jain > --- > Changelog: > > v4..v5 : None > > v3..v4 : None > > v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] > > v1.

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-31 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit big-endian integers which are then stored in 'struct > papr_scm_priv' and subsequently partially exposed to user-space via > newly

Re: Emulate ppc64le builds on x86/x64 machine

2020-03-31 Thread Michael Ellerman
shivakanth k writes: > Hi , > Could you please help me to set up ppc64le 0n liunux machine There's some instructions here: https://github.com/linuxppc/wiki/wiki/Building-powerpc-kernels cheers

Re: [PATCH 0/2] selftests: vm: Build fixes for powerpc64

2020-03-31 Thread Michael Ellerman
Shuah Khan writes: > On 1/30/20 12:01 AM, Sandipan Das wrote: >> The second patch was already posted independently but because >> of the changes in the first patch, the second one now depends >> on it. Hence posting it now as a part of this series. >> >> The last version (v2) of the second patch

Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-03-31 Thread kbuild test robot
Hi Leonardo, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on paulus-powerpc/kvm-ppc-next linus/master linux/master v5.6 next-20200331] [if your patch is applied to the wrong git tree, please drop us a note to help improve the

[PATCH] powerpc/64/tm: Don't let userspace set regs->trap via sigreturn

2020-03-31 Thread Michael Ellerman
In restore_tm_sigcontexts() we take the trap value directly from the user sigcontext with no checking: err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]); This means we can be in the kernel with an arbitrary regs->trap value. Although that's not immediately problematic, there is a risk

Re: [PATCH v7 7/7] powerpc/32: use set_memory_attr()

2020-03-31 Thread Russell Currey
On Tue, 2020-03-31 at 11:56 +0200, Christophe Leroy wrote: > > Le 31/03/2020 à 06:48, Russell Currey a écrit : > > From: Christophe Leroy > > > > Use set_memory_attr() instead of the PPC32 specific > > change_page_attr() > > > > change_page_attr() was checking that the address was not mapped by

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Michael Ellerman
Christophe Leroy writes: > Le 31/03/2020 à 18:04, Arnd Bergmann a écrit : >> On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy >> wrote: >>> Le 31/03/2020 à 17:14, Arnd Bergmann a écrit : On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy wrote: > > Only 44x uses 4xx now, so only

Re: [PATCH v2 07/11] powerpc/xmon: Remove PPC403 and PPC405

2020-03-31 Thread Michael Ellerman
Arnd Bergmann writes: > On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy > wrote: >> >> xmon has special support for PPC403 and PPC405 which were part >> of 40x platforms. >> >> 40x platforms are gone, remove support of PPC403 and PPC405 in xmon. >> >> Signed-off-by: Christophe Leroy >> --- >>

Re: [PATCH v2 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-03-31 Thread Michael Ellerman
Michal Simek writes: > Hi, > > recently we wanted to update xilinx intc driver and we found that function > which we wanted to remove is still wired by ancient Xilinx PowerPC > platforms. Here is the thread about it. > https://lore.kernel.org/linux-next/48d3232d-0f1d-42ea-3109-f44bbabfa...@xilinx.

[PATCH] Fix "[v3, 12/32] powerpc/64s/exception: move KVM test to common code"

2020-03-31 Thread Nicholas Piggin
Moving KVM test to the common entry code missed the case of HMI and MCE, which do not do __GEN_COMMON_ENTRY (because they don't want to switch to virt mode). This means a MCE or HMI exception that is taken while KVM is running a guest context will not be switched out of that context, and KVM won't

[PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-03-31 Thread Leonardo Bras
During a crash, there is chance that the cpus that handle the NMI IPI are holding a spin_lock. If this spin_lock is needed by crashing_cpu it will cause a deadlock. (rtas.lock and printk logbuf_lock as of today) This is a problem if the system has kdump set up, given if it crashes for any reason k

Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-03-31 Thread Thiago Jung Bauermann
Hi Ram, Ram Pai writes: > diff --git a/arch/powerpc/sysdev/xive/spapr.c > b/arch/powerpc/sysdev/xive/spapr.c > index 55dc61c..608b52f 100644 > --- a/arch/powerpc/sysdev/xive/spapr.c > +++ b/arch/powerpc/sysdev/xive/spapr.c > @@ -26,6 +26,8 @@ > #include > #include > #include > +#include

[PATCH v2] powerpc: Add new HWCAP bits

2020-03-31 Thread Alistair Popple
Two new future architectural features requiring HWCAP bits are being developed. Once allocated in the kernel firmware can enable these via device tree cpu features. Signed-off-by: Alistair Popple --- v2: ISA v3.10 -> ISA v3.1 --- arch/powerpc/include/uapi/asm/cputable.h | 2 ++ 1 file changed,

Re: [PATCH] powerpc: Add new HWCAP bits

2020-03-31 Thread Alistair Popple
On Wednesday, 1 April 2020 9:47:03 AM AEDT Michael Neuling wrote: > On Tue, 2020-03-31 at 12:12 -0300, Tulio Magno Quites Machado Filho wrote: > > Alistair Popple writes: > > > diff --git a/arch/powerpc/include/uapi/asm/cputable.h > > > b/arch/powerpc/include/uapi/asm/cputable.h > > > index 540592

Re: [PATCH] powerpc: Add new HWCAP bits

2020-03-31 Thread Michael Neuling
On Tue, 2020-03-31 at 12:12 -0300, Tulio Magno Quites Machado Filho wrote: > Alistair Popple writes: > > > diff --git a/arch/powerpc/include/uapi/asm/cputable.h > > b/arch/powerpc/include/uapi/asm/cputable.h > > index 540592034740..c6fe10b2 100644 > > --- a/arch/powerpc/include/uapi/asm/cputa

[PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)

2020-03-31 Thread Mike Rapoport
On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote: > > What would it take to make ia64 use HAVE_MEMBLOCK_NODE_MAP? I would > really love to see that thing go away. It is causing problems when > people try to use memblock api. Well, it's a small patch in the end :) Currently all NUMA a

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Arnd Bergmann
On Tue, Mar 31, 2020 at 6:19 PM Christophe Leroy wrote: > Le 31/03/2020 à 18:04, Arnd Bergmann a écrit : > > That has the risk of breaking user's defconfig files, but given the > > small number of users, it may be nicer for consistency. In either > > case, the two symbols should probably hang arou

Re: [PATCH 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-03-31 Thread Segher Boessenkool
On Tue, Mar 31, 2020 at 08:56:23AM +0200, Christophe Leroy wrote: > While we are at it, can we also remove the 601 ? This one is also full > of workarounds and diverges a bit from other 6xx. > > I'm unable to find its end of life date, but it was on the market in > 1994, so I guess it must be ou

Re: [PATCH v2 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-31 Thread Naveen N. Rao
Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. The handling of TLF_NAPPING and TLF_SLEEPING is moved before the CONFIG_TRACE_IRQFLAGS which contains 'reenable_mmu' because from there kprobe w

Re: [PATCH] powerpc/44x: Make AKEBONO depends on NET

2020-03-31 Thread Christoph Hellwig
Why would a board select a network driver? That is what defconfig files are for! I thin kthe select should just go away.

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Christophe Leroy
Le 31/03/2020 à 18:04, Arnd Bergmann a écrit : On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy wrote: Le 31/03/2020 à 17:14, Arnd Bergmann a écrit : On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy wrote: Only 44x uses 4xx now, so only keep one directory. Signed-off-by: Christophe Lero

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Arnd Bergmann
On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy wrote: > Le 31/03/2020 à 17:14, Arnd Bergmann a écrit : > > On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy > > wrote: > >> > >> Only 44x uses 4xx now, so only keep one directory. > >> > >> Signed-off-by: Christophe Leroy > >> --- > >> arch/pow

[PATCH v2 12/12] powerpc/entry32: Blacklist exception exit points for kprobe.

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode. The very last part of exception exits cannot support a trap. Blacklist them from kprobe. While we are at it, remove exc_exit_start symbol which is not used to avoid having to blacklist it. Signed-off-by: Christophe Leroy Acked-by: Naveen N.

[PATCH v2 11/12] powerpc/entry32: Blacklist syscall exit points for kprobe.

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode. The very last part of syscall cannot support a trap. Add a symbol syscall_exit_finish to identify that part and blacklist it from kprobe. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/kernel/entry_32.S | 3 +++ 1

[PATCH v2 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. The handling of TLF_NAPPING and TLF_SLEEPING is moved before the CONFIG_TRACE_IRQFLAGS which contains 'reenable_mmu' because from there kprobe will be possible as the ker

[PATCH v2 09/12] powerpc/32: Blacklist functions running with MMU disabled for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/kernel/cpu_setup_6xx.S | 2 ++ arch/powerpc/kernel/entry_32.S | 3 +++ arch/powerpc/kernel/fpu.S

[PATCH v2 08/12] powerpc/rtas: Remove machine_check_in_rtas()

2020-03-31 Thread Christophe Leroy
machine_check_in_rtas() is just a trap. Do the trap directly in the machine check exception handler. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/kernel/entry_32.S | 6 -- arch/powerpc/kernel/head_32.S | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) di

[PATCH v2 07/12] powerpc/32s: Blacklist functions running with MMU disabled for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/mm/book3s32/hash_low.S | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/mm/book3s3

[PATCH v2 06/12] powerpc/32s: Make local symbols non visible in hash_low.

2020-03-31 Thread Christophe Leroy
In hash_low.S, a lot of named local symbols are used instead of numbers to ease code readability. However, they don't need to be visible. In order to ease blacklisting of functions running with MMU disabled for kprobe, rename the symbols to .Lsymbols in order to hide them as if they were numbered

[PATCH v2 05/12] powerpc/mem: Blacklist flush_dcache_icache_phys() for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/mm/mem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/m

[PATCH v2 04/12] powerpc/powermac: Blacklist functions running with MMU disabled for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/platforms/powermac/cache.S | 2 ++ arch/powerpc/platforms/powermac/sleep.S | 5 - 2 files changed, 6

[PATCH v2 03/12] powerpc/83xx: Blacklist mpc83xx_deep_resume() for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/platforms/83xx/suspend-asm.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/

[PATCH v2 02/12] powerpc/82xx: Blacklist pq2_restart() for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/platforms/82xx/pq2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/82xx/

[PATCH v2 01/12] powerpc/52xx: Blacklist functions running with MMU disabled for kprobe

2020-03-31 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- arch/powerpc/platforms/52xx/lite5200_sleep.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platf

Re: [PATCH v2] macintosh: convert to i2c_new_scanned_device

2020-03-31 Thread Wolfram Sang
On Thu, Mar 26, 2020 at 12:38:19PM +0100, Wolfram Sang wrote: > Move from the deprecated i2c_new_probed_device() to the new > i2c_new_scanned_device(). No functional change for this driver because > it doesn't check the return code anyhow. > > Signed-off-by: Wolfram Sang > Acked-by: Michael Eller

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Christophe Leroy
Le 31/03/2020 à 17:14, Arnd Bergmann a écrit : On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy wrote: Only 44x uses 4xx now, so only keep one directory. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/44x/Makefile | 9 +++- arch/powerpc/platforms/{4xx => 44x}

[RFC WIP PATCH] powerpc/32: system call implement entry/exit logic in C

2020-03-31 Thread Christophe Leroy
That's first try to port PPC64 syscall entry/exit logic in C to PPC32. I've do the minimum to get it work. I have not reworked calls to sys_fork() and friends for instance. For the time being, it seems to work more or less but: - ping reports EINVAL on recvfrom - strace shows NULL instead of strin

Re: [PATCH] powerpc: Add new HWCAP bits

2020-03-31 Thread Tulio Magno Quites Machado Filho
Alistair Popple writes: > diff --git a/arch/powerpc/include/uapi/asm/cputable.h > b/arch/powerpc/include/uapi/asm/cputable.h > index 540592034740..c6fe10b2 100644 > --- a/arch/powerpc/include/uapi/asm/cputable.h > +++ b/arch/powerpc/include/uapi/asm/cputable.h > @@ -50,6 +50,8 @@ > #define

Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x

2020-03-31 Thread Arnd Bergmann
On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy wrote: > > Only 44x uses 4xx now, so only keep one directory. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/platforms/44x/Makefile | 9 +++- > arch/powerpc/platforms/{4xx => 44x}/cpm.c | 0 No objections to moving ev

Re: [PATCH v2 07/11] powerpc/xmon: Remove PPC403 and PPC405

2020-03-31 Thread Arnd Bergmann
On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy wrote: > > xmon has special support for PPC403 and PPC405 which were part > of 40x platforms. > > 40x platforms are gone, remove support of PPC403 and PPC405 in xmon. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/xmon/ppc-opc.c | 277 ++

Re: [PATCH 0/2] selftests: vm: Build fixes for powerpc64

2020-03-31 Thread Shuah Khan
On 1/30/20 12:01 AM, Sandipan Das wrote: The second patch was already posted independently but because of the changes in the first patch, the second one now depends on it. Hence posting it now as a part of this series. The last version (v2) of the second patch can be found at: https://patchwork.

[PATCH v5 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-31 Thread Vaibhav Jain
Implement support for handling PAPR DSM commands in papr_scm module. We advertise support for ND_CMD_CALL for the dimm command mask and implement necessary scaffolding in the module to handle ND_CMD_CALL ioctl and DSM commands that we receive. The layout of the DSM commands as we expect from libnv

[PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-31 Thread Vaibhav Jain
This patch implements support for papr_scm command 'DSM_PAPR_SCM_HEALTH' that returns a newly introduced 'struct nd_papr_scm_dimm_health_stat' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_scm_ge

[PATCH v5 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-31 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- Changelog: v4..v5 : None v3..v4 : None v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] v1..v2 : None --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+

[PATCH v5 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-31 Thread Vaibhav Jain
The PAPR standard[1][3] provides mechanisms to query the health and performance stats of an NVDIMM via various hcalls as described in Ref[2]. Until now these stats were never available nor exposed to the user-space tools like 'ndctl'. This is partly due to PAPR platform not having support for ACPI

[PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-31 Thread Vaibhav Jain
Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit big-endian integers which are then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attribu

Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2020-03-31 Thread Baoquan He
On 03/31/20 at 04:21pm, Michal Hocko wrote: > On Tue 31-03-20 22:03:32, Baoquan He wrote: > > Hi Michal, > > > > On 03/31/20 at 10:55am, Michal Hocko wrote: > > > On Tue 31-03-20 11:14:23, Mike Rapoport wrote: > > > > Maybe I mis-read the code, but I don't see how this could happen. In the > > > >

Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2020-03-31 Thread Michal Hocko
On Tue 31-03-20 22:03:32, Baoquan He wrote: > Hi Michal, > > On 03/31/20 at 10:55am, Michal Hocko wrote: > > On Tue 31-03-20 11:14:23, Mike Rapoport wrote: > > > Maybe I mis-read the code, but I don't see how this could happen. In the > > > HAVE_MEMBLOCK_NODE_MAP=y case, free_area_init_node() call

Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2020-03-31 Thread Baoquan He
Hi Michal, On 03/31/20 at 10:55am, Michal Hocko wrote: > On Tue 31-03-20 11:14:23, Mike Rapoport wrote: > > Maybe I mis-read the code, but I don't see how this could happen. In the > > HAVE_MEMBLOCK_NODE_MAP=y case, free_area_init_node() calls > > calculate_node_totalpages() that ensures that node

[PATCH v2] powerpc/perf: Add documentation around use of "ppc_set_pmu_inuse" in PMU core-book3s

2020-03-31 Thread Athira Rajeev
From: Madhavan Srinivasan "pmcregs_in_use" flag is part of lppaca (Virtual Process Area), which is used to indicate whether Performance Monitoring Unit (PMU) and PMU sprs are in-use and whether should it be saved/restored by hypervisor. ppc_set_pmu_inuse() is used to set/unset the VPA flag "pmcre

Re: [PATCH] powerpc/perf: Add documentation around use of "ppc_set_pmu_inuse" in PMU core-book3s

2020-03-31 Thread Athira Rajeev
Hi, Please ignore this version as I messed up with the author information. I am sending a V2 with the proper author name. Thanks Athira > On 30-Mar-2020, at 5:08 PM, Athira Rajeev wrote: > > "pmcregs_in_use" flag is part of lppaca (Virtual Process Area), > which is used to indicate whether P

Re: [PATCH V2 0/3] mm/debug: Add more arch page table helper tests

2020-03-31 Thread Gerald Schaefer
On Tue, 24 Mar 2020 10:52:52 +0530 Anshuman Khandual wrote: > This series adds more arch page table helper tests. The new tests here are > either related to core memory functions and advanced arch pgtable helpers. > This also creates a documentation file enlisting all expected semantics as > sugg

Re: [RFC/PATCH 0/3] Add support for stop instruction inside KVM guest

2020-03-31 Thread Gautham R Shenoy
On Tue, Mar 31, 2020 at 05:40:55PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > > *** RFC Only. Not intended for inclusion > > Motivation > ~~~ > > The POWER ISA v3.0 allows stop instruction to be executed from a Guest > Kernel (HV=0,PR=0) context.

[RFC/PATCH 3/3] cpuidle/pseries: Add stop0lite state

2020-03-31 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The POWER ISA v3.0 allows stop instruction to be executed from a HV=0,PR=0 context. If the PSSCR[ESL|EC] bits are cleared, then the stop instruction thus executed will cause the thread to pause, thereby donating its cycles to the other threads in the core until the pause

[RFC/PATCH 0/3] Add support for stop instruction inside KVM guest

2020-03-31 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" *** RFC Only. Not intended for inclusion Motivation ~~~ The POWER ISA v3.0 allows stop instruction to be executed from a Guest Kernel (HV=0,PR=0) context. If the hypervisor has cleared PSSCR[ESL|EC] bits, then the stop instruction thus execu

[RFC/PATCH 2/3] pseries/kvm: Clear PSSCR[ESL|EC] bits before guest entry

2020-03-31 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" ISA v3.0 allows the guest to execute a stop instruction. For this, the PSSCR[ESL|EC] bits need to be cleared by the hypervisor before scheduling in the guest vCPU. Currently we always schedule in a vCPU with PSSCR[ESL|EC] bits set. This patch changes the behaviour to en

[RFC/PATCH 1/3] powerpc/kvm: Handle H_FAC_UNAVAIL when guest executes stop.

2020-03-31 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" If a guest executes a stop instruction when the hypervisor has set the PSSCR[ESL|EC] bits, the processor will throw an Hypervisor Facility Unavailable exception. Currently when we receive this exception, we only check if the exeception is generated due to a doorbell inst

Re: [PATCH v2 2/2] powerpc: Remove Xilinx PPC405/PPC440 support

2020-03-31 Thread Bartlomiej Zolnierkiewicz
On 3/30/20 3:32 PM, Michal Simek wrote: > The latest Xilinx design tools called ISE and EDK has been released in > October 2013. New tool doesn't support any PPC405/PPC440 new designs. > These platforms are no longer supported and tested. > > PowerPC 405/440 port is orphan from 2013 by > commit

[PATCH v4 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-03-31 Thread Vaibhav Jain
This patch implements support for papr_scm command 'DSM_PAPR_SCM_HEALTH' that returns a newly introduced 'struct nd_papr_scm_dimm_health_stat' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_scm_ge

[PATCH v4 3/4] powerpc/papr_scm, uapi: Add support for handling PAPR DSM commands

2020-03-31 Thread Vaibhav Jain
Implement support for handling PAPR DSM commands in papr_scm module. We advertise support for ND_CMD_CALL for the dimm command mask and implement necessary scaffolding in the module to handle ND_CMD_CALL ioctl and DSM commands that we receive. The layout of the DSM commands as we expect from libnv

[PATCH v4 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-31 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- Changelog: v3..v4 : None v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] v1..v2 : None --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH v4 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-31 Thread Vaibhav Jain
Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit big-endian integers which are then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attribu

[PATCH v4 0/4] powerpc/papr_scm: Add support for reporting nvdimm health

2020-03-31 Thread Vaibhav Jain
The PAPR standard[1][3] provides mechanisms to query the health and performance stats of an NVDIMM via various hcalls as described in Ref[2]. Until now these stats were never available nor exposed to the user-space tools like 'ndctl'. This is partly due to PAPR platform not having support for ACPI

Re: [PATCH 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-03-31 Thread Christophe Leroy
Le 31/03/2020 à 12:04, Michal Simek a écrit : On 31. 03. 20 11:49, Christophe Leroy wrote: Le 31/03/2020 à 09:19, Christophe Leroy a écrit : Le 31/03/2020 à 08:59, Michal Simek a écrit : On 31. 03. 20 8:56, Christophe Leroy wrote: Le 31/03/2020 à 07:30, Michael Ellerman a écrit : Ch

Re: [PATCH 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-03-31 Thread Michal Simek
On 31. 03. 20 11:49, Christophe Leroy wrote: > > > Le 31/03/2020 à 09:19, Christophe Leroy a écrit : >> >> >> Le 31/03/2020 à 08:59, Michal Simek a écrit : >>> On 31. 03. 20 8:56, Christophe Leroy wrote: Le 31/03/2020 à 07:30, Michael Ellerman a écrit : > Christophe Leroy writ

[PATCH v19 24/24] selftests: vm: pkeys: Fix multilib builds for x86

2020-03-31 Thread Sandipan Das
This ensures that both 32-bit and 64-bit binaries are generated when this is built on a x86_64 system. Most of the changes have been borrowed from tools/testing/selftests/x86/Makefile. Signed-off-by: Sandipan Das Acked-by: Dave Hansen Tested-by: Dave Hansen --- tools/testing/selftests/vm/Makef

[PATCH v19 23/24] selftests: vm: pkeys: Use the correct page size on powerpc

2020-03-31 Thread Sandipan Das
Both 4K and 64K pages are supported on powerpc. Parts of the selftest code perform alignment computations based on the PAGE_SIZE macro which is currently hardcoded to 64K for powerpc. This causes some test failures on kernels configured with 4K page size. In some cases, we need to enforce function

[PATCH v19 22/24] selftests/vm/pkeys: Override access right definitions on powerpc

2020-03-31 Thread Sandipan Das
From: Ram Pai Some platforms hardcode the x86 values for PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE such as those in: /usr/include/bits/mman-shared.h. This overrides the definitions with correct values for powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: San

[PATCH v19 21/24] selftests/vm/pkeys: Test correct behaviour of pkey-0

2020-03-31 Thread Sandipan Das
From: Ram Pai Ensure that pkey-0 is allocated on start and that it can be attached dynamically in various modes, without failures. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Acked-by: Dave Hansen --- tools/testing/selftests/vm/protection_keys.c |

[PATCH v19 20/24] selftests/vm/pkeys: Introduce a sub-page allocator

2020-03-31 Thread Sandipan Das
From: Ram Pai This introduces a new allocator that allocates 4K hardware pages to back 64K linux pages. This allocator is available only on powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Acked-by: Dave Hans

[PATCH v19 19/24] selftests/vm/pkeys: Detect write violation on a mapped access-denied-key page

2020-03-31 Thread Sandipan Das
From: Ram Pai Detect write-violation on a page to which access-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 13 +++

  1   2   >