[PATCH v2] powerpc: Make setjmp/longjmp signature standard

2020-03-30 Thread Clement Courbet
Declaring setjmp()/longjmp() as taking longs makes the signature non-standard, and makes clang complain. In the past, this has been worked around by adding -ffreestanding to the compile flags. The implementation looks like it only ever propagates the value (in longjmp) or sets it to 1 (in setjmp),

[PATCH] powerpc/mce: Add MCE notification chain

2020-03-30 Thread Ganesh Goudar
From: Santosh S Introduce notification chain which lets know about uncorrected memory errors(UE). This would help prospective users in pmem or nvdimm subsystem to track bad blocks for better handling of persistent memory allocations. Signed-off-by: Santosh S Signed-off-by: Ganesh Goudar --- a

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

2020-03-30 Thread Michal Hocko
On Sat 28-03-20 11:31:17, Hoan Tran wrote: > In NUMA layout which nodes have memory ranges that span across other nodes, > the mm driver can detect the memory node id incorrectly. > > For example, with layout below > Node 0 address: > Node 1 address: > > No

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

2020-03-30 Thread Michal Hocko
On Sun 29-03-20 08:19:24, Baoquan He wrote: > On 03/28/20 at 11:31am, Hoan Tran wrote: > > In NUMA layout which nodes have memory ranges that span across other nodes, > > the mm driver can detect the memory node id incorrectly. > > > > For example, with layout below > > Node 0 address: 0

Re: linux-next: build failure after merge of the tip tree

2020-03-30 Thread Borislav Petkov
On Mon, Mar 30, 2020 at 03:08:19PM +1100, Stephen Rothwell wrote: > What you really need is an Ack from the PowerPC people for the fix you > suggested and then tha fix should go in the same series that is now > causing the failure (preferably before the problematic (for PowerPC) > patch. I'll zap

Re: [PATCH v2] powerpc: Make setjmp/longjmp signature standard

2020-03-30 Thread Nathan Chancellor
On Mon, Mar 30, 2020 at 08:43:19AM +0200, Clement Courbet wrote: > Declaring setjmp()/longjmp() as taking longs makes the signature > non-standard, and makes clang complain. In the past, this has been > worked around by adding -ffreestanding to the compile flags. > > The implementation looks like

[PATCH v3] powerpc xmon: use `dcbf` inplace of `dcbi` instruction for 64bit Book3S

2020-03-30 Thread Balamuruhan S
Data Cache Block Invalidate (dcbi) instruction implemented back in PowerPC architecture version 2.03. But as per Power Processor Users Manual it is obsolete and not supported by POWER8/POWER9 core. Attempt to use of this illegal instruction results in a hypervisor emulation assistance interrupt. So

Re: linux-next: build failure after merge of the tip tree

2020-03-30 Thread Michael Ellerman
Borislav Petkov writes: > On Mon, Mar 30, 2020 at 03:08:19PM +1100, Stephen Rothwell wrote: >> What you really need is an Ack from the PowerPC people for the fix you >> suggested and then tha fix should go in the same series that is now >> causing the failure (preferably before the problematic (fo

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

2020-03-30 Thread Baoquan He
On 03/30/20 at 09:44am, Michal Hocko wrote: > On Sun 29-03-20 08:19:24, Baoquan He wrote: > > On 03/28/20 at 11:31am, Hoan Tran wrote: > > > In NUMA layout which nodes have memory ranges that span across other > > > nodes, > > > the mm driver can detect the memory node id incorrectly. > > > > > >

Re: [PATCH v3] powerpc xmon: use `dcbf` inplace of `dcbi` instruction for 64bit Book3S

2020-03-30 Thread Christophe Leroy
Le 30/03/2020 à 09:59, Balamuruhan S a écrit : Data Cache Block Invalidate (dcbi) instruction implemented back in PowerPC architecture version 2.03. But as per Power Processor Users Manual it is obsolete and not supported by POWER8/POWER9 core. Attempt to use of this illegal instruction result

Re: linux-next: build failure after merge of the tip tree

2020-03-30 Thread Borislav Petkov
On Mon, Mar 30, 2020 at 07:04:16PM +1100, Michael Ellerman wrote: > Or just squash the hunk Stephen posted into the commit, which is what I > thought would happen to begin with. > > You can have my ack for it: > > Acked-by: Michael Ellerman (powerpc) Thanks but considering how this is not reall

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

2020-03-30 Thread Baoquan He
On 03/30/20 at 09:42am, Michal Hocko wrote: > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > In NUMA layout which nodes have memory ranges that span across other nodes, > > the mm driver can detect the memory node id incorrectly. > > > > For example, with layout below > > Node 0 address:

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

2020-03-30 Thread Baoquan He
On 03/30/20 at 04:16pm, Baoquan He wrote: > On 03/30/20 at 09:42am, Michal Hocko wrote: > > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > > In NUMA layout which nodes have memory ranges that span across other > > > nodes, > > > the mm driver can detect the memory node id incorrectly. > > > > > >

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

2020-03-30 Thread Frederic Barrat
From: Philippe Bergheaud Some opencapi FPGA images allow to control if the FPGA should be reloaded on the next adapter reset. If it is supported, the image specifies it through a Vendor Specific DVSEC in the config space of function 0. Signed-off-by: Philippe Bergheaud Signed-off-by: Frederic B

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

2020-03-30 Thread Arnd Bergmann
On Sat, Mar 28, 2020 at 4:07 PM Christian Lamparter wrote: > > (Sorry for the bounces, yes my smarthost mail setup breaks from time to time > and I had to cut the CC since it complained about the length.) > > I guess we should think about upstreaming the MyBook Live DTS. Problem here > is that we

Re: [PATCH v4 14/16] powerpc64: Add prefixed instructions to instruction data type

2020-03-30 Thread Alistair Popple
> @@ -487,12 +487,13 @@ int kprobe_post_handler(struct pt_regs *regs) > { > struct kprobe *cur = kprobe_running(); > struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); > + int len = ppc_inst_len(ppc_inst_read(cur->ainsn.insn)); I am no kprobes expert but it seems based on the code

Re: [PATCH v4 14/16] powerpc64: Add prefixed instructions to instruction data type

2020-03-30 Thread Jordan Niethe
On Mon, Mar 30, 2020 at 8:05 PM Alistair Popple wrote: > > > > > @@ -487,12 +487,13 @@ int kprobe_post_handler(struct pt_regs *regs) > > { > > struct kprobe *cur = kprobe_running(); > > struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); > > + int len = ppc_inst_len(ppc_inst_read(cu

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

2020-03-30 Thread Mike Rapoport
On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > In NUMA layout which nodes have memory ranges that span across other nodes, > > the mm driver can detect the memory node id incorrectly. > > > > For example, with layout below > > Node 0

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

2020-03-30 Thread Baoquan He
On 03/30/20 at 09:42am, Michal Hocko wrote: > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > In NUMA layout which nodes have memory ranges that span across other nodes, > > the mm driver can detect the memory node id incorrectly. > > > > For example, with layout below > > Node 0 address:

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

2020-03-30 Thread Michal Hocko
On Mon 30-03-20 12:21:27, Mike Rapoport wrote: > On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > > In NUMA layout which nodes have memory ranges that span across other > > > nodes, > > > the mm driver can detect the memory node id in

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

2020-03-30 Thread Mike Rapoport
On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote: > On Mon 30-03-20 12:21:27, Mike Rapoport wrote: > > On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > > > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > > > In NUMA layout which nodes have memory ranges that span across ot

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

2020-03-30 Thread Baoquan He
On 03/30/20 at 01:26pm, Mike Rapoport wrote: > On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote: > > On Mon 30-03-20 12:21:27, Mike Rapoport wrote: > > > On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > > > > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > > > > In NUMA la

Re: [PATCH 1/1] ppc/crash: Skip spinlocks during crash

2020-03-30 Thread Peter Zijlstra
On Fri, Mar 27, 2020 at 07:50:20AM +0100, Christophe Leroy wrote: > > > Le 26/03/2020 à 23:28, Leonardo Bras a écrit : > > 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. (

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

2020-03-30 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 v3 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-03-30 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 v3 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-03-30 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: 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/include/uapi/l

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

2020-03-30 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 v3 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

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

Re: linux-next: build failure after merge of the tip tree

2020-03-30 Thread H.J. Lu
On Mon, Mar 30, 2020 at 1:17 AM Borislav Petkov wrote: > > On Mon, Mar 30, 2020 at 07:04:16PM +1100, Michael Ellerman wrote: > > Or just squash the hunk Stephen posted into the commit, which is what I > > thought would happen to begin with. > > > > You can have my ack for it: > > > > Acked-by: Mic

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

2020-03-30 Thread Athira Rajeev
"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 "pmcregs_in_use". "pmcregs_in_use"

[PATCH] Fix "[v3, 10/32] powerpc/64s/exception: move real->virt switch into the common handler"

2020-03-30 Thread Nicholas Piggin
It's possible for interrupts to be replayed when TM is enabled and suspended, for example rt_sigreturn, where the mtmsrd MSR_KERNEL in the real-mode entry point to the common handler causes a TM Bad Thing exception (due to attempting to clear suspended). The fix for this is to have replay interrup

Re: [PATCH v5 03/13] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2020-03-30 Thread Balamuruhan S
On Fri, 2020-02-28 at 00:14 +, Christophe Leroy wrote: > Drop a bunch of #ifdefs CONFIG_PPC64 that are not vital. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/ptrace.h | 2 ++ > arch/powerpc/kernel/ptrace/ptrace.c | 18 +++--- > 2 files changed, 5 inser

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

2020-03-30 Thread Michal Simek
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.com/ I have been talking about i

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

2020-03-30 Thread Michal Simek
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 cdeb89943bfc ("MAINTAINERS: Fix incorrect status tag")

Re: [PATCH 1/1] ppc/crash: Skip spinlocks during crash

2020-03-30 Thread Leonardo Bras
Hello Peter, On Mon, 2020-03-30 at 13:02 +0200, Peter Zijlstra wrote: > do { > > > + if (unlikely(crash_skip_spinlock)) > > > + return; > > > > You are adding a test that reads a global var in the middle of a so hot path > > ? That must kill

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

2020-03-30 Thread YueHaibing
Fix Kconfig warnings: WARNING: unmet direct dependencies detected for NETDEVICES Depends on [n]: NET [=n] Selected by [y]: - AKEBONO [=y] && PPC_47x [=y] WARNING: unmet direct dependencies detected for ETHERNET Depends on [n]: NETDEVICES [=y] && NET [=n] Selected by [y]: - AKEBONO [=y

Re: [PATCH 1/1] ppc/crash: Skip spinlocks during crash

2020-03-30 Thread Leonardo Bras
Hello Christophe, On Sat, 2020-03-28 at 10:19 +, Christophe Leroy wrote: > Hi Leonardo, > > > > On 03/27/2020 03:51 PM, Leonardo Bras wrote: > > > > > [SNIP] > > - If the lock is already free, it would change nothing, > > - Otherwise, the lock will wait. > > - Waiting cycle just got bigger.

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be ^^ Nit.. visibility - Naveen

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

2020-03-30 Thread Nathan Lynch
Scott Cheloha writes: > Hi Michal, > > On Thu, Mar 12, 2020 at 06:02:37AM +0100, Michal Suchánek wrote: >> >> You basically revert the below which will likely cause the very error >> that was fixed there: >> >> commit b2d3b5ee66f2a04a918cc043cec0c9ed3de58f40 >> Author: Nathan Fontenot >> Date:

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

2020-03-30 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. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/ker

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/52xx/lite5200_sleep.S | 2 ++ 1 file changed, 2 insertions(+) Apart from the two minor comm

Re: hardcoded SIGSEGV in __die() ?

2020-03-30 Thread Joakim Tjernlund
On Thu, 2020-03-26 at 11:28 +1100, Michael Ellerman wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > > > Joakim Tjernlund writes: > > On Mon, 2020-03-23 at 15:45

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

2020-03-30 Thread Christophe Leroy
Le 30/03/2020 à 19:06, Naveen N. Rao a écrit : Christophe Leroy wrote: In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be    ^^ Nit..  visibility Lol, no. I mean't "lisibilit

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 19:06, Naveen N. Rao a écrit : Christophe Leroy wrote: In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be    ^^ Nit..  visibility Lol,

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

2020-03-30 Thread Mike Rapoport
On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > In NUMA layout which nodes have memory ranges that span across other nodes, > > the mm driver can detect the memory node id incorrectly. > > > > For example, with layout below > > Node 0

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

2020-03-30 Thread Michal Hocko
On Mon 30-03-20 20:51:00, Mike Rapoport wrote: > On Mon, Mar 30, 2020 at 09:42:46AM +0200, Michal Hocko wrote: > > On Sat 28-03-20 11:31:17, Hoan Tran wrote: > > > In NUMA layout which nodes have memory ranges that span across other > > > nodes, > > > the mm driver can detect the memory node id in

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

2020-03-30 Thread Christophe Leroy
Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy ---  arch/powerpc/kernel/entry_32.S | 7 +++  1 file chan

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

2020-03-30 Thread Jiri Olsa
On Fri, Mar 27, 2020 at 03:55:26PM +0530, Kajol Jain wrote: SNIP > diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c > index ea10fc4412c4..516504cf0ea5 100644 > --- a/tools/perf/tests/expr.c > +++ b/tools/perf/tests/expr.c > @@ -10,7 +10,7 @@ static int test(struct expr_parse_ctx *ct

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

2020-03-30 Thread Jiri Olsa
On Fri, Mar 27, 2020 at 03:55:26PM +0530, Kajol Jain wrote: SNIP > > %% > struct expr_scanner_ctx *sctx = expr_get_extra(yyscanner); > @@ -93,7 +106,7 @@ if { return IF; } > else { return ELSE; } > #smt_on { return SMT_ON; } > {number} { return value(y

Re: [PATCH v7 3/6] perf/tools: Refactoring metricgroup__add_metric function

2020-03-30 Thread Jiri Olsa
On Fri, Mar 27, 2020 at 03:55:25PM +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 | 61 +

Re: [PATCH v7 3/6] perf/tools: Refactoring metricgroup__add_metric function

2020-03-30 Thread Jiri Olsa
On Fri, Mar 27, 2020 at 03:55:25PM +0530, Kajol Jain wrote: SNIP > + eg->ids = ids; > + eg->idnum = idnum; > + eg->metric_name = pe->metric_name; > + eg->metric_expr = pe->metric_expr; > + eg->metric_unit = pe->unit; > + list_add_tail(&eg->nd, group_list); > + > + retu

Re: [PATCH 0/2] mm/thp: Rename pmd_mknotpresent() as pmd_mknotvalid()

2020-03-30 Thread Andrew Morton
On Sun, 29 Mar 2020 19:12:35 +0530 Anshuman Khandual wrote: > > > On 03/20/2020 10:24 AM, Anshuman Khandual wrote: > > This series renames pmd_mknotpresent() as pmd_mknotvalid(). Before that it > > drops an existing pmd_mknotpresent() definition from powerpc platform which > > was never requir

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

2020-03-30 Thread Michael Ellerman
YueHaibing writes: > Fix Kconfig warnings: > > WARNING: unmet direct dependencies detected for NETDEVICES > Depends on [n]: NET [=n] > Selected by [y]: > - AKEBONO [=y] && PPC_47x [=y] > > WARNING: unmet direct dependencies detected for ETHERNET > Depends on [n]: NETDEVICES [=y] && NET [=n

[PATCH kernel] powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory

2020-03-30 Thread Alexey Kardashevskiy
Unlike normal memory ("memory" compatible type in the FDT), the persistent memory ("ibm,pmemory" in the FDT) can be mapped anywhere in the guest physical space and it can be used for DMA. In order to maintain 1:1 mapping via the huge DMA window, we need to know the maximum physical address at the

Re: [PATCH v6 1/7] powerpc/mm: Implement set_memory() routines

2020-03-30 Thread Russell Currey
On Wed, 2020-03-11 at 17:03 +1100, Daniel Axtens wrote: > Russell Currey writes: > > > The set_memory_{ro/rw/nx/x}() functions are required for > > STRICT_MODULE_RWX, > > and are generally useful primitives to have. This implementation > > is > > designed to be completely generic across powerpc'

Re: [PATCH v5 1/7] ASoC: dt-bindings: fsl_asrc: Add new property fsl, asrc-format

2020-03-30 Thread Shengjiu Wang
Hi On Tue, Mar 24, 2020 at 5:22 AM Nicolin Chen wrote: > > On Fri, Mar 20, 2020 at 11:32:13AM -0600, Rob Herring wrote: > > On Mon, Mar 09, 2020 at 02:19:44PM -0700, Nicolin Chen wrote: > > > On Mon, Mar 09, 2020 at 11:58:28AM +0800, Shengjiu Wang wrote: > > > > In order to support new EASRC and

Re: [RFC PATCH 1/3] powerpc/mm: Introduce temporary mm

2020-03-30 Thread Christopher M Riedl
> On March 24, 2020 11:07 AM Christophe Leroy wrote: > > > Le 23/03/2020 à 05:52, Christopher M. Riedl a écrit : > > x86 supports the notion of a temporary mm which restricts access to > > temporary PTEs to a single CPU. A temporary mm is useful for situations > > where a CPU needs to perform s

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

2020-03-30 Thread Yuehaibing
On 2020/3/31 8:58, Michael Ellerman wrote: > YueHaibing writes: >> Fix Kconfig warnings: >> >> WARNING: unmet direct dependencies detected for NETDEVICES >> Depends on [n]: NET [=n] >> Selected by [y]: >> - AKEBONO [=y] && PPC_47x [=y] >> >> WARNING: unmet direct dependencies detected for ET

Re: [RFC PATCH 2/3] powerpc/lib: Initialize a temporary mm for code patching

2020-03-30 Thread Christopher M Riedl
> On March 24, 2020 11:10 AM Christophe Leroy wrote: > > > Le 23/03/2020 à 05:52, Christopher M. Riedl a écrit : > > When code patching a STRICT_KERNEL_RWX kernel the page containing the > > address to be patched is temporarily mapped with permissive memory > > protections. Currently, a per-cpu

[PATCH v2 1/1] vfio-pci/nvlink2: Allow fallback to ibm,mmio-atsd[0]

2020-03-30 Thread Sam Bobroff
Older versions of skiboot only provide a single value in the device tree property "ibm,mmio-atsd", even when multiple Address Translation Shoot Down (ATSD) registers are present. This prevents NVLink2 devices (other than the first) from being used with vfio-pci because vfio-pci expects to be able t

[PATCH v7 1/7] powerpc/mm: Implement set_memory() routines

2020-03-30 Thread Russell Currey
The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be completely generic across powerpc's many MMUs. It's possible that this could be optimised to be faster for specific MMUs, but the focus is

[PATCH v7 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-03-30 Thread Russell Currey
With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes like other architectures d

[PATCH v7 3/7] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime

2020-03-30 Thread Russell Currey
Very rudimentary, just echo 1 > [debugfs]/check_wx_pages and check the kernel log. Useful for testing strict module RWX. Updated the Kconfig entry to reflect this. Also fixed a typo. Reviewed-by: Kees Cook Signed-off-by: Russell Currey --- arch/powerpc/Kconfig.debug | 6 -

[PATCH v7 4/7] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2020-03-30 Thread Russell Currey
To enable strict module RWX on powerpc, set: CONFIG_STRICT_MODULE_RWX=y You should also have CONFIG_STRICT_KERNEL_RWX=y set to have any real security benefit. ARCH_HAS_STRICT_MODULE_RWX is set to require ARCH_HAS_STRICT_KERNEL_RWX. This is due to a quirk in arch/Kconfig and arch/powerpc/Kcon

[PATCH v7 5/7] powerpc/configs: Enable STRICT_MODULE_RWX in skiroot_defconfig

2020-03-30 Thread Russell Currey
skiroot_defconfig is the only powerpc defconfig with STRICT_KERNEL_RWX enabled, and if you want memory protection for kernel text you'd want it for modules too, so enable STRICT_MODULE_RWX there. Acked-by: Joel Stanley Signed-off-by: Russell Currey --- arch/powerpc/configs/skiroot_defconfig | 1

[PATCH v7 6/7] powerpc/mm: implement set_memory_attr()

2020-03-30 Thread Russell Currey
From: Christophe Leroy In addition to the set_memory_xx() functions which allows to change the memory attributes of not (yet) used memory regions, implement a set_memory_attr() function to: - set the final memory protection after init on currently used kernel regions. - enable/disable kernel memo

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

2020-03-30 Thread Russell Currey
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 blocks and was handling highmem, but that's unneeded because the affected pages can't be in highmem and block mapping verification is a

[PATCH v7 0/7] set_memory() routines and STRICT_MODULE_RWX

2020-03-30 Thread Russell Currey
Addressing review comments from Daniel Axtens. v6: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=163335 v5: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=160869 Changes since v6: [1/7] and [6/7]: Check for negative values of numpages and use

[PATCH V3 0/3] arm64: Enable vmemmap mapping from device memory

2020-03-30 Thread Anshuman Khandual
This series enables vmemmap backing memory allocation from device memory ranges on arm64. But before that, it enables vmemmap_populate_basepages() and vmemmap_alloc_block_buf() to accommodate struct vmem_altmap based alocation requests. This series applies after latest (v14) arm64 memory hot remov

[PATCH V3 2/3] mm/sparsemem: Enable vmem_altmap support in vmemmap_alloc_block_buf()

2020-03-30 Thread Anshuman Khandual
There are many instances where vmemap allocation is often switched between regular memory and device memory just based on whether altmap is available or not. vmemmap_alloc_block_buf() is used in various platforms to allocate vmemmap mappings. Lets also enable it to handle altmap based device memory

Re: [PATCH v2 1/1] vfio-pci/nvlink2: Allow fallback to ibm,mmio-atsd[0]

2020-03-30 Thread Alexey Kardashevskiy
On 31/03/2020 15:12, Sam Bobroff wrote: > Older versions of skiboot only provide a single value in the device > tree property "ibm,mmio-atsd", even when multiple Address Translation > Shoot Down (ATSD) registers are present. This prevents NVLink2 devices > (other than the first) from being used

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

2020-03-30 Thread Michael Ellerman
Christophe Leroy writes: > Le 27/03/2020 à 15:14, Andy Shevchenko a écrit : >> On Fri, Mar 27, 2020 at 02:22:55PM +0100, Arnd Bergmann wrote: >>> On Fri, Mar 27, 2020 at 2:15 PM Andy Shevchenko >>> wrote: On Fri, Mar 27, 2020 at 03:10:26PM +0200, Andy Shevchenko wrote: > On Fri, Mar 27,

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

2020-03-30 Thread Christophe Leroy
Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy ---  ar

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy ---  arch/powerpc/kernel/entry_32.S

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: C

[PATCH 01/10] powerpc: Mark 4xx as Orphan in MAINTAINERS

2020-03-30 Thread Christophe Leroy
From: Michael Ellerman The 4xx platforms are no longer maintained. Cc: Alistair Popple Cc: Matt Porter Signed-off-by: Michael Ellerman Acked-by: Alistair Popple Signed-off-by: Christophe Leroy --- MAINTAINERS | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MAINTAINE

[PATCH 02/10] powerpc/40x: Remove 40x platforms.

2020-03-30 Thread Christophe Leroy
40x platforms have been orphaned for many years. Remove them. Signed-off-by: Christophe Leroy --- MAINTAINERS | 1 - arch/powerpc/configs/40x/acadia_defconfig | 62 arch/powerpc/configs/40x/ep405_defconfig| 62 arch/powerpc/configs/40x

[PATCH 03/10] powerpc/boot: Remove all 40x platforms

2020-03-30 Thread Christophe Leroy
Remove 40x platforms from the boot directory. Signed-off-by: Christophe Leroy --- arch/powerpc/boot/4xx.c | 266 - arch/powerpc/boot/4xx.h | 4 - arch/powerpc/boot/Makefile | 16 - arch/powerpc/boot/cuboot-acadia.c | 171 --- arch/pow

[PATCH 04/10] powerpc: Remove support for 40x

2020-03-30 Thread Christophe Leroy
Now that 40x platforms have gone, remove support for 40x in the core of powerpc arch. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 8 +- arch/powerpc/Kconfig.debug | 13 - arch/powerpc/Makefile| 1 - arch/powerp

[PATCH 05/10] powerpc: Remove IBM405 Erratum #77

2020-03-30 Thread Christophe Leroy
This erratum is dedicated to IBM405 which was part of 40x platforms. Now that 40x platforms are gone, this erratum can be removed. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/asm-405.h | 19 --- arch/powerpc/include/asm/atomic.h| 11 ---

[PATCH 06/10] powerpc/xmon: Remove PPC403 and PPC405

2020-03-30 Thread Christophe Leroy
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 +++- arch/powerpc/xmon/ppc.h | 6 -

[PATCH 07/10] powerpc/4xx: Remove CONFIG_4xx

2020-03-30 Thread Christophe Leroy
CONFIG_4xx was corresponding to CONFIG_40x | CONFIG_44x. As CONFIG_40x is gone, CONFIG_4xx and CONFIG_44x are now equivalent. And CONFIG_BOOKE is also set when CONFIG_44x is set. Replace (CONFIG_4xx | CONFIG_BOOKE) by CONFIG_BOOKE Replace other CONFIG_4xx by CONFIG_44x Remove CONFIG_4xx. Signed-

[PATCH 08/10] powerpc/platforms: Move files from 4xx to 44x

2020-03-30 Thread Christophe Leroy
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 arch/powerpc/platforms/{4xx => 44x}/gpio.c| 0 .../powerpc/platforms/{4xx => 44x}/hsta_msi.

[PATCH 09/10] powerpc/pgtable: Drop PTE_ATOMIC_UPDATES

2020-03-30 Thread Christophe Leroy
40x was the last user of PTE_ATOMIC_UPDATES. Drop everything related to PTE_ATOMIC_UPDATES. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 30 arch/powerpc/include/asm/nohash/64/pgtable.h | 27 -- 2 files changed, 57 delet

[PATCH 10/10] powerpc/32: Replace RFI by rfi

2020-03-30 Thread Christophe Leroy
RFI was a macro waving the rfi instruction for the 40x. Now that 40x is gone, rfi can be used directly. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 18 +- arch/powerpc/kernel/head_32.S | 18 +- 2 files changed, 18 insertions(+), 18 delet

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

2020-03-30 Thread Christophe Leroy
Le 31/03/2020 à 08:17, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running w

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

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 31/03/2020 à 08:17, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception en

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

2020-03-30 Thread Christophe Leroy
Le 31/03/2020 à 07:30, Michael Ellerman a écrit : Christophe Leroy writes: Le 27/03/2020 à 15:14, Andy Shevchenko a écrit : On Fri, Mar 27, 2020 at 02:22:55PM +0100, Arnd Bergmann wrote: On Fri, Mar 27, 2020 at 2:15 PM Andy Shevchenko wrote: On Fri, Mar 27, 2020 at 03:10:26PM +0200, Andy