[PATCH 01/12] powerpc/pseries: Introduce option to build secure virtual machines

2019-05-20 Thread Thiago Jung Bauermann
Introduce CONFIG_PPC_SVM to control support for secure guests and include Ultravisor-related helpers when it is selected Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++-

Re: [PATCH 11/12] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-05-20 Thread Christoph Hellwig
> diff --git a/arch/powerpc/include/asm/mem_encrypt.h > b/arch/powerpc/include/asm/mem_encrypt.h > new file mode 100644 > index ..45d5e4d0e6e0 > --- /dev/null > +++ b/arch/powerpc/include/asm/mem_encrypt.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * SVM

[PATCH 10/12] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-05-20 Thread Thiago Jung Bauermann
Secure guest memory is inacessible to devices so regular DMA isn't possible. In that case set devices' dma_map_ops to NULL so that the generic DMA code path will use SWIOTLB and DMA to bounce buffers. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6 +- 1

Re: [PATCH] powerpc/powernv: Return for invalid IMC domain

2019-05-20 Thread Madhavan Srinivasan
On 20/05/19 2:27 PM, Anju T Sudhakar wrote: Currently init_imc_pmu() can be failed either because an IMC unit with invalid domain(i.e an IMC node not supported by the kernel) is attempted a pmu-registration or something went wrong while registering a valid IMC unit. In both the cases kernel

[Bug 203647] Locking API testsuite fails "mixed read-lock/lock-write ABBA" rlock on kernels >=4.14.x

2019-05-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203647 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|NEW |RESOLVED

[RFC PATCH 02/12] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-05-20 Thread Thiago Jung Bauermann
From: Benjamin Herrenschmidt For secure VMs, the signing tool will create a ticket called the "ESM blob" for the Enter Secure Mode ultravisor call with the signatures of the kernel and initrd among other things. This adds support to the wrapper script for adding that blob via the "-e" option to

Re: [PATCH] crypto: vmx - convert to skcipher API

2019-05-20 Thread Michael Ellerman
Eric Biggers writes: > From: Eric Biggers > > Convert the VMX implementations of AES-CBC, AES-CTR, and AES-XTS from > the deprecated "blkcipher" API to the "skcipher" API. > > As part of this, I moved the skcipher_request for the fallback algorithm > off the stack and into the request context of

[PATCH 07/12] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-05-20 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann ---

Re: [RFC PATCH] powerpc/mm: Implement STRICT_MODULE_RWX

2019-05-20 Thread Russell Currey
On Wed, 2019-05-15 at 06:20 +, Christophe Leroy wrote: Confirming this works on hash and radix book3s64. > + > + // only operate on VM areas for now > + area = find_vm_area((void *)addr); > + if (!area || end > (unsigned long)area->addr + area->size || > + !(area->flags &

[PATCH 04/12] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-05-20 Thread Thiago Jung Bauermann
From: Ram Pai These functions are used when the guest wants to grant the hypervisor access to certain pages. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor-api.h | 2 ++ arch/powerpc/include/asm/ultravisor.h | 14 ++ 2

[PATCH 00/12] Secure Virtual Machine Enablement

2019-05-20 Thread Thiago Jung Bauermann
This series enables Secure Virtual Machines (SVMs) on powerpc. SVMs use the Protected Execution Facility (PEF) and request to be migrated to secure memory during prom_init() so by default all of their memory is inaccessible to the hypervisor. There is an Ultravisor call that the VM can use to

[RFC PATCH 03/12] powerpc/prom_init: Add the ESM call to prom_init

2019-05-20 Thread Thiago Jung Bauermann
From: Ram Pai Make the Enter-Secure-Mode (ESM) ultravisor call to switch the VM to secure mode. Add "svm=" command line option to turn off switching to secure mode. Introduce CONFIG_PPC_SVM to control support for secure guests. Signed-off-by: Ram Pai [ Generate an RTAS os-term hcall when the

Re: [PATCH] powerpc/perf: Use cpumask_last() to determine the

2019-05-20 Thread Madhavan Srinivasan
On 20/05/19 2:35 PM, Anju T Sudhakar wrote: Nest and core imc(In-memory Collection counters) assigns a particular cpu as the designated target for counter data collection. During system boot, the first online cpu in a chip gets assigned as the designated cpu for that chip(for nest-imc) and the

[PATCH 09/12] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-05-20 Thread Thiago Jung Bauermann
From: Sukadev Bhattiprolu Normally, the HV emulates some instructions like MSGSNDP, MSGCLRP from a KVM guest. To emulate the instructions, it must first read the instruction from the guest's memory and decode its parameters. However for a secure guest (aka SVM), the page containing the

[PATCH 08/12] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-05-20 Thread Thiago Jung Bauermann
From: Ryan Grimm User space might want to know it's running in a secure VM. It can't do a mfmsr because mfmsr is a privileged instruction. The solution here is to create a cpu attribute: /sys/devices/system/cpu/svm which will read 0 or 1 based on the S bit of the guest's CPU 0.

[PATCH 05/12] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-05-20 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH 06/12] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-05-20 Thread Thiago Jung Bauermann
From: Anshuman Khandual LPPACA structures need to be shared with the host. Hence they need to be in shared memory. Instead of allocating individual chunks of memory for a given structure from memblock, a contiguous chunk of memory is allocated and then converted into shared memory. Subsequent

[PATCH 11/12] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-05-20 Thread Thiago Jung Bauermann
From: Anshuman Khandual SWIOTLB checks range of incoming CPU addresses to be bounced and sees if the device can access it through its DMA window without requiring bouncing. In such cases it just chooses to skip bouncing. But for cases like secure guests on powerpc platform all addresses need to

Re: [RFC PATCH 02/12] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-05-20 Thread Christoph Hellwig
On Tue, May 21, 2019 at 01:49:02AM -0300, Thiago Jung Bauermann wrote: > From: Benjamin Herrenschmidt > > For secure VMs, the signing tool will create a ticket called the "ESM blob" > for the Enter Secure Mode ultravisor call with the signatures of the kernel > and initrd among other things. >

[PATCH 12/12] powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs

2019-05-20 Thread Thiago Jung Bauermann
From: Ryan Grimm Enables running as a secure guest in platforms with an Ultravisor. Signed-off-by: Ryan Grimm Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/ppc64_defconfig | 1 + arch/powerpc/configs/pseries_defconfig | 1 + 2 files changed, 2

Re: [RFC PATCH v2 07/10] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-05-20 Thread Madhavan Srinivasan
On 18/05/19 7:55 PM, Claudio Carvalho wrote: From: Ram Pai When the ultravisor firmware is available, it takes control over the LDBAR register. In this case, thread-imc updates and save/restore operations on the LDBAR register are handled by ultravisor. we should remove the core and thread

remove asm-generic/ptrace.h v2

2019-05-20 Thread Christoph Hellwig
Hi all, asm-generic/ptrace.h is a little weird in that it doesn't actually implement any functionality, but it provided multiple layers of macros that just implement trivial inline functions. We implement those directly in the few architectures and be off with a much simpler design. Changes

[WIP RFC PATCH 5/6] powerpc/powernv: Remove EFI support for OPAL secure variables

2019-05-20 Thread Daniel Axtens
Replace it with a generic API. Compile tested only. Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/opal-secvar.h | 58 +++ arch/powerpc/platforms/Kconfig | 3 - arch/powerpc/platforms/powernv/Kconfig | 5 +-

Re: [RFC PATCH v2 08/10] KVM: PPC: Ultravisor: Return to UV for hcalls from SVM

2019-05-20 Thread Paul Mackerras
On Sat, May 18, 2019 at 11:25:22AM -0300, Claudio Carvalho wrote: > From: Sukadev Bhattiprolu > > All hcalls from a secure VM go to the ultravisor from where they are > reflected into the HV. When we (HV) complete processing such hcalls, > we should return to the UV rather than to the guest

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Nicholas Piggin
Bharata B Rao's on May 20, 2019 3:56 pm: > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: >> >> > git bisect points to >> >> > >> >> > commit 4231aba000f5a4583dd9f67057aadb68c3eca99d >> >> > Author: Nicholas Piggin >> >> > Date: Fri Jul 27 21:48:17 2018 +1000 >> >> > >> >> >

[PATCH 5/5] asm-generic: remove ptrace.h

2019-05-20 Thread Christoph Hellwig
No one is using this header anymore. Signed-off-by: Christoph Hellwig Acked-by: Arnd Bergmann --- MAINTAINERS| 1 - arch/mips/include/asm/ptrace.h | 5 --- include/asm-generic/ptrace.h | 74 -- 3 files changed, 80 deletions(-) delete

Re: [RFC PATCH v2 09/10] KVM: PPC: Book3S HV: Fixed for running secure guests

2019-05-20 Thread Paul Mackerras
On Sat, May 18, 2019 at 11:25:23AM -0300, Claudio Carvalho wrote: > From: Paul Mackerras > > - Pass SRR1 in r11 for UV_RETURN because SRR0 and SRR1 get set by > the sc 2 instruction. (Note r3 - r10 potentially have hcall return > values in them.) > > - Fix kvmppc_msr_interrupt to preserve

Re: [PATCH] ocxl: Fix potential memory leak on context creation

2019-05-20 Thread Frederic Barrat
Le 20/05/2019 à 03:45, Andrew Donnellan a écrit : On 18/5/19 12:20 am, Frederic Barrat wrote: If we couldn't fully init a context, we were leaking memory. Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") Signed-off-by: Frederic Barrat Acked-by: Andrew

[WIP RFC PATCH 0/6] Generic Firmware Variable Filesystem

2019-05-20 Thread Daniel Axtens
Hi all, As PowerNV moves towards secure boot, we need a place to put secure variables. One option that has been canvassed is to make our secure variables look like EFI variables. This is an early sketch of another approach where we create a generic firmware variable file system, fwvarfs, and an

[WIP RFC PATCH 1/6] kernfs: add create() and unlink() hooks

2019-05-20 Thread Daniel Axtens
I'm building a generic firmware variable filesystem on top of kernfs and I'd like to be able to create and unlink files. The hooks are fairly straightforward. create() returns a kernfs_node*, which is safe with regards to cleanup on error paths, because there is no way that things can fail after

[PATCH 2/5] powerpc: don't use asm-generic/ptrace.h

2019-05-20 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/ptrace.h | 29 ++---

[WIP RFC PATCH 6/6] fwvarfs: Add opal_secvar backend

2019-05-20 Thread Daniel Axtens
COMPILE TESTED ONLY. mount -t fwvarfs opal_secvar /fw Signed-off-by: Daniel Axtens --- Documentation/filesystems/fwvarfs.txt | 3 + fs/fwvarfs/Kconfig| 11 ++ fs/fwvarfs/Makefile | 1 + fs/fwvarfs/fwvarfs.c | 3 +

[PATCH v3 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
The NXP's QorIQ Processors based on ARM Core have RCPM module (Run Control and Power Management), which performs all device-level tasks associated with power management such as wakeup source control. This driver depends on PM wakeup source framework which help to collect wake information.

[PATCH v3 2/3] Documentation: dt: binding: fsl: Add 'little-endian' and update Chassis define

2019-05-20 Thread Ran Wang
By default, QorIQ SoC's RCPM register block is Big Endian. But there are some exceptions, such as LS1088A and LS2088A, are Little Endian. So add this optional property to help identify them. Actually LS2021A and other Layerscapes won't totally follow Chassis 2.1, so separate them from powerpc

[PATCH v3 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-05-20 Thread Ran Wang
Some user might want to go through all registered wakeup sources and doing things accordingly. For example, SoC PM driver might need to do HW programming to prevent powering down specific IP which wakeup source depending on. And is user's responsibility to identify if this wakeup source he is

[PATCH] powerpc: dts: Fix the bug that intx interrupt not work in P1010RDB-PB

2019-05-20 Thread Xiaowei Bao
Due to the INTA is shared with the active-low PHY2 interrupt on P1010RDB-PA board, so configure P1010RDB-PA's INTA with polarity as active-low, the P1010RDB-PB board is used separately, so configure P1010RDB-PB's INTA with polarity as active-high. The INTX in P1010RDB-PB do not work because of the

[PATCH 1/5] arm64: don't use asm-generic/ptrace.h

2019-05-20 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig Acked-by: Catalin Marinas --- arch/arm64/include/asm/ptrace.h | 31

[WIP RFC PATCH 2/6] fwvarfs: a generic firmware variable filesystem

2019-05-20 Thread Daniel Axtens
Sometimes it is helpful to be able to access firmware variables as file, like efivarfs, but not all firmware is EFI. Create a framework that allows generic access to firmware variables exposed by a implementations of a simple backend API. Add a demonstration memory-based backend. Signed-off-by:

[WIP RFC PATCH 3/6] fwvarfs: efi backend

2019-05-20 Thread Daniel Axtens
Add a read-only EFI backend. This does not rely on efivarfs at all (although it does borrow heavily from the code). It only supports reading the variables, but it supports the same format as efivarfs so tools like efivar continue to work if you mount this filesystem in the same place. Two small

[PATCH 4/5] x86: don't use asm-generic/ptrace.h

2019-05-20 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig Acked-by: Ingo Molnar --- arch/x86/include/asm/ptrace.h | 30

[PATCH 3/5] sh: don't use asm-generic/ptrace.h

2019-05-20 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/ptrace.h | 29 + 1

Re: [PATCH] mm: add account_locked_vm utility function

2019-05-20 Thread Alexey Kardashevskiy
On 04/05/2019 06:16, Daniel Jordan wrote: > locked_vm accounting is done roughly the same way in five places, so > unify them in a helper. Standardize the debug prints, which vary > slightly. And I rather liked that prints were different and tell precisely which one of three each printk is.

[WIP RFC PATCH 4/6] powerpc/powernv: Add support for OPAL secure variables

2019-05-20 Thread Daniel Axtens
From: Claudio Carvalho [dja: this is a WIP version - a new version is coming that changes the interface. I also had to renumber the opal calls to get this to apply. Basically, this is an illustration of the concept: more work would be required to get this to actually function.] The X.509

Re: [RFC PATCH v2 07/10] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-05-20 Thread Paul Mackerras
On Sat, May 18, 2019 at 11:25:21AM -0300, Claudio Carvalho wrote: > From: Ram Pai > > When the ultravisor firmware is available, it takes control over the > LDBAR register. In this case, thread-imc updates and save/restore > operations on the LDBAR register are handled by ultravisor. > >

RE: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
Hi Pavel, On Monday, May 20, 2019 05:39, Pavel Machek wrote: > > Hi! > > > > + > > +struct rcpm { > > + unsigned int wakeup_cells; > > + void __iomem *ippdexpcr_base; > > + boollittle_endian; > > +}; > > Inconsistent whitespace OK, will make them aligned. > > > +static int

[PATCH v2] selftests/powerpc: Add a test of bad (out-of-range) accesses

2019-05-20 Thread Michael Ellerman
Userspace isn't allowed to access certain address ranges, make sure we actually test that to at least some degree. This would have caught the recent bug where the SLB fault handler was incorrectly called on an out-of-range access when using the Radix MMU. It also would have caught the bug we had

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-05-20 Thread Michael S. Tsirkin
On Fri, Apr 26, 2019 at 08:56:43PM -0300, Thiago Jung Bauermann wrote: > > Michael S. Tsirkin writes: > > > On Wed, Apr 24, 2019 at 10:01:56PM -0300, Thiago Jung Bauermann wrote: > >> > >> Michael S. Tsirkin writes: > >> > >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann

[PATCH v2] selftests/powerpc: Add a test of bad (out-of-range) accesses

2019-05-20 Thread Michael Ellerman
Userspace isn't allowed to access certain address ranges, make sure we actually test that to at least some degree. This would have caught the recent bug where the SLB fault handler was incorrectly called on an out-of-range access when using the Radix MMU. It also would have caught the bug we had

[PATCH] selftests/powerpc: Add a test of spectre_v2 mitigations

2019-05-20 Thread Michael Ellerman
This test uses the PMU to count branch prediction hits/misses for a known loop, and compare the result to the reported spectre v2 mitigation. This gives us a way of sanity checking that the reported mitigation is actually in effect. Sample output for some cases, eg: Power9: sysfs reports:

Re: Linux 5.1-rc5

2019-05-20 Thread Greg KH
On Thu, May 02, 2019 at 05:10:55PM +0200, Martin Schwidefsky wrote: > On Thu, 2 May 2019 16:31:10 +0200 > Greg KH wrote: > > > On Thu, May 02, 2019 at 04:17:58PM +0200, Martin Schwidefsky wrote: > > > On Thu, 2 May 2019 14:21:28 +0200 > > > Greg KH wrote: > > > > > > > On Mon, Apr 15, 2019

Re: [RFC PATCH 1/4] ftrace: Expose flags used for ftrace_replace_code()

2019-05-20 Thread Steven Rostedt
On Sat, 18 May 2019 00:32:45 +0530 "Naveen N. Rao" wrote: > Since ftrace_replace_code() is a __weak function and can be overridden, > we need to expose the flags that can be set. So, move the flags enum to > the header file. > > Signed-off-by: Naveen N. Rao Reviewed-by: Steven Rostedt

Re: [PATCH v3 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Pavel Machek
Hi! > The NXP's QorIQ Processors based on ARM Core have RCPM module > (Run Control and Power Management), which performs all device-level > tasks associated with power management such as wakeup source control. > > This driver depends on PM wakeup source framework which help to > collect wake

Re: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Pavel Machek
On Mon 2019-05-20 09:03:50, Ran Wang wrote: > Hi Pavel, > > On Monday, May 20, 2019 16:57, Pavel Machek wrote: > > > > Hi! > > > > > > > +static int rcpm_pm_prepare(struct device *dev) { > > > > > + struct device_node *np = dev->of_node; > > > > > + struct wakeup_source *ws; > > > > > +

Re: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Pavel Machek
Hi! > > > > You are right, but the current code is "interesting". What about > > > > > > > > ws = NULL; > > > > while (ws = wakeup_source_get_next(NULL)) ... > > > > > > > > then? > > > > > > Did you mean: > > > ws = NULL; > > > while (ws = wakeup_source_get_next(ws)) ... > > >

[PATCH v4 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
The NXP's QorIQ Processors based on ARM Core have RCPM module (Run Control and Power Management), which performs all device-level tasks associated with power management such as wakeup source control. This driver depends on PM wakeup source framework which help to collect wake information.

[PATCH v4 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-05-20 Thread Ran Wang
Some user might want to go through all registered wakeup sources and doing things accordingly. For example, SoC PM driver might need to do HW programming to prevent powering down specific IP which wakeup source depending on. And is user's responsibility to identify if this wakeup source he is

RE: [PATCH v3 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
Hi Pavel, On Monday, May 20, 2019 15:27: Pavel Machek wrote: > > Hi! > > > The NXP's QorIQ Processors based on ARM Core have RCPM module (Run > > Control and Power Management), which performs all device-level tasks > > associated with power management such as wakeup source control. > > > > This

[PATCH] powerpc/perf: Use cpumask_last() to determine the

2019-05-20 Thread Anju T Sudhakar
Nest and core imc(In-memory Collection counters) assigns a particular cpu as the designated target for counter data collection. During system boot, the first online cpu in a chip gets assigned as the designated cpu for that chip(for nest-imc) and the first online cpu in a core gets assigned as the

Re: [PATCH] kbuild: do not check name uniqueness of builtin modules

2019-05-20 Thread Greg KH
On Mon, May 20, 2019 at 11:54:37AM +0900, Masahiro Yamada wrote: > I just thought it was a good idea to scan builtin.modules in the name > uniqueness checking, but Stephen reported a false positive. > > ppc64_defconfig produces: > > warning: same basename if the following are built as modules:

[PATCH v2] ocxl: Fix potential memory leak on context creation

2019-05-20 Thread Frederic Barrat
If we couldn't fully init a context, we were leaking memory. Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") Signed-off-by: Frederic Barrat --- Changelog: v2: reset context pointer in case of allocation failure (Andrew) drivers/misc/ocxl/context.c | 2 ++ 1 file

[PATCH v2] mm/nvdimm: Pick the right alignment default when creating dax devices

2019-05-20 Thread Aneesh Kumar K.V
Allow arch to provide the supported alignments and use hugepage alignment only if we support hugepage. Right now we depend on compile time configs whereas this patch switch this to runtime discovery. Architectures like ppc64 can have THP enabled in code, but then can have hugepage size disabled

Re: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Pavel Machek
Hi! > > > +static int rcpm_pm_prepare(struct device *dev) { > > > + struct device_node *np = dev->of_node; > > > + struct wakeup_source *ws; > > > + struct rcpm *rcpm; > > > + u32 value[RCPM_WAKEUP_CELL_MAX_SIZE + 1], tmp; > > > + int i, ret; > > > + > > > + rcpm = dev_get_drvdata(dev); > > > +

Re: [RFC PATCH 4/4] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-05-20 Thread Naveen N. Rao
Nicholas Piggin wrote: Naveen N. Rao's on May 18, 2019 5:02 am: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we used to only patch out the branch to _mcount(). However, Nick Piggin points out that

Re: [PATCH] powerpc/perf: Use cpumask_last() to determine the

2019-05-20 Thread Anju T Sudhakar
Hi, Somehow the subject of this patch didn't appear completely here. The Subject of this patch is as follows, `Subject [PATCH] powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.` Thanks, Anju On 5/20/19 2:35 PM, Anju T Sudhakar wrote: Nest and core

Re: [PATCH] kbuild: do not check name uniqueness of builtin modules

2019-05-20 Thread Arnd Bergmann
On Mon, May 20, 2019 at 4:57 AM Masahiro Yamada wrote: > > I just thought it was a good idea to scan builtin.modules in the name > uniqueness checking, but Stephen reported a false positive. > > ppc64_defconfig produces: > > warning: same basename if the following are built as modules: >

[PATCH v4 2/3] Documentation: dt: binding: fsl: Add 'little-endian' and update Chassis define

2019-05-20 Thread Ran Wang
By default, QorIQ SoC's RCPM register block is Big Endian. But there are some exceptions, such as LS1088A and LS2088A, are Little Endian. So add this optional property to help identify them. Actually LS2021A and other Layerscapes won't totally follow Chassis 2.1, so separate them from powerpc

RE: [EXT] Re: [PATCH 2/3] arm64: dts: ls1028a: Add PCIe controller DT nodes

2019-05-20 Thread Xiaowei Bao
Hi Arndt, -Original Message- From: Arnd Bergmann Sent: 2019年5月17日 16:59 To: Xiaowei Bao Cc: Bjorn Helgaas ; Rob Herring ; Mark Rutland ; Shawn Guo ; Leo Li ; Kishon ; Lorenzo Pieralisi ; gregkh ; M.h. Lian ; Mingkai Hu ; Roy Zang ; Kate Stewart ; Philippe Ombredanne ; Shawn Lin ;

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > Bharata B Rao's on May 20, 2019 3:56 pm: > > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: > >> >> > git bisect points to > >> >> > > >> >> > commit 4231aba000f5a4583dd9f67057aadb68c3eca99d > >> >> > Author:

RE: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
Hi Pavel, On Monday, May 20, 2019 16:57, Pavel Machek wrote: > > Hi! > > > > > +static int rcpm_pm_prepare(struct device *dev) { > > > > + struct device_node *np = dev->of_node; > > > > + struct wakeup_source *ws; > > > > + struct rcpm *rcpm; > > > > + u32

Re: [PATCH v2] ocxl: Fix potential memory leak on context creation

2019-05-20 Thread Greg Kurz
On Mon, 20 May 2019 09:16:18 +0200 Frederic Barrat wrote: > If we couldn't fully init a context, we were leaking memory. > > Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") Oops... missed that during review :-\ > Signed-off-by: Frederic Barrat > --- > >

RE: [PATCH V2 3/3] soc: fsl: add RCPM driver

2019-05-20 Thread Ran Wang
Hi Pavel, On Monday, May 20, 2019 17:08 Pavel Machek wrote: > > > Hi! > > > > > > > > > +static int rcpm_pm_prepare(struct device *dev) { > > > > > > + struct device_node *np = dev->of_node; > > > > > > + struct wakeup_source *ws; > > > > > > + struct rcpm *rcpm; > > > > > > + u32

Re: [PATCH v2] ocxl: Fix potential memory leak on context creation

2019-05-20 Thread Andrew Donnellan
Acked-by: Andrew Donnellan On 20/5/19 5:16 pm, Frederic Barrat wrote: If we couldn't fully init a context, we were leaking memory. Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") Signed-off-by: Frederic Barrat --- Changelog: v2: reset context pointer in case of

[PATCH] powerpc/powernv: Return for invalid IMC domain

2019-05-20 Thread Anju T Sudhakar
Currently init_imc_pmu() can be failed either because an IMC unit with invalid domain(i.e an IMC node not supported by the kernel) is attempted a pmu-registration or something went wrong while registering a valid IMC unit. In both the cases kernel provides a 'Registration failed' error message.

Re: [RFC PATCH 2/4] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-05-20 Thread Steven Rostedt
On Mon, 20 May 2019 09:13:20 -0400 Steven Rostedt wrote: > > I haven't yet tested this patch on x86, but this looked wrong so sending > > this as a RFC. > > This code has been through a bit of updates, and I need to go through > and clean it up. I'll have to take a look and convert "int" to

[PATCH v2 2/2] tests: add pidfd_open() tests

2019-05-20 Thread Christian Brauner
This adds testing for the new pidfd_open() syscalls. Specifically, we test: - that no invalid flags can be passed to pidfd_open() - that no invalid pid can be passed to pidfd_open() - that a pidfd can be retrieved with pidfd_open() - that the retrieved pidfd references the correct pid

[PATCH v7 1/1] iommu: enhance IOMMU dma mode build options

2019-05-20 Thread Zhen Lei
First, add build option IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time. The default IOMMU dma modes on each ARCHs have no

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Nicholas Piggin
Bharata B Rao's on May 21, 2019 12:29 am: > On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: >> On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: >> > Bharata B Rao's on May 20, 2019 3:56 pm: >> > > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: >> >

Re: [PATCH v2 1/2] pid: add pidfd_open()

2019-05-20 Thread Arnd Bergmann
On Mon, May 20, 2019 at 4:48 PM Christian Brauner wrote: > > On Mon, May 20, 2019 at 04:37:03PM +0200, Arnd Bergmann wrote: > > On Mon, May 20, 2019 at 3:46 PM Christian Brauner > > wrote: > > > > > > In line with Arnd's recent changes to consolidate syscall numbers across > > > architectures,

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-05-20 Thread Michael S. Tsirkin
On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: > I rephrased it in terms of address translation. What do you think of > this version? The flag name is slightly different too: > > > VIRTIO_F_ACCESS_PLATFORM_NO_TRANSLATION This feature has the same > meaning as

Re: [RFC PATCH 2/4] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-05-20 Thread Steven Rostedt
On Sat, 18 May 2019 00:32:46 +0530 "Naveen N. Rao" wrote: > In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be > schedulable), the generic ftrace_replace_code() function was modified to > accept a flags argument in place of a single 'enable' flag. However, the > x86 version of

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: > On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > > Bharata B Rao's on May 20, 2019 3:56 pm: > > > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: > > >> >> > git bisect points to > > >> >> > > > >>

Re: [RFC PATCH 2/4] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-05-20 Thread Naveen N. Rao
Hi Steven, Steven Rostedt wrote: On Mon, 20 May 2019 09:13:20 -0400 Steven Rostedt wrote: > I haven't yet tested this patch on x86, but this looked wrong so sending > this as a RFC. This code has been through a bit of updates, and I need to go through and clean it up. I'll have to take

[PATCH 10/10] docs: fix broken documentation links

2019-05-20 Thread Mauro Carvalho Chehab
Mostly due to x86 and acpi conversion, several documentation links are still pointing to the old file. Fix them. Signed-off-by: Mauro Carvalho Chehab --- Documentation/acpi/dsd/leds.txt | 2 +- Documentation/admin-guide/kernel-parameters.rst | 6 +++---

Re: [RFC PATCH 2/4] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-05-20 Thread Steven Rostedt
On Mon, 20 May 2019 20:12:48 +0530 "Naveen N. Rao" wrote: > Thanks, that definitely helps make things clearer. A very small nit from > your first patch -- it would be good to also convert the calls to > ftrace_check_record() to use 'true' or 'false' for the 'update' field. Heh, I was so

[PATCH] misc: remove redundant 'default n' from Kconfig-s

2019-05-20 Thread Bartlomiej Zolnierkiewicz
'default n' is the default value for any bool or tristate Kconfig setting so there is no need to write it explicitly. Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols") the Kconfig behavior is the same regardless of 'default n' being present or

Re: [PATCH 1/3] powerpc/pseries: Simplify cpu readd to use drc_index

2019-05-20 Thread Nathan Lynch
Tyrel Datwyler writes: > On 05/16/2019 12:17 PM, Nathan Lynch wrote: >> Tyrel Datwyler writes: >>> The current dlpar_cpu_readd() takes in a cpu_id and uses that to look up >>> the cpus device_node so that we can get at the ibm,my-drc-index >>> property. The only user of cpu readd is an OF

[PATCH v2 1/2] pid: add pidfd_open()

2019-05-20 Thread Christian Brauner
This adds the pidfd_open() syscall. It allows a caller to retrieve pollable pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a process that is created via traditional fork()/clone() calls that is only referenced by a PID: int pidfd = pidfd_open(1234, 0); ret =

[PATCH v7 0/1] iommu: enhance IOMMU dma mode build options

2019-05-20 Thread Zhen Lei
v6 --> v7: 1. Fix some text editing errors v5 --> v6: 1. give up adding boot option iommu.dma_mode v4 --> v5: As Hanjun and Thomas Gleixner's suggestion: 1. Keep the old ARCH specific boot options no change. 2. Keep build option CONFIG_IOMMU_DEFAULT_PASSTHROUGH no change. v4: As Robin Murphy's

Re: [PATCH v2 1/2] pid: add pidfd_open()

2019-05-20 Thread Geert Uytterhoeven
On Mon, May 20, 2019 at 3:46 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only >

Re: [PATCH v2 1/2] pid: add pidfd_open()

2019-05-20 Thread Arnd Bergmann
On Mon, May 20, 2019 at 3:46 PM Christian Brauner wrote: > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. Thanks! I've checked that the ones you have added are all done

Re: [PATCH v2 1/2] pid: add pidfd_open()

2019-05-20 Thread Christian Brauner
On Mon, May 20, 2019 at 04:37:03PM +0200, Arnd Bergmann wrote: > On Mon, May 20, 2019 at 3:46 PM Christian Brauner > wrote: > > > > In line with Arnd's recent changes to consolidate syscall numbers across > > architectures, I have added the pidfd_open() syscall to all architectures > > at the

Re: [PATCH] misc: remove redundant 'default n' from Kconfig-s

2019-05-20 Thread Michał Mirosław
On Mon, May 20, 2019 at 04:10:46PM +0200, Bartlomiej Zolnierkiewicz wrote: > 'default n' is the default value for any bool or tristate Kconfig > setting so there is no need to write it explicitly. > > Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO > is not set' for visible

Re: [PATCH 4/5] x86: don't use asm-generic/ptrace.h

2019-05-20 Thread Oleg Nesterov
On 05/20, Christoph Hellwig wrote: > > Doing the indirection through macros for the regs accessors just > makes them harder to read, so implement the helpers directly. Acked-by: Oleg Nesterov

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Aneesh Kumar K.V
On 5/20/19 8:25 PM, Nicholas Piggin wrote: Bharata B Rao's on May 21, 2019 12:29 am: On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: Bharata B Rao's on May 20, 2019 3:56 pm: On Mon, May 20, 2019 at 02:48:35PM

[PATCH v3 2/2] tests: add pidfd_open() tests

2019-05-20 Thread Christian Brauner
This adds testing for the new pidfd_open() syscalls. Specifically, we test: - that no invalid flags can be passed to pidfd_open() - that no invalid pid can be passed to pidfd_open() - that a pidfd can be retrieved with pidfd_open() - that the retrieved pidfd references the correct pid

[PATCH] crypto: vmx - convert to SPDX license identifiers

2019-05-20 Thread Eric Biggers
From: Eric Biggers Remove the boilerplate license text and replace it with the equivalent SPDX license identifier. Signed-off-by: Eric Biggers --- drivers/crypto/vmx/aes.c | 14 +- drivers/crypto/vmx/aes_cbc.c | 14 +- drivers/crypto/vmx/aes_ctr.c | 14

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Tue, May 21, 2019 at 12:55:49AM +1000, Nicholas Piggin wrote: > Bharata B Rao's on May 21, 2019 12:29 am: > > On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: > >> On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > >> > Bharata B Rao's on May 20, 2019 3:56 pm: > >>

Re: [PATCH] mm: add account_locked_vm utility function

2019-05-20 Thread Daniel Jordan
On Mon, May 20, 2019 at 04:19:34PM +1000, Alexey Kardashevskiy wrote: > On 04/05/2019 06:16, Daniel Jordan wrote: > > locked_vm accounting is done roughly the same way in five places, so > > unify them in a helper. Standardize the debug prints, which vary > > slightly. > > And I rather liked

[PATCH v3 1/2] pid: add pidfd_open()

2019-05-20 Thread Christian Brauner
This adds the pidfd_open() syscall. It allows a caller to retrieve pollable pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a process that is created via traditional fork()/clone() calls that is only referenced by a PID: int pidfd = pidfd_open(1234, 0); ret =

Re: [PATCH 5/5] asm-generic: remove ptrace.h

2019-05-20 Thread Oleg Nesterov
On 05/20, Christoph Hellwig wrote: > > No one is using this header anymore. > > Signed-off-by: Christoph Hellwig > Acked-by: Arnd Bergmann > --- > MAINTAINERS| 1 - > arch/mips/include/asm/ptrace.h | 5 --- > include/asm-generic/ptrace.h | 74

  1   2   >