[PATCH] powerpc: Add barrier_nospec to raw_copy_in_user()

2019-03-05 Thread Suraj Jitindar Singh
Commit ddf35cf3764b ("powerpc: Use barrier_nospec in copy_from_user()") Added barrier_nospec before loading from user-controller pointers. The intention was to order the load from the potentially user-controlled pointer vs a previous branch based on an access_ok() check or similar. In order to

Re: [PATCH 0/2] PCI/AER: Consistently use _OSC to determine who owns AER

2019-03-05 Thread Bjorn Helgaas
On Thu, Nov 15, 2018 at 05:16:01PM -0600, Alexandru Gagniuc wrote: > Thanks to Keith for pointing out that it doesn't make sense to disable > AER services when only one device has a FIRMWARE_FIRST HEST. > > AER ownership is an interesting issue brought in by FFS (firmware-first) > model. In a

[PATCH 5/7] powerpc/8xx: Add Kernel Userspace Access Protection

2019-03-05 Thread Christophe Leroy
This patch adds Kernel Userspace Access Protection on the 8xx. When a page is RO or RW, it is set RO or RW for Key 0 and NA for Key 1. Up to now, the User group is defined with Key 0 for both User and Supervisor. By changing the group to Key 0 for User and Key 1 for Supervisor, this patch

[PATCH 7/7] powerpc/book3s32: Implement Kernel Userspace Access Protection

2019-03-05 Thread Christophe Leroy
This patch implements Kernel Userspace Access Protection for book3s/32. Due to limitations of the processor page protection capabilities, the protection is only against writing. read protection cannot be achieved using page protection. The previous patch modifies the page protection so that RW

[PATCH 6/7] powerpc/book3s32: Prepare Kernel Userspace Access Protection

2019-03-05 Thread Christophe Leroy
This patch prepares Kernel Userspace Access Protection for book3s/32. Due to limitations of the processor page protection capabilities, the protection is only against writing. read protection cannot be achieved using page protection. book3s/32 provides the following values for PP bits: PP00

[PATCH 4/7] powerpc/32: Prepare for Kernel Userspace Access Protection

2019-03-05 Thread Christophe Leroy
This patch adds ASM macros for saving, restoring and checking the KUAP state, and modifies setup_32 to call them on exceptions from kernel. The macros are defined as empty by default for when CONFIG_PPC_KUAP is not selected and/or for platforms which don't handle (yet) KUAP. Signed-off-by:

[PATCH 0/7] Kernel Userspace protection for PPC32

2019-03-05 Thread Christophe Leroy
This series intend to implement Kernel Userspace protection for PPC32. It comes on top of the v4 series for Radix. Christophe Leroy (6): powerpc/8xx: Only define APG0 and APG1 powerpc/8xx: Add Kernel Userspace Execution Prevention powerpc/32: Prepare for Kernel Userspace Access Protection

[PATCH 1/7] powerpc/64s: Implement KUAP for Radix MMU (SQUASH)

2019-03-05 Thread Christophe Leroy
Squashed version of the v4 series, not intended to be merged as is. Signed-off-by: Christophe Leroy --- Documentation/admin-guide/kernel-parameters.txt | 4 +- arch/powerpc/include/asm/book3s/64/kup-radix.h | 79 + arch/powerpc/include/asm/exception-64s.h| 2 +

[PATCH 3/7] powerpc/8xx: Add Kernel Userspace Execution Prevention

2019-03-05 Thread Christophe Leroy
This patch adds Kernel Userspace Execution Prevention on the 8xx. When a page is Executable, it is set Executable for Key 0 and NX for Key 1. Up to now, the User group is defined with Key 0 for both User and Supervisor. By changing the group to Key 0 for User and Key 1 for Supervisor, this

[PATCH 2/7] powerpc/8xx: Only define APG0 and APG1

2019-03-05 Thread Christophe Leroy
Since the 8xx implements hardware page table walk assistance, the PGD entries always point to a 4k aligned page, so the 2 upper bit of the APG are not clobbered anymore and remain 0. Therefore only APG0 and APG1 are used and need a definition. We set the other APG to the lowest permission level.

Re: [PATCH RFC v4 3/9] powerpc/pci: Create pci_dn on demand

2019-03-05 Thread Sergey Miroshnichenko
On 3/5/19 11:04 AM, Oliver wrote: > On Sat, Mar 2, 2019 at 3:04 AM Sergey Miroshnichenko > wrote: >> >> If a struct pci_dn hasn't yet been created for the PCIe device (there was >> no DT node for it), allocate this structure and fill with info read from >> the device directly. >> >>

Re: [PATCH RFC v4 2/9] powerpc/powernv/pci: Suppress an EEH error when reading an empty slot

2019-03-05 Thread Sergey Miroshnichenko
On 3/5/19 9:14 AM, Oliver wrote: > On Sat, Mar 2, 2019 at 3:04 AM Sergey Miroshnichenko > wrote: >> >> Reading an empty slot returns all ones, which triggers a false >> EEH error event on PowerNV. This patch unfreezes the bus where >> it has happened. >> >> Signed-off-by: Sergey Miroshnichenko

REPOST [PATCH v04] powerpc/numa: Perform full re-add of CPU for PRRN/VPHN topology update

2019-03-05 Thread Michael Bringmann
On pseries systems, performing changes to a partition's affinity can result in altering the nodes a CPU is assigned to the current system. For example, some systems are subject to resource balancing operations by the operator or control software. In such environments, system CPUs may be in node

[PATCH v2] powerpc: Disable kcov for slb routines.

2019-03-05 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar The kcov instrumentation inside SLB routines causes duplicate SLB entries to be added resulting into SLB multihit machine checks. Disable kcov instrumentation on slb.o Signed-off-by: Mahesh Salgaonkar Acked-by: Andrew Donnellan --- Change in v2: - Add comment as

Re: [RFC v3] sched/topology: fix kernel crash when a CPU is hotplugged in a memoryless node

2019-03-05 Thread Peter Zijlstra
On Mon, Mar 04, 2019 at 08:59:52PM +0100, Laurent Vivier wrote: > This happens because initially powerpc code computes > sched_domains_numa_masks of offline nodes as if they were merged with > node 0 (because firmware doesn't provide the distance information for > memoryless/cpuless nodes): > >

Re: [PATCH RFC v4 3/9] powerpc/pci: Create pci_dn on demand

2019-03-05 Thread Oliver
On Sat, Mar 2, 2019 at 3:04 AM Sergey Miroshnichenko wrote: > > If a struct pci_dn hasn't yet been created for the PCIe device (there was > no DT node for it), allocate this structure and fill with info read from > the device directly. > > Signed-off-by: Sergey Miroshnichenko > --- >