[PATCH] powerpc/64s/exception: Fix kaup -> kuap typo

2019-10-22 Thread Andrew Donnellan
It's KUAP, not KAUP. Fix typo in INT_COMMON macro. Signed-off-by: Andrew Donnellan --- arch/powerpc/kernel/exceptions-64s.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

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

2019-10-22 Thread Ran Wang
The NXP's QorIQ Processors based on ARM Core have RCPM module (Run Control and Power Management), which performs system 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 v2 1/1] pseries/hotplug-cpu: Change default behaviour of cede_offline to "off"

2019-10-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently on PSeries Linux guests, the offlined CPU can be put to one of the following two states: - Long term processor cede (also called extended cede) - Returned to the hypervisor via RTAS "stop-self" call. This is controlled by the kernel boot parameter

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

2019-10-22 Thread Rafael J. Wysocki
On Tue, Oct 22, 2019 at 9:51 AM Ran Wang wrote: > > 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. So add this

Re: [PATCH] powerpc/64s/exception: Fix kaup -> kuap typo

2019-10-22 Thread Russell Currey
On Tue, 2019-10-22 at 17:06 +1100, Andrew Donnellan wrote: > It's KUAP, not KAUP. Fix typo in INT_COMMON macro. > > Signed-off-by: Andrew Donnellan Akced-by: Russell Currey

[PATCH 2/3] ocxl: Add pseries-specific code

2019-10-22 Thread christophe lombard
pseries.c implements the guest-specific callbacks for the backend API. The hypervisor calls provide an interface to configure and interact with OpenCAPI devices. It matches the last version of the 'PAPR changes' document. The following hcalls are supported: H_OCXL_CONFIG_ADAPTER Used to

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-22 Thread Segher Boessenkool
On Mon, Oct 21, 2019 at 10:15:29PM -0700, Nathan Chancellor wrote: > On Fri, Oct 18, 2019 at 03:02:10PM -0500, Segher Boessenkool wrote: > > I think the proper solution is for the kernel to *do* use -ffreestanding, > > and then somehow tell the kernel that memcpy etc. are the standard > >

[PATCH 1/3] ocxl: Introduce implementation-specific API

2019-10-22 Thread christophe lombard
The backend API (in ocxl.h) lists some low-level functions whose implementation is different on bare-metal and in a guest. Each environment implements its own functions, and the common code uses them through function pointers, defined in ocxl_backend_ops A new powernv.c file is created to call

[PATCH 3/3] powerpc/pseries: Fixup config space size of OpenCAPI devices

2019-10-22 Thread christophe lombard
Fix up the pci config size of the OpenCAPI PCIe devices in the pseries environment. Most of OpenCAPI PCIe devices have 4096 bytes of configuration space. Signed-off-by: Christophe Lombard --- arch/powerpc/platforms/pseries/pci.c | 9 + 1 file changed, 9 insertions(+) diff --git

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

2019-10-22 Thread Rafael J. Wysocki
On Tue, Oct 22, 2019 at 9:52 AM Ran Wang wrote: > > The NXP's QorIQ Processors based on ARM Core have RCPM module > (Run Control and Power Management), which performs system level > tasks associated with power management such as wakeup source control. > > This driver depends on PM wakeup source

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

2019-10-22 Thread Anshuman Khandual
On 10/22/2019 12:41 PM, Christophe Leroy wrote: > > > On 10/21/2019 02:42 AM, Anshuman Khandual wrote: >> This adds tests which will validate architecture page table helpers and >> other accessors in their compliance with expected generic MM semantics. >> This will help various architectures

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-10-22 Thread Bharata B Rao
On Fri, Oct 18, 2019 at 8:31 AM Paul Mackerras wrote: > > On Wed, Sep 25, 2019 at 10:36:43AM +0530, Bharata B Rao wrote: > > Manage migration of pages betwen normal and secure memory of secure > > guest by implementing H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > > > H_SVM_PAGE_IN: Move the

[PATCH 0/3] ocxl: Support for an 0penCAPI device in a QEMU guest.

2019-10-22 Thread christophe lombard
This series adds support for an 0penCAPI device in a QEMU guest. It builds on top of the existing ocxl driver + http://patchwork.ozlabs.org/patch/1177999/ The ocxl module registers either a pci driver or a platform driver, based on the environment (bare-metal (powernv) or pseries). Roughly 4/5

Re: [PATCH 0/7] towards QE support on ARM

2019-10-22 Thread Rasmus Villemoes
On 22/10/2019 00.11, Li Yang wrote: > On Mon, Oct 21, 2019 at 3:46 AM Rasmus Villemoes > wrote: >> >>> Can you try the 4.14 branch from a newer LSDK release? LS1021a should >>> be supported platform on LSDK. If it is broken, something is wrong. >> >> What newer release? LSDK-18.06-V4.14 is the

[PATCH v2 0/1] pseries/hotplug: Change the default behaviour of cede_offline

2019-10-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" This is the v2 of the fix to change the default behaviour of cede_offline. The previous version can be found here: https://lkml.org/lkml/2019/9/12/222 The main change from v1 is that the patch2 to create a sysfs file to report and control the value of

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

2019-10-22 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. So add this API to help walk through all registered wakeup source objects

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-22 Thread Christophe Leroy
Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : On Mon, 21 Oct 2019, Christophe Leroy wrote: This is a tentative to switch powerpc/32 vdso to generic C implementation. It will likely not work on 64 bits or even build properly at the moment. powerpc is a bit special for VDSO as well as

[PATCH] powerpc/powernv/prd: Allow copying partial data to user space

2019-10-22 Thread Vasant Hegde
Allow copying partial data to user space. So that opal-prd daemon can read message size, reallocate memory and make read call to get rest of the data. Cc: Jeremy Kerr Cc: Vaidyanathan Srinivasan Signed-off-by: Vasant Hegde --- arch/powerpc/platforms/powernv/opal-prd.c | 27

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-22 Thread Christophe Leroy
Le 22/10/2019 à 11:01, Christophe Leroy a écrit : Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : On Mon, 21 Oct 2019, Christophe Leroy wrote: This is a tentative to switch powerpc/32 vdso to generic C implementation. It will likely not work on 64 bits or even build properly at the

[PATCH] powerpc/powernv: Fix CPU idle to be called with IRQs disabled

2019-10-22 Thread Nicholas Piggin
Commit e78a7614f3876 ("idle: Prevent late-arriving interrupts from disrupting offline") changes arch_cpu_idle_dead to be called with interrupts disabled, which triggers the WARN in pnv_smp_cpu_kill_self. Fix this by fixing up irq_happened after hard disabling, rather than requiring there are no

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

2019-10-22 Thread Christophe Leroy
On 10/21/2019 02:42 AM, Anshuman Khandual wrote: This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or

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

2019-10-22 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: [PATCH 0/7] towards QE support on ARM

2019-10-22 Thread Rasmus Villemoes
On 22/10/2019 04.24, Qiang Zhao wrote: > On Mon, Oct 22, 2019 at 6:11 AM Leo Li wrote >> Right. I'm really interested in getting this applied to my tree and make it >> upstream. Zhao Qiang, can you help to review Rasmus's patches and >> comment? > > As you know, I maintained a similar patchset

Re: [PATCH RFC v1 07/12] staging: kpc2000: Prepare transfer_complete_cb() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
On 22.10.19 19:55, Matt Sickler wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. The pages are obtained via get_user_pages_fast(). I assume, these could be ZONE_DEVICE pages. Let's just exclude them as well explicitly. I'm not sure what ZONE_DEVICE

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-22 Thread Dan Williams
Hi David, Thanks for tackling this! On Tue, Oct 22, 2019 at 10:13 AM David Hildenbrand wrote: > > This series is based on [2], which should pop up in linux/next soon: > https://lkml.org/lkml/2019/10/21/1034 > > This is the result of a recent discussion with Michal ([1], [2]). Right >

[PATCH RFC v1 04/12] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable check whether the memmap was initialized and can be touched. pfn_to_online_page() makes sure that we

[PATCH RFC v1 06/12] staging/gasket: Prepare gasket_release_page() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. The pages are obtained via get_user_pages_fast(). I assume, these could be ZONE_DEVICE pages. Let's just exclude them as well explicitly. Cc: Rob Springer Cc: Todd Poynor Cc: Ben Chan Cc: Greg Kroah-Hartman

[PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-22 Thread David Hildenbrand
This series is based on [2], which should pop up in linux/next soon: https://lkml.org/lkml/2019/10/21/1034 This is the result of a recent discussion with Michal ([1], [2]). Right now we set all pages PG_reserved when initializing hotplugged memmaps. This includes ZONE_DEVICE memory. In

Re: [PATCH 3/7] soc: fsl: qe: avoid ppc-specific io accessors

2019-10-22 Thread Christophe Leroy
On 10/18/2019 12:52 PM, Rasmus Villemoes wrote: In preparation for allowing to build QE support for architectures other than PPC, replace the ppc-specific io accessors. Done via This patch is not transparent in terms of performance, functions get changed significantly. Before the patch:

Re: [PATCH 0/7] towards QE support on ARM

2019-10-22 Thread Christophe Leroy
On 10/18/2019 12:52 PM, Rasmus Villemoes wrote: There have been several attempts in the past few years to allow building the QUICC engine drivers for platforms other than PPC. This is (the beginning of) yet another attempt. I hope I can get someone to pick up these relatively trivial patches

[PATCH RFC v1 07/12] staging: kpc2000: Prepare transfer_complete_cb() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. The pages are obtained via get_user_pages_fast(). I assume, these could be ZONE_DEVICE pages. Let's just exclude them as well explicitly. Cc: Greg Kroah-Hartman Cc: Vandana BN Cc: "Simon Sandström" Cc: Dan

[PATCH RFC v1 01/12] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes

2019-10-22 Thread David Hildenbrand
Our onlining/offlining code is unnecessarily complicated. Only memory blocks added during boot can have holes. Hotplugged memory never has holes. That memory is already online. When we stop allowing to offline memory blocks with holes, we implicitly stop to online memory blocks with holes. This

[PATCH RFC v1 09/12] powerpc/64s: Prepare hash_page_do_lazy_icache() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. We could explicitly check for is_zone_device_page(page). But looking at the pfn_valid() check, it seems safer to just use pfn_to_online_page() here, that will skip all ZONE_DEVICE pages right away. Cc: Benjamin

[PATCH RFC v1 12/12] mm/memory_hotplug: Don't mark pages PG_reserved when initializing the memmap

2019-10-22 Thread David Hildenbrand
Everything should be prepared to stop setting pages PG_reserved when initializing the memmap on memory hotplug. Most importantly, we stop marking ZONE_DEVICE pages PG_reserved. a) We made sure that any code that relied on PG_reserved to detect ZONE_DEVICE memory will no longer rely on

[PATCH RFC v1 08/12] powerpc/book3s: Prepare kvmppc_book3s_instantiate_page() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable check whether the memmap was initialized and can be touched. pfn_to_online_page() makes sure that we

[PATCH RFC v1 05/12] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable check whether the memmap was initialized and can be touched. pfn_to_online_page() makes sure that we

RE: [PATCH RFC v1 07/12] staging: kpc2000: Prepare transfer_complete_cb() for PG_reserved changes

2019-10-22 Thread Matt Sickler
>Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change >that. > >The pages are obtained via get_user_pages_fast(). I assume, these could be >ZONE_DEVICE pages. Let's just exclude them as well explicitly. I'm not sure what ZONE_DEVICE pages are, but these pages are normal

[PATCH RFC v1 03/12] KVM: x86/mmu: Prepare kvm_is_mmio_pfn() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable check whether the memmap was initialized and can be touched. pfn_to_online_page() makes sure that we

[PATCH RFC v1 10/12] powerpc/mm: Prepare maybe_pte_to_page() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. We could explicitly check for is_zone_device_page(page). But looking at the pfn_valid() check, it seems safer to just use pfn_to_online_page() here, that will skip all ZONE_DEVICE pages right away. Cc: Benjamin

[PATCH RFC v1 11/12] x86/mm: Prepare __ioremap_check_ram() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. We could explicitly check for is_zone_device_page(page). But looking at the pfn_valid() check, it seems safer to just use pfn_to_online_page() here, that will skip all ZONE_DEVICE pages right away. Cc: Dave Hansen

[PATCH RFC v1 02/12] mm/usercopy.c: Prepare check_page_span() for PG_reserved changes

2019-10-22 Thread David Hildenbrand
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. Let's make sure that the logic in the function won't change. Once we no longer set these pages to reserved, we can rework this function to perform separate checks for ZONE_DEVICE (split from PG_reserved checks). Cc:

Re: [PATCH v8 3/8] powerpc: detect the trusted boot state of the system

2019-10-22 Thread Michael Ellerman
Nayna Jain writes: > diff --git a/arch/powerpc/kernel/secure_boot.c > b/arch/powerpc/kernel/secure_boot.c > index 99bba7915629..9753470ab08a 100644 > --- a/arch/powerpc/kernel/secure_boot.c > +++ b/arch/powerpc/kernel/secure_boot.c > @@ -28,3 +39,16 @@ bool is_ppc_secureboot_enabled(void) >

Re: [PATCH v8 1/8] powerpc: detect the secure boot mode of the system

2019-10-22 Thread Michael Ellerman
Nayna Jain writes: > diff --git a/arch/powerpc/kernel/secure_boot.c > b/arch/powerpc/kernel/secure_boot.c > new file mode 100644 > index ..99bba7915629 > --- /dev/null > +++ b/arch/powerpc/kernel/secure_boot.c > @@ -0,0 +1,30 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + *

[PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-22 Thread Oliver O'Halloran
When booting under OF the zImage expects the initrd address and size to be passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU) currently doesn't do this so the zImage is not aware of the initrd location. This can result in initrd corruption either though the zImage

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-10-22 Thread Scott Wood
On Mon, 2019-10-21 at 11:34 +0800, Jason Yan wrote: > > On 2019/10/10 2:46, Scott Wood wrote: > > On Wed, 2019-10-09 at 16:41 +0800, Jason Yan wrote: > > > Hi Scott, > > > > > > On 2019/10/9 15:13, Scott Wood wrote: > > > > On Wed, 2019-10-09 at 14:10 +0800, Jason Yan wrote: > > > > > Hi Scott,

Pull request: scottwood/linux.git next

2019-10-22 Thread Scott Wood
This contains KASLR support for book3e 32-bit. The following changes since commit 612ee81b9461475b5a5612c2e8d71559dd3c7920: powerpc/papr_scm: Fix an off-by-one check in papr_scm_meta_{get, set} (2019-10-10 20:15:53 +1100) are available in the Git repository at:

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-10-22 Thread Paul Mackerras
On Tue, Oct 22, 2019 at 11:59:35AM +0530, Bharata B Rao wrote: > On Fri, Oct 18, 2019 at 8:31 AM Paul Mackerras wrote: > > > > On Wed, Sep 25, 2019 at 10:36:43AM +0530, Bharata B Rao wrote: > > > Manage migration of pages betwen normal and secure memory of secure > > > guest by implementing

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-10-22 Thread Bharata B Rao
On Wed, Oct 23, 2019 at 03:17:54PM +1100, Paul Mackerras wrote: > On Tue, Oct 22, 2019 at 11:59:35AM +0530, Bharata B Rao wrote: > The mapping of pages in userspace memory, and the mapping of userspace > memory to guest physical space, are two distinct things. The memslots > describe the mapping

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-22 Thread Michael Ellerman
Russell King - ARM Linux admin writes: > On Tue, Oct 15, 2019 at 03:12:49PM +0200, Christian Zigotzky wrote: >> Hello Russell, >> >> You asked me about "dma-coherent" in the Cyrus device tree. Unfortunately I >> don't find the property "dma-coherent" in the dtb source files. >> >> Output of

Re: [PATCH v3 1/4] powerpc/mm: Implement set_memory() routines

2019-10-22 Thread Michael Ellerman
Russell Currey writes: > diff --git a/arch/powerpc/mm/pageattr.c b/arch/powerpc/mm/pageattr.c > new file mode 100644 > index ..fe3ecbfb8e10 > --- /dev/null > +++ b/arch/powerpc/mm/pageattr.c > @@ -0,0 +1,60 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +/* > + * MMU-generic

RE: [PATCH 0/7] towards QE support on ARM

2019-10-22 Thread Qiang Zhao
On 22/10/2019 18:18, Rasmus Villemoes wrote: > -Original Message- > From: Rasmus Villemoes > Sent: 2019年10月22日 18:18 > To: Qiang Zhao ; Leo Li > Cc: Timur Tabi ; Greg Kroah-Hartman > ; linux-ker...@vger.kernel.org; > linux-ser...@vger.kernel.org; Jiri Slaby ; >