Re: [PATCH 1/5] powerpc/mm: Introduce temporary mm

2020-06-02 Thread Christophe Leroy
Le 03/06/2020 à 07:19, 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 sensitive operations (such as patching a STRICT_KERNEL_RWX kernel) requ

Re: cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
> Okay, so I don’t have to send the v2 patch. It will become more interesting under which circumstances the presented software development concerns will be taken better into account. Regards, Markus

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread wanghai (M)
在 2020/6/3 14:50, Greg Kroah-Hartman 写道: On Wed, Jun 03, 2020 at 02:34:07PM +0800, wanghai (M) wrote: 在 2020/6/3 14:14, Greg Kroah-Hartman 写道: On Wed, Jun 03, 2020 at 09:42:41AM +0800, wanghai (M) wrote: 在 2020/6/3 1:20, Markus Elfring 写道: Fix it by adding a call to kobject_put() in the err

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Greg Kroah-Hartman
On Wed, Jun 03, 2020 at 02:34:07PM +0800, wanghai (M) wrote: > > 在 2020/6/3 14:14, Greg Kroah-Hartman 写道: > > On Wed, Jun 03, 2020 at 09:42:41AM +0800, wanghai (M) wrote: > > > 在 2020/6/3 1:20, Markus Elfring 写道: > > > > > Fix it by adding a call to kobject_put() in the error path of > > > > > kob

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
> Please note that you are responding to someone that a lot of kernel > developers and maintainers have blacklisted as being very annoying I can understand that you can occasionally become annoyed. > and not helpful at all. I got the impression that some contributors (including you) found also

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread wanghai (M)
在 2020/6/3 14:14, Greg Kroah-Hartman 写道: On Wed, Jun 03, 2020 at 09:42:41AM +0800, wanghai (M) wrote: 在 2020/6/3 1:20, Markus Elfring 写道: Fix it by adding a call to kobject_put() in the error path of kobject_init_and_add(). Thanks for another completion of the exception handling. Would an o

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Greg Kroah-Hartman
On Wed, Jun 03, 2020 at 09:42:41AM +0800, wanghai (M) wrote: > > 在 2020/6/3 1:20, Markus Elfring 写道: > > > Fix it by adding a call to kobject_put() in the error path of > > > kobject_init_and_add(). > > Thanks for another completion of the exception handling. > > > > Would an other patch subject

[PATCH 0/5] Use per-CPU temporary mappings for patching

2020-06-02 Thread Christopher M. Riedl
When compiled with CONFIG_STRICT_KERNEL_RWX, the kernel must create temporary mappings when patching itself. These mappings temporarily override the strict RWX text protections to permit a write. Currently, powerpc allocates a per-CPU VM area for patching. Patching occurs as follows: 1. Ma

[PATCH 5/5] powerpc: Add LKDTM test to hijack a patch mapping

2020-06-02 Thread Christopher M. Riedl
When live patching with STRICT_KERNEL_RWX, the CPU doing the patching must use a temporary mapping which allows for writing to kernel text. During the entire window of time when this temporary mapping is in use, another CPU could write to the same mapping and maliciously alter kernel text. Implemen

[PATCH 2/5] powerpc/lib: Initialize a temporary mm for code patching

2020-06-02 Thread Christopher M. Riedl
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 vmalloc patch area is used for this purpose. While the patch area is per-cpu, the temporary page mapping is inserted into the ke

[PATCH 3/5] powerpc/lib: Use a temporary mm for code patching

2020-06-02 Thread Christopher M. Riedl
Currently, code patching a STRICT_KERNEL_RWX exposes the temporary mappings to other CPUs. These mappings should be kept local to the CPU doing the patching. Use the pre-initialized temporary mm and patching address for this purpose. Also add a check after patching to ensure the patch succeeded. U

[PATCH 4/5] powerpc/lib: Add LKDTM accessor for patching addr

2020-06-02 Thread Christopher M. Riedl
When live patching a STRICT_RWX kernel, a mapping is installed at a "patching address" with temporary write permissions. Provide a LKDTM-only accessor function for this address in preparation for a LKDTM test which attempts to "hijack" this mapping by writing to it from another CPU. Signed-off-by:

[PATCH 1/5] powerpc/mm: Introduce temporary mm

2020-06-02 Thread Christopher M. Riedl
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 sensitive operations (such as patching a STRICT_KERNEL_RWX kernel) requiring temporary mappings without exposing said mappings to

Re: cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=f359287765c04711ff54fbd11645271d8e5ff763#n465 >> I just used the original author's label, should I replace all his labels >> like'err','err1' with reasonable one. > > No. Do you in

[powerpc:merge] BUILD SUCCESS 4d8244d005b2a92c872a0a993c3aa94b5842e56b

2020-06-02 Thread kbuild test robot
rhel-kconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a001-20200602 i386 randconfig-a006-20200602 i386 randconfig-a002-20200602 i386 randconfig-a005-20200602 i386

[powerpc:next] BUILD SUCCESS 4336b9337824a60a0b10013c622caeee99460db5

2020-06-02 Thread kbuild test robot
allnoconfig i386 randconfig-a001-20200602 i386 randconfig-a006-20200602 i386 randconfig-a002-20200602 i386 randconfig-a005-20200602 i386 randconfig-a003-20200602 i386 randconfig-a004-20200602 x86_64

Re: [PATCH 1/4] dma-mapping: move the remaining DMA API calls out of line

2020-06-02 Thread Alexey Kardashevskiy
On 09/05/2020 18:19, Christoph Hellwig wrote: > On Tue, May 05, 2020 at 02:18:37PM +1000, Alexey Kardashevskiy wrote: >> >> >> On 17/04/2020 17:58, Christoph Hellwig wrote: >>> On Wed, Apr 15, 2020 at 09:21:37PM +1000, Alexey Kardashevskiy wrote: And the fact they were exported leaves possi

[PATCH 3/3] ASoC: fsl_easrc: Fix "Function parameter not described" warnings

2020-06-02 Thread Shengjiu Wang
Obtained with: $ make W=1 sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'easrc' not described in 'fsl_easrc_normalize_filter' sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'infilter' not described in 'fsl_easrc_normalize_filter' sound/soc/fsl/fsl_eas

[PATCH 2/3] ASoC: fsl_easrc: Fix -Wunused-but-set-variable

2020-06-02 Thread Shengjiu Wang
Obtained with: $ make W=1 sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_rs_ratio': sound/soc/fsl/fsl_easrc.c:182:15: warning: variable 'int_bits' set but not used [-Wunused-but-set-variable] unsigned int int_bits; ^ sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_ct

[PATCH 0/3] ASoC: fsl_easrc: Fix several warnings

2020-06-02 Thread Shengjiu Wang
Fix several warnings with "make W=1" Shengjiu Wang (3): ASoC: fsl_easrc: Fix -Wmissing-prototypes warning ASoC: fsl_easrc: Fix -Wunused-but-set-variable ASoC: fsl_easrc: Fix "Function parameter not described" warnings sound/soc/fsl/fsl_easrc.c | 42 +--

[PATCH 1/3] ASoC: fsl_easrc: Fix -Wmissing-prototypes warning

2020-06-02 Thread Shengjiu Wang
Obtained with: $ make W=1 sound/soc/fsl/fsl_easrc.c:967:5: warning: no previous prototype for function 'fsl_easrc_config_context' [-Wmissing-prototypes] int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id) ^ sound/soc/fsl/fsl_easrc.c:967:1: note: declare 'static' if the f

Re: [PATCH v2] selftests: powerpc: Add test for execute-disabled pkeys

2020-06-02 Thread Michael Ellerman
Sandipan Das writes: > Hi Michael, > > Thanks for your suggestions. I had a few questions regarding some > of them. > > On 29/05/20 7:18 am, Michael Ellerman wrote: >>> [...] >>> + >>> +static void pkeyreg_set(unsigned long uamr) >>> +{ >>> + asm volatile("isync; mtspr 0xd, %0; isync;" : :

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Michael Ellerman
"wanghai (M)" writes: > 在 2020/6/3 1:20, Markus Elfring 写道: >>> Fix it by adding a call to kobject_put() in the error path of >>> kobject_init_and_add(). >> Thanks for another completion of the exception handling. >> >> Would an other patch subject be a bit nicer? > Thanks for the guidance, I will

Re: linux-next: manual merge of the rcu tree with the powerpc tree

2020-06-02 Thread Stephen Rothwell
Hi all, On Tue, 19 May 2020 17:23:16 +1000 Stephen Rothwell wrote: > > Hi all, > > Today's linux-next merge of the rcu tree got a conflict in: > > arch/powerpc/kernel/traps.c > > between commit: > > 116ac378bb3f ("powerpc/64s: machine check interrupt update NMI accounting") > > from the

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread wanghai (M)
在 2020/6/3 1:20, Markus Elfring 写道: Fix it by adding a call to kobject_put() in the error path of kobject_init_and_add(). Thanks for another completion of the exception handling. Would an other patch subject be a bit nicer? Thanks for the guidance, I will perfect this description and send a

Re: [RESEND PATCH v9 1/5] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-02 Thread Ira Weiny
On Tue, Jun 02, 2020 at 03:44:34PM +0530, Vaibhav Jain wrote: > Add documentation to 'papr_hcalls.rst' describing the bitmap flags > that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM > specification. > > Cc: "Aneesh Kumar K . V" > Cc: Dan Williams > Cc: Michael Ellerman > Cc: Ira We

Re: [RESEND PATCH v9 5/5] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-02 Thread Ira Weiny
On Tue, Jun 02, 2020 at 03:44:38PM +0530, Vaibhav Jain wrote: > This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' > that returns a newly introduced 'struct nd_papr_pdsm_health' instance > containing dimm health information back to user space in response to > ND_CMD_CALL. This functi

Re: [RESEND PATCH v9 4/5] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods

2020-06-02 Thread Ira Weiny
On Tue, Jun 02, 2020 at 01:51:49PM -0700, 'Ira Weiny' wrote: > On Tue, Jun 02, 2020 at 03:44:37PM +0530, Vaibhav Jain wrote: ... > > + > > +/* > > + * PDSM Envelope: > > + * > > + * The ioctl ND_CMD_CALL transfers data between user-space and kernel via > > + * envelope which consists of a header

Re: [RESEND PATCH v9 4/5] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods

2020-06-02 Thread Ira Weiny
On Tue, Jun 02, 2020 at 03:44:37PM +0530, Vaibhav Jain wrote: > Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm > module and add the command family NVDIMM_FAMILY_PAPR to the white list > of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the > nvdimm command ma

[PATCH v5 2/3] arch: wire-up close_range()

2020-06-02 Thread Christian Brauner
This wires up the close_range() syscall into all arches at once. Suggested-by: Arnd Bergmann Signed-off-by: Christian Brauner Reviewed-by: Oleg Nesterov Acked-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Cc: Jann Horn Cc: David Howells Cc: Dmitry V. Levin Cc: Linus Torvalds Cc:

Re: [PATCH 1/4] powerpc: Add a ppc_inst_as_str() helper

2020-06-02 Thread Segher Boessenkool
On Tue, Jun 02, 2020 at 03:27:25PM +1000, Jordan Niethe wrote: > There are quite a few places where instructions are printed, this is > done using a '%x' format specifier. With the introduction of prefixed > instructions, this does not work well. Currently in these places, > ppc_inst_val() is used

Re: [PATCH 11/14] x86/entry: Clarify irq_{enter,exit}_rcu()

2020-06-02 Thread Qian Cai
On Tue, Jun 02, 2020 at 05:05:11PM +0200, Peter Zijlstra wrote: > On Tue, Jun 02, 2020 at 10:42:35AM -0400, Qian Cai wrote: > > > Reverted this commit fixed the POWER9 boot warning, > > ARGH, I'm an idiot. Please try this instead: > > > diff --git a/kernel/softirq.c b/kernel/softirq.c > index a3

Re: [RESEND PATCH v9 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-02 Thread Ira Weiny
On Tue, Jun 02, 2020 at 03:44:36PM +0530, Vaibhav Jain wrote: > 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 bitmap, bitwise-and of which is then stored in > 'struct papr_scm_priv' and subsequently pa

RE: [RFC PATCH 1/2] libnvdimm: Add prctl control for disabling synchronous fault support.

2020-06-02 Thread Williams, Dan J
[ forgive formatting, a series of unfortunate events has me using Outlook for the moment ] > From: Jan Kara > > > > These flags are device properties that affect the kernel and > > > > userspace's handling of persistence. > > > > > > > > > > That will not handle the scenario with multiple applic

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Segher Boessenkool
On Tue, Jun 02, 2020 at 01:50:32PM +, Joseph Myers wrote: > On Mon, 1 Jun 2020, Segher Boessenkool wrote: > > > > The supported glibc ABIs are listed at > > > . > > > > powerpcle-linux already does work somewhat, and that should also he > > worth so

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
> Fix it by adding a call to kobject_put() in the error path of > kobject_init_and_add(). Thanks for another completion of the exception handling. Would an other patch subject be a bit nicer? … > +++ b/drivers/misc/cxl/sysfs.c > @@ -624,7 +624,7 @@ static struct afu_config_record > *cxl_sysfs_

Re: [PATCH] cxl: Fix kobject memleak

2020-06-02 Thread Frederic Barrat
Le 02/06/2020 à 14:07, Wang Hai a écrit : Currently the error return path from kobject_init_and_add() is not followed by a call to kobject_put() - which means we are leaking the kobject. Fix it by adding a call to kobject_put() in the error path of kobject_init_and_add(). Fixes: b087e6190ddc

Re: [PATCH v2] cxl: Remove dead Kconfig option

2020-06-02 Thread Frederic Barrat
Le 02/06/2020 à 09:05, Andrew Donnellan a écrit : The CXL_AFU_DRIVER_OPS Kconfig option was added to coordinate merging of new features. It no longer serves any purpose, so remove it. Signed-off-by: Andrew Donnellan Acked-by: Frederic Barrat --- v1->v2: - keep CXL_LIB for now to avoi

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Michal Suchánek
On Tue, Jun 02, 2020 at 05:40:39PM +0200, Daniel Kolesa wrote: > > > On Tue, Jun 2, 2020, at 17:27, Michal Suchánek wrote: > > On Tue, Jun 02, 2020 at 05:13:25PM +0200, Daniel Kolesa wrote: > > > On Tue, Jun 2, 2020, at 16:23, Michal Suchánek wrote: > > > > On Tue, Jun 02, 2020 at 01:40:23PM +000

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Daniel Kolesa
On Tue, Jun 2, 2020, at 17:27, Michal Suchánek wrote: > On Tue, Jun 02, 2020 at 05:13:25PM +0200, Daniel Kolesa wrote: > > On Tue, Jun 2, 2020, at 16:23, Michal Suchánek wrote: > > > On Tue, Jun 02, 2020 at 01:40:23PM +, Joseph Myers wrote: > > > > On Tue, 2 Jun 2020, Daniel Kolesa wrote: >

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Michal Suchánek
On Tue, Jun 02, 2020 at 05:13:25PM +0200, Daniel Kolesa wrote: > On Tue, Jun 2, 2020, at 16:23, Michal Suchánek wrote: > > On Tue, Jun 02, 2020 at 01:40:23PM +, Joseph Myers wrote: > > > On Tue, 2 Jun 2020, Daniel Kolesa wrote: > > > > > > > not be limited to being just userspace under ppc64le

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Daniel Kolesa
On Tue, Jun 2, 2020, at 16:23, Michal Suchánek wrote: > On Tue, Jun 02, 2020 at 01:40:23PM +, Joseph Myers wrote: > > On Tue, 2 Jun 2020, Daniel Kolesa wrote: > > > > > not be limited to being just userspace under ppc64le, but should be > > > runnable on a native kernel as well, which should

Re: [PATCH 11/14] x86/entry: Clarify irq_{enter,exit}_rcu()

2020-06-02 Thread Peter Zijlstra
On Tue, Jun 02, 2020 at 10:42:35AM -0400, Qian Cai wrote: > Reverted this commit fixed the POWER9 boot warning, ARGH, I'm an idiot. Please try this instead: diff --git a/kernel/softirq.c b/kernel/softirq.c index a3eb6eba8c41..c4201b7f42b1 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Daniel Kolesa
On Tue, Jun 2, 2020, at 15:40, Joseph Myers wrote: > On Tue, 2 Jun 2020, Daniel Kolesa wrote: > > > not be limited to being just userspace under ppc64le, but should be > > runnable on a native kernel as well, which should not be limited to any > > particular baseline other than just PowerPC. >

Re: [PATCH] powerpc: Fix misleading small cores print

2020-06-02 Thread Gautham R Shenoy
On Fri, May 29, 2020 at 09:07:31AM +1000, Michael Neuling wrote: > Currently when we boot on a big core system, we get this print: > [0.040500] Using small cores at SMT level > > This is misleading as we've actually detected big cores. > > This patch clears up the print to say we've detect

Re: [PATCH 11/14] x86/entry: Clarify irq_{enter,exit}_rcu()

2020-06-02 Thread Qian Cai
6 ns [0.012502][T0] clocksource: timebase mult[1f4] shift[24] registered [0.030273][T0] [ cut here ] [0.034421][T0] DEBUG_LOCKS_WARN_ON(current->hardirq_context) [0.034433][T0] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:3680 l

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Michal Suchánek
On Tue, Jun 02, 2020 at 01:40:23PM +, Joseph Myers wrote: > On Tue, 2 Jun 2020, Daniel Kolesa wrote: > > > not be limited to being just userspace under ppc64le, but should be > > runnable on a native kernel as well, which should not be limited to any > > particular baseline other than just P

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Joseph Myers
On Mon, 1 Jun 2020, Segher Boessenkool wrote: > > The supported glibc ABIs are listed at > > . > > powerpcle-linux already does work somewhat, and that should also he > worth something, official or not ;-) > > (It has worked for very many years already

Re: ppc64le and 32-bit LE userland compatibility

2020-06-02 Thread Joseph Myers
On Tue, 2 Jun 2020, Daniel Kolesa wrote: > not be limited to being just userspace under ppc64le, but should be > runnable on a native kernel as well, which should not be limited to any > particular baseline other than just PowerPC. This is a fairly unusual approach to bringing up a new ABI. Si

Re: [PATCH] powerpc/kvm: Enable support for ISA v3.1 guests

2020-06-02 Thread kbuild test robot
option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Alistair-Popple/powerpc-kvm-Enable-support-for-ISA-v3-1-guests/20200602-140435 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linu

[PATCH] cxl: Fix kobject memleak

2020-06-02 Thread Wang Hai
Currently the error return path from kobject_init_and_add() is not followed by a call to kobject_put() - which means we are leaking the kobject. Fix it by adding a call to kobject_put() in the error path of kobject_init_and_add(). Fixes: b087e6190ddc ("cxl: Export optional AFU configuration recor

Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message

2020-06-02 Thread Dan Carpenter
On Tue, Jun 02, 2020 at 09:23:57PM +1000, Michael Ellerman wrote: > Markus Elfring writes: > Please just remove the message instead, it's a tiny allocation that's > unlikely to ever fail, and the caller will print an error anyway. > >>> > >>> How do you think about to take another look a

Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message

2020-06-02 Thread Michael Ellerman
Markus Elfring writes: Please just remove the message instead, it's a tiny allocation that's unlikely to ever fail, and the caller will print an error anyway. >>> >>> How do you think about to take another look at a previous update suggestion >>> like the following? >>> >>> powerpc/nvram

Re: [PATCH] hw_breakpoint: Fix build warnings with clang

2020-06-02 Thread Ravi Bangoria
On 6/2/20 4:30 PM, Michael Ellerman wrote: Christophe Leroy writes: Le 02/06/2020 à 06:12, Ravi Bangoria a écrit : kbuild test robot reported few build warnings with hw_breakpoint code when compiled with clang[1]. Fix those. [1]: https://lore.kernel.org/linuxppc-dev/202005192233.oi9cjrta%2

Re: [PATCH] hw_breakpoint: Fix build warnings with clang

2020-06-02 Thread Michael Ellerman
Christophe Leroy writes: > Le 02/06/2020 à 06:12, Ravi Bangoria a écrit : >> kbuild test robot reported few build warnings with hw_breakpoint code >> when compiled with clang[1]. Fix those. >> >> [1]: >> https://lore.kernel.org/linuxppc-dev/202005192233.oi9cjrta%25...@intel.com/ >> This should

Re: [PATCH] powerpc/32: disable KASAN with pages bigger than 16k

2020-06-02 Thread Michael Ellerman
Christophe Leroy writes: > Le 28/05/2020 à 12:17, Christophe Leroy a écrit : >> Mapping of early shadow area is implemented by using a single static >> page table having all entries pointing to the same early shadow page. >> The shadow area must therefore occupy full PGD entries. >> >> The shadow

[RESEND PATCH v9 2/5] seq_buf: Export seq_buf_printf

2020-06-02 Thread Vaibhav Jain
'seq_buf' provides a very useful abstraction for writing to a string buffer without needing to worry about it over-flowing. However even though the API has been stable for couple of years now its still not exported to kernel loadable modules limiting its usage. Hence this patch proposes update to

[RESEND PATCH v9 5/5] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-02 Thread Vaibhav Jain
This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' that returns a newly introduced 'struct nd_papr_pdsm_health' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_pdsm_health() that que

[RESEND PATCH v9 4/5] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-02 Thread Vaibhav Jain
Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm module and add the command family NVDIMM_FAMILY_PAPR to the white list of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the nvdimm command mask and implement necessary scaffolding in the module to handle ND_CMD_

[RESEND PATCH v9 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-02 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 bitmap, bitwise-and of which is then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attri

[RESEND PATCH v9 1/5] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-02 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: Resend: * None v8..v9: * s/

[RESEND PATCH v9 0/5] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-02 Thread Vaibhav Jain
Changes since v9 [1]: * Added acks from Aneesh and Steven Steven Rostedt. Changes since v8 [2]: * Updated proposed changes to remove usage of term 'SCM' due to ambiguity with 'PMEM' and 'NVDIMM'. [ Dan Williams ] * Replaced the usage of term 'SCM' with 'PMEM' in most contexts. [ Aneesh ] * Re

Re: [PATCH v1 3/4] KVM: PPC: Book3S HV: migrate remaining normal-GFNs to secure-GFNs in H_SVM_INIT_DONE

2020-06-02 Thread Bharata B Rao
On Mon, Jun 01, 2020 at 12:05:35PM -0700, Ram Pai wrote: > On Mon, Jun 01, 2020 at 05:25:18PM +0530, Bharata B Rao wrote: > > On Sat, May 30, 2020 at 07:27:50PM -0700, Ram Pai wrote: > > > H_SVM_INIT_DONE incorrectly assumes that the Ultravisor has explicitly > > > called H_SVM_PAGE_IN for all secu

Re: [PATCH v1 4/4] KVM: PPC: Book3S HV: migrate hot plugged memory

2020-06-02 Thread Laurent Dufour
Le 31/05/2020 à 04:27, Ram Pai a écrit : From: Laurent Dufour When a memory slot is hot plugged to a SVM, GFNs associated with that memory slot automatically default to secure GFN. Hence migrate the PFNs associated with these GFNs to device-PFNs. uv_migrate_mem_slot() is called to achieve that

Re: [RFC PATCH 1/2] libnvdimm: Add prctl control for disabling synchronous fault support.

2020-06-02 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > On 6/1/20 5:37 PM, Michal Suchánek wrote: >> On Mon, Jun 01, 2020 at 05:31:50PM +0530, Aneesh Kumar K.V wrote: >>> On 6/1/20 3:39 PM, Jan Kara wrote: On Fri 29-05-20 16:25:35, Aneesh Kumar K.V wrote: > On 5/29/20 3:22 PM, Jan Kara wrote: >> On Fri 29-05-2

[RFC PATCH v2 2/5] powerpc/pmem: Disable synchronous fault by default

2020-06-02 Thread Aneesh Kumar K.V
This adds a kernel config option that controls whether MAP_SYNC is enabled by default. With POWER10, architecture is adding new pmem flush and sync instructions. The kernel should prevent the usage of MAP_SYNC if applications are not using the new instructions on newer hardware. This config allows

[RFC PATCH v2 5/5] libnvdimm: Add prctl control for disabling synchronous fault support

2020-06-02 Thread Aneesh Kumar K.V
With POWER10, architecture is adding new pmem flush and sync instructions. The kernel should prevent the usage of MAP_SYNC if applications are not using the new instructions on newer hardware. This patch adds a prctl option MAP_SYNC_ENABLE that can be used to enable the usage of MAP_SYNC. This is

[RFC PATCH v2 4/5] powerpc/papr_scm: disable MAP_SYNC for newer hardware

2020-06-02 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/papr_scm.c | 17 - drivers/nvdimm/of_pmem.c | 7 +++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/

[RFC PATCH v2 3/5] libnvdimm/dax: Make DAXDEV_SYNC_ENABLED flag region-specific

2020-06-02 Thread Aneesh Kumar K.V
This patch makes sync fault enable/disable feature more fine-grained by allowing region-wise control of the same. In a followup patch on ppc64 only device with compat string "ibm,pmemory-v2" will disable the sync fault feature. Signed-off-by: Aneesh Kumar K.V --- drivers/dax/bus.c|

[RFC PATCH v2 1/5] libnvdimm/dax: Add a dax flag to control synchronous fault support

2020-06-02 Thread Aneesh Kumar K.V
With POWER10, architecture is adding new pmem flush and sync instructions. The kernel should prevent the usage of MAP_SYNC if applications are not using the new instructions on newer hardware This patch adds a dax attribute (/sys/bus/nd/devices/region0/pfn0.1/block/pmem0/dax/sync_fault) which can

Re: [PATCH 1/4] powerpc: Add a ppc_inst_as_str() helper

2020-06-02 Thread Joel Stanley
On Tue, 2 Jun 2020 at 05:31, Jordan Niethe wrote: > > There are quite a few places where instructions are printed, this is > done using a '%x' format specifier. With the introduction of prefixed > instructions, this does not work well. Currently in these places, > ppc_inst_val() is used for the va

[PATCH v2] cxl: Remove dead Kconfig option

2020-06-02 Thread Andrew Donnellan
The CXL_AFU_DRIVER_OPS Kconfig option was added to coordinate merging of new features. It no longer serves any purpose, so remove it. Signed-off-by: Andrew Donnellan --- v1->v2: - keep CXL_LIB for now to avoid breaking a driver that is currently out of tree --- drivers/misc/cxl/Kconfig | 4