powerpc flush_inval_dcache_range() was buggy until v5.3-rc1 (was Re: [PATCH 4/4] powerpc/64: reuse PPC32 static inline flush_dcache_range())

2019-08-07 Thread Michael Ellerman
[ deliberately broke threading so this doesn't get buried ] Christophe Leroy writes: > diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S > index a4fd536efb44..1b0a42c50ef1 100644 > --- a/arch/powerpc/kernel/misc_64.S > +++ b/arch/powerpc/kernel/misc_64.S > @@ -115,35 +115

Re: [PATCH v5 06/10] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-08-07 Thread Jason Yan
On 2019/8/7 21:04, Michael Ellerman wrote: Jason Yan writes: This patch add support to boot kernel from places other than KERNELBASE. Since CONFIG_RELOCATABLE has already supported, what we need to do is map or copy kernel to a proper place and relocate. Freescale Book-E parts expect lowmem

Re: [PATCH v2 09/44] powerpc/64s/pseries: machine check convert to use common event code

2019-08-07 Thread kbuild test robot
Hi Nicholas, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [cannot apply to v5.3-rc3 next-20190807] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits

Re: [PATCH] powerpc/fadump: sysfs for fadump memory reservation

2019-08-07 Thread Sourabh Jain
On 8/7/19 8:40 AM, Michael Ellerman wrote: > Sourabh Jain writes: >> Add a sys interface to allow querying the memory reserved by fadump >> for saving the crash dump. >> >> Signed-off-by: Sourabh Jain >> --- >> Documentation/powerpc/firmware-assisted-dump.rst | 5 + >> arch/powerpc/kerne

Re: [PATCH v3 38/41] powerpc: convert put_page() to put_user_page*()

2019-08-07 Thread Michael Ellerman
Hi John, john.hubb...@gmail.com writes: > diff --git a/arch/powerpc/mm/book3s64/iommu_api.c > b/arch/powerpc/mm/book3s64/iommu_api.c > index b056cae3388b..e126193ba295 100644 > --- a/arch/powerpc/mm/book3s64/iommu_api.c > +++ b/arch/powerpc/mm/book3s64/iommu_api.c > @@ -203,6 +202,7 @@ static voi

Re: [PATCH v2 09/44] powerpc/64s/pseries: machine check convert to use common event code

2019-08-07 Thread kbuild test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [cannot apply to v5.3-rc3 next-20190807] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits

Re: [PATCH v5 03/10] powerpc: introduce kimage_vaddr to store the kernel base

2019-08-07 Thread Jason Yan
On 2019/8/7 21:03, Michael Ellerman wrote: Jason Yan writes: Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we need a variable to store the kernel base. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt

[PATCH v5 7/7] powerpc/kvm: Use UV_RETURN ucall to return to ultravisor

2019-08-07 Thread Claudio Carvalho
From: Sukadev Bhattiprolu When an SVM makes an hypercall or incurs some other exception, the Ultravisor usually forwards (a.k.a. reflects) the exceptions to the Hypervisor. After processing the exception, Hypervisor uses the UV_RETURN ultracall to return control back to the SVM. The expected reg

[PATCH v5 6/7] powerpc/powernv: Access LDBAR only if ultravisor disabled

2019-08-07 Thread Claudio Carvalho
LDBAR is a per-thread SPR populated and used by the thread-imc pmu driver to dump the data counter into memory. It contains memory along with few other configuration bits. LDBAR is populated and enabled only when any of the thread imc pmu events are monitored. In ultravisor enabled systems, LDBAR

[PATCH v5 5/7] powerpc/mm: Write to PTCR only if ultravisor disabled

2019-08-07 Thread Claudio Carvalho
In ultravisor enabled systems, PTCR becomes ultravisor privileged only for writing and an attempt to write to it will cause a Hypervisor Emulation Assitance interrupt. This patch adds the try_set_ptcr(val) macro as an accessor to mtspr(SPRN_PTCR, val), which will be executed only if ultravisor dis

[PATCH v5 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-07 Thread Claudio Carvalho
From: Michael Anderson In ultravisor enabled systems, the ultravisor creates and maintains the partition table in secure memory where the hypervisor cannot access, and therefore, the hypervisor have to do the UV_WRITE_PATE ucall whenever it wants to set a partition table entry (PATE). This patch

[PATCH v5 3/7] powerpc/powernv: Introduce FW_FEATURE_ULTRAVISOR

2019-08-07 Thread Claudio Carvalho
In PEF enabled systems, some of the resources which were previously hypervisor privileged are now ultravisor privileged and controlled by the ultravisor firmware. This adds FW_FEATURE_ULTRAVISOR to indicate if PEF is enabled. The host kernel can use FW_FEATURE_ULTRAVISOR, for instance, to skip ac

[PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-07 Thread Claudio Carvalho
The ultracalls (ucalls for short) allow the Secure Virtual Machines (SVM)s and hypervisor to request services from the ultravisor such as accessing a register or memory region that can only be accessed when running in ultravisor-privileged mode. This patch adds the ucall_norets() ultravisor call h

[PATCH v5 1/7] Documentation/powerpc: Ultravisor API

2019-08-07 Thread Claudio Carvalho
From: Sukadev Bhattiprolu POWER9 processor includes support for Protected Execution Facility (PEF). Attached documentation provides an overview of PEF and defines the API for various interfaces that must be implemented in the Ultravisor firmware as well as in the KVM Hypervisor. Based on input f

[PATCH v5 0/7] kvmppc: Paravirtualize KVM to support ultravisor

2019-08-07 Thread Claudio Carvalho
Protected Execution Facility (PEF) is an architectural change for POWER 9 that enables Secure Virtual Machines (SVMs). When enabled, PEF adds a new higher privileged mode, called Ultravisor mode, to POWER architecture. Along with the new mode there is new firmware called the Protected Execution Ult

Re: [PATCH v5 02/10] powerpc: move memstart_addr and kernstart_addr to init-common.c

2019-08-07 Thread Jason Yan
On 2019/8/7 21:02, Michael Ellerman wrote: Jason Yan writes: These two variables are both defined in init_32.c and init_64.c. Move them to init-common.c. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

Re: [PATCH v5 01/10] powerpc: unify definition of M_IF_NEEDED

2019-08-07 Thread Jason Yan
On 2019/8/7 21:13, Michael Ellerman wrote: Jason Yan writes: M_IF_NEEDED is defined too many times. Move it to a common place. The name is not great, can you call it MAS2_M_IF_NEEDED, which at least gives a clue what it's for? OK. cheers Signed-off-by: Jason Yan Cc: Diana Craciun

Re: [PATCH v5 00/10] implement KASLR for powerpc/fsl_booke/32

2019-08-07 Thread Jason Yan
On 2019/8/7 21:12, Michael Ellerman wrote: Hi Jason, Jason Yan writes: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals. Thanks for doing this work. Sorry I didn't get a chan

Re: [PATCH] scsi: ibmvfc: Mark expected switch fall-throughs

2019-08-07 Thread Martin K. Petersen
Gustavo, > Mark switch cases where we are expecting to fall through. Applied to 5.4/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] powerpc: convert put_page() to put_user_page*()

2019-08-07 Thread kbuild test robot
Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [cannot apply to v5.3-rc3 next-20190807] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/john

Re: [PATCH] powerpc: convert put_page() to put_user_page*()

2019-08-07 Thread John Hubbard
On 8/7/19 4:24 PM, kbuild test robot wrote: > Hi, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [cannot apply to v5.3-rc3 next-20190807] > [if your patch is applied to the wrong git tree, please drop us a note to >

Re: [PATCH 1/4] kasan: allow arches to provide their own early shadow setup

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 17:14, Christophe Leroy a écrit : Le 07/08/2019 à 01:38, Daniel Axtens a écrit : powerpc supports several different MMUs. In particular, book3s machines support both a hash-table based MMU and a radix MMU. These MMUs support different numbers of entries per directory level:

Re: [PATCH 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 01:38, Daniel Axtens a écrit : KASAN support on powerpc64 is interesting: - We want to be able to support inline instrumentation so as to be able to catch global and stack issues. - We run a lot of code at boot in real mode. This includes stuff like printk(), so i

Re: [PATCH v2 0/3] arm/arm64: Add support for function error injection

2019-08-07 Thread Will Deacon
On Tue, Aug 06, 2019 at 06:00:12PM +0800, Leo Yan wrote: > This small patch set is to add support for function error injection; > this can be used to eanble more advanced debugging feature, e.g. > CONFIG_BPF_KPROBE_OVERRIDE. > > The patch 01/03 is to consolidate the function definition which can b

Re: [PATCH 0/4] powerpc: KASAN for 64-bit Book3S on Radix

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 01:38, Daniel Axtens a écrit : Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. It builds on top Christophe's work on 32bit. It also builds on my generic KASAN_VMALLOC series, available at: https://patc

Re: [PATCH] nvdimm/of_pmem: Provide a unique name for bus provider

2019-08-07 Thread Dan Williams
On Tue, Aug 6, 2019 at 11:00 PM Aneesh Kumar K.V wrote: > > On 8/7/19 10:22 AM, Dan Williams wrote: > > On Tue, Aug 6, 2019 at 9:17 PM Aneesh Kumar K.V > > wrote: > >> > >> On 8/7/19 9:43 AM, Dan Williams wrote: > >>> On Tue, Aug 6, 2019 at 9:00 PM Aneesh Kumar K.V > >>> wrote: > > ndc

Re: [PATCH 1/4] kasan: allow arches to provide their own early shadow setup

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 01:38, Daniel Axtens a écrit : powerpc supports several different MMUs. In particular, book3s machines support both a hash-table based MMU and a radix MMU. These MMUs support different numbers of entries per directory level: the PTES_PER_* defines evaluate to variables, not con

[PATCH] powerpc: use

2019-08-07 Thread Christoph Hellwig
The powerpc version of dma-mapping.h only contains a version of get_arch_dma_ops that always return NULL. Replace it with the asm-generic version that does the same. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/Kbuild| 1 + arch/powerpc/include/asm/dma-mapping.h | 18 -

Re: [PATCH 3/4] powerpc: support KASAN instrumentation of bitops

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 01:38, Daniel Axtens a écrit : In KASAN development I noticed that the powerpc-specific bitops were not being picked up by the KASAN test suite. Instrumentation is done via the bitops-instrumented.h header. It requies that arch-specific versions of bitop functions are renamed

Re: [PATCH 2/4] kasan: support instrumented bitops with generic non-atomic bitops

2019-08-07 Thread Christophe Leroy
Le 07/08/2019 à 01:38, Daniel Axtens a écrit : Currently bitops-instrumented.h assumes that the architecture provides both the atomic and non-atomic versions of the bitops (e.g. both set_bit and __set_bit). This is true on x86, but is not always true: there is a generic bitops/non-atomic.h hea

[PATCH v8 7/7] powerpc: add machine check safe copy_to_user

2019-08-07 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig in

[PATCH v8 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-07 Thread Santosh Sivaraj
If we take a UE on one of the instructions with a fixup entry, set nip to continue execution at the fixup entry. Stop processing the event further or print it. Co-developed-by: Reza Arbab Signed-off-by: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/a

[PATCH v8 5/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-07 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. The return value is the number of bytes remaining to be copied. This patch

[PATCH v8 4/7] extable: Add function to search only kernel exception table

2019-08-07 Thread Santosh Sivaraj
Certain architecture specific operating modes (e.g., in powerpc machine check handler that is unable to access vmalloc memory), the search_exception_tables cannot be called because it also searches the module exception tables if entry is not found in the kernel exception table. Cc: Thomas Gleixner

[PATCH v8 3/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-07 Thread Santosh Sivaraj
From: Balbir Singh The current code would fail on huge pages addresses, since the shift would be incorrect. Use the correct page shift value returned by __find_linux_pte() to get the correct physical address. The code is more generic and can handle both regular and compound pages. Fixes: ba41e1e

[PATCH v8 2/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-07 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v8 1/7] powerpc/mce: Schedule work from irq_work

2019-08-07 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +--- 1 file changed, 5 insertions(+), 3

[PATCH v8 0/7] powerpc: implement machine check safe memcpy

2019-08-07 Thread Santosh Sivaraj
During a memcpy from a pmem device, if a machine check exception is generated we end up in a panic. In case of fsdax read, this should only result in a -EIO. Avoid MCE by implementing memcpy_mcsafe. Before this patch series: ``` bash-4.4# mount -o dax /dev/pmem0 /mnt/pmem/ [ 7621.714094] Disablin

Re: [PATCH v5 01/10] powerpc: unify definition of M_IF_NEEDED

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > M_IF_NEEDED is defined too many times. Move it to a common place. The name is not great, can you call it MAS2_M_IF_NEEDED, which at least gives a clue what it's for? cheers > Signed-off-by: Jason Yan > Cc: Diana Craciun > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc:

Re: [PATCH v5 00/10] implement KASLR for powerpc/fsl_booke/32

2019-08-07 Thread Michael Ellerman
Hi Jason, Jason Yan writes: > This series implements KASLR for powerpc/fsl_booke/32, as a security > feature that deters exploit attempts relying on knowledge of the location > of kernel internals. Thanks for doing this work. Sorry I didn't get a chance to look at this until v5, I sent a few co

Re: [PATCH v5 06/10] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > This patch add support to boot kernel from places other than KERNELBASE. > Since CONFIG_RELOCATABLE has already supported, what we need to do is > map or copy kernel to a proper place and relocate. Freescale Book-E > parts expect lowmem to be mapped by fixed TLB entries(TLB1).

Re: [PATCH v5 09/10] powerpc/fsl_booke/kaslr: support nokaslr cmdline parameter

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > diff --git a/arch/powerpc/kernel/kaslr_booke.c > b/arch/powerpc/kernel/kaslr_booke.c > index c6b326424b54..436f9a03f385 100644 > --- a/arch/powerpc/kernel/kaslr_booke.c > +++ b/arch/powerpc/kernel/kaslr_booke.c > @@ -361,6 +361,18 @@ static unsigned long __init kaslr_choose_lo

Re: [PATCH v5 10/10] powerpc/fsl_booke/kaslr: dump out kernel offset information on panic

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > When kaslr is enabled, the kernel offset is different for every boot. > This brings some difficult to debug the kernel. Dump out the kernel > offset when panic so that we can easily debug the kernel. Some of this is taken from the arm64 version right? Please say so when you co

Re: [PATCH v5 07/10] powerpc/fsl_booke/32: randomize the kernel image offset

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > After we have the basic support of relocate the kernel in some > appropriate place, we can start to randomize the offset now. > > Entropy is derived from the banner and timer, which will change every > build and boot. This not so much safe so additionally the bootloader may > p

Re: [PATCH v5 03/10] powerpc: introduce kimage_vaddr to store the kernel base

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we > need a variable to store the kernel base. > > Signed-off-by: Jason Yan > Cc: Diana Craciun > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Nicho

Re: [PATCH v5 02/10] powerpc: move memstart_addr and kernstart_addr to init-common.c

2019-08-07 Thread Michael Ellerman
Jason Yan writes: > These two variables are both defined in init_32.c and init_64.c. Move > them to init-common.c. > > Signed-off-by: Jason Yan > Cc: Diana Craciun > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Nicholas Piggin > Cc: Kee

Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*

2019-08-07 Thread Shawn Anastasio
On 8/7/19 8:04 AM, Christoph Hellwig wrote: Actually it is typical modern Linux style to just provide a prototype and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it. I see. Also, like Will mentioned earlier, the function name isn't entirely accurate anymore. I second the su

Re: [PATCH net-next v2] ibmveth: Allow users to update reported speed and duplex

2019-08-07 Thread Michael Ellerman
Thomas Falcon writes: > Reported ethtool link settings for the ibmveth driver are currently > hardcoded and no longer reflect the actual capabilities of supported > hardware. There is no interface designed for retrieving this information > from device firmware nor is there any way to update curren