Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Christophe Leroy
Le 29/07/2019 à 22:32, Nathan Chancellor a écrit : On Mon, Jul 29, 2019 at 01:25:41PM -0700, Nick Desaulniers wrote: Commit 6c5875843b87 ("powerpc: slightly improve cache helpers") exposed what looks like a codegen bug in Clang's handling of `%y` output template with `Z` constraint. This is

[PATCH v2] Fix typo reigster to register

2019-07-29 Thread Pei-Hsuan Hung
Signed-off-by: Pei-Hsuan Hung Acked-by: Liviu Dudau Cc: triv...@kernel.org --- Hi Liviu, thanks for your reply. This patch is generated by a script so at first I didn't notice there is also a typo in the word coefficient. I've fixed the typo in this version. arch/powerpc/kernel/eeh.c

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Stephen Rothwell
Hi Gustavo, On Mon, 29 Jul 2019 22:30:34 -0500 "Gustavo A. R. Silva" wrote: > > If no one takes it by tomorrow, I'll take it in my tree. I am assuming that Michael Ellerman will take it into his fixes tree and send it to Lunis fairly soon as it actually breaks some powerpc builds. -- Cheers,

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Stephen Rothwell
Hi Gustavo, On Mon, 29 Jul 2019 22:57:05 -0500 "Gustavo A. R. Silva" wrote: > > On 7/29/19 10:50 PM, Stephen Rothwell wrote: > > > > I am assuming that Michael Ellerman will take it into his fixes tree > > and send it to Lunis fairly soon as it actually breaks some powerpc > > builds. > >

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added CC|

[Bug 204375] kernel 5.2.4 w. KASAN enabled fails to boot on a PowerMac G4 3,6 at very early stage

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204375 --- Comment #1 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284039 --> https://bugzilla.kernel.org/attachment.cgi?id=284039=edit kernel .config (PowerMac G4 DP, kernel 5.2.4) With this .config the G4 DP boots fine. With this

Re: [DOC][PATCH v5 1/4] powerpc: Document some HCalls for Storage Class Memory

2019-07-29 Thread Vaibhav Jain
Thanks everyone for reviewing this patch-set. The V4 got merged upstream which didn't have this DOC-patch. So, I will re-spin a separate and independent doc-patch incorporating your review comments. Cheers, -- Vaibhav Jain Linux Technology Center, IBM India Pvt. Ltd.

[Bug 204375] New: kernel 5.2.4 w. KASAN enabled fails to boot on a PowerMac G4 3,6 at very early stage

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204375 Bug ID: 204375 Summary: kernel 5.2.4 w. KASAN enabled fails to boot on a PowerMac G4 3,6 at very early stage Product: Platform Specific/Hardware Version: 2.5 Kernel Version:

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Gustavo A. R. Silva
On 7/29/19 10:50 PM, Stephen Rothwell wrote: > Hi Gustavo, > > On Mon, 29 Jul 2019 22:30:34 -0500 "Gustavo A. R. Silva" > wrote: >> >> If no one takes it by tomorrow, I'll take it in my tree. > > I am assuming that Michael Ellerman will take it into his fixes tree > and send it to Lunis

Re: [PATCH] drivers/macintosh/smu.c: Mark expected switch fall-through

2019-07-29 Thread Stephen Rothwell
Hi all, On Tue, 30 Jul 2019 14:37:04 +1000 Stephen Rothwell wrote: > > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warning (Building: powerpc): > > drivers/macintosh/smu.c: In function 'smu_queue_i2c': > drivers/macintosh/smu.c:854:21: warning:

CVE-2019-13648: Linux kernel: powerpc: kernel crash in TM handling triggerable by any local user

2019-07-29 Thread Michael Neuling
The Linux kernel for powerpc since v3.9 has a bug in the TM handling where any unprivileged local user may crash the operating system. This bug affects machines using 64-bit CPUs where Transactional Memory (TM) is not present or has been disabled (see below for more details on affected CPUs).

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Gustavo A. R. Silva
On 7/29/19 3:16 AM, Stephen Rothwell wrote: > Hi Santosh, > > On Mon, 29 Jul 2019 11:25:36 +0530 Santosh Sivaraj wrote: >> >> Implicit fallthrough warning was enabled globally which broke >> the build. Make it explicit with a `fall through` comment. >> >> Signed-off-by: Santosh Sivaraj

[PATCH 107/107] perf vendor events power9: Added missing event descriptions

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Michael Petlan Documentation source: https://wiki.raptorcs.com/w/images/6/6b/POWER9_PMU_UG_v12_28NOV2018_pub.pdf Signed-off-by: Michael Petlan Reviewed-by: Madhavan Srinivasan Cc: Ananth N Mavinakayanahalli Cc: Carl Love Cc: Michael Ellerman Cc: Naveen N. Rao Cc: Paul Clarke Cc:

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Gustavo A. R. Silva
Hi Stephen, On 7/29/19 10:18 PM, Stephen Rothwell wrote: > Hi all, > > On Mon, 29 Jul 2019 18:45:40 -0500 "Gustavo A. R. Silva" > wrote: >> >> On 7/29/19 3:16 AM, Stephen Rothwell wrote: >>> >>> On Mon, 29 Jul 2019 11:25:36 +0530 Santosh Sivaraj >>> wrote: Implicit fallthrough

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Stephen Rothwell
Hi all, On Mon, 29 Jul 2019 18:45:40 -0500 "Gustavo A. R. Silva" wrote: > > On 7/29/19 3:16 AM, Stephen Rothwell wrote: > > > > On Mon, 29 Jul 2019 11:25:36 +0530 Santosh Sivaraj > > wrote: > >> > >> Implicit fallthrough warning was enabled globally which broke > >> the build. Make it

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

2019-07-29 Thread Jason Yan
On 2019/7/29 22:31, Christoph Hellwig wrote: I think you need to keep the more restrictive EXPORT_SYMBOL_GPL from the 64-bit code to keep the intention of all authors intact. Oh yes, I will fix in v2. Thanks. .

[PATCH] drivers/macintosh/smu.c: Mark expected switch fall-through

2019-07-29 Thread Stephen Rothwell
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: powerpc): drivers/macintosh/smu.c: In function 'smu_queue_i2c': drivers/macintosh/smu.c:854:21: warning: this statement may fall through [-Wimplicit-fallthrough=] cmd->info.devaddr &=

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Segher Boessenkool
On Mon, Jul 29, 2019 at 01:32:46PM -0700, Nathan Chancellor wrote: > For the record: > > https://godbolt.org/z/z57VU7 > > This seems consistent with what Michael found so I don't think a revert > is entirely unreasonable. Try this: https://godbolt.org/z/6_ZfVi This matters in non-trivial

Re: [EXTERNAL][PATCH 1/5] PCI: Convert pci_resource_to_user to a weak function

2019-07-29 Thread Joe Perches
On Sun, 2019-07-28 at 22:49 +, Paul Burton wrote: > Hi Denis, > > On Sun, Jul 28, 2019 at 11:22:09PM +0300, Denis Efremov wrote: > > diff --git a/include/linux/pci.h b/include/linux/pci.h > > index 9e700d9f9f28..1a19d0151b0a 100644 > > --- a/include/linux/pci.h > > +++ b/include/linux/pci.h >

Re: [RFC PATCH v2] powerpc/xmon: restrict when kernel is locked down

2019-07-29 Thread Daniel Axtens
Hi Chris, Remind me again why we need to clear breakpoints in integrity mode? ... >> Integrity mode merely means we are aiming to prevent modifications to >> kernel memory. IMHO leaving existing breakpoints in place is fine as >> long as when we hit the breakpoint xmon is in read-only

Re: [PATCH] Fix typo reigster to register

2019-07-29 Thread Liviu Dudau
Hi Pei, On Sat, Jul 27, 2019 at 10:21:09PM +0800, Pei Hsuan Hung wrote: > Signed-off-by: Pei Hsuan Hung > Cc: triv...@kernel.org > --- > arch/powerpc/kernel/eeh.c | 2 +- > arch/powerpc/platforms/cell/spufs/switch.c | 4 ++-- > drivers/extcon/extcon-rt8973a.c

[PATCH v3] powerpc/nvdimm: Pick nearby online node if the device node is not online

2019-07-29 Thread Aneesh Kumar K.V
Currently, nvdimm subsystem expects the device numa node for SCM device to be an online node. It also doesn't try to bring the device numa node online. Hence if we use a non-online numa node as device node we hit crashes like below. This is because we try to access uninitialized NODE_DATA in

[PATCH v2 4/5] powerpc/PCI: Remove HAVE_ARCH_PCI_RESOURCE_TO_USER

2019-07-29 Thread Denis Efremov
The function pci_resource_to_user() was turned to a weak one. Thus, powerpc-specific version will automatically override the generic one and the HAVE_ARCH_PCI_RESOURCE_TO_USER macro should be removed. Signed-off-by: Denis Efremov --- arch/powerpc/include/asm/pci.h | 2 -- 1 file changed, 2

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : M_IF_NEEDED is defined too many times. Move it to a common place. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : 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

Re: [RFC PATCH 08/10] powerpc/fsl_booke/kaslr: clear the original kernel if randomized

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook ---

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : One may want to disable kaslr when boot, so provide a cmdline parameter 'nokaslr' to support this. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : 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

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : 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

Re: [PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-29 Thread Stephen Rothwell
Hi Santosh, On Mon, 29 Jul 2019 11:25:36 +0530 Santosh Sivaraj wrote: > > Implicit fallthrough warning was enabled globally which broke > the build. Make it explicit with a `fall through` comment. > > Signed-off-by: Santosh Sivaraj > --- > arch/powerpc/kvm/book3s_32_mmu.c | 1 + > 1 file

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : 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. Signed-off-by: Jason Yan Cc: Diana Craciun Cc:

Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask

2019-07-29 Thread Geert Uytterhoeven
Hi Christoph, On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > of IOVA space, and the generic direct mapping code already provides its > own routines that is intelligent based on the amount of memory actually >

Re: [EXTERNAL][PATCH 1/5] PCI: Convert pci_resource_to_user to a weak function

2019-07-29 Thread Denis Efremov
Hi Paul, On 29.07.2019 01:49, Paul Burton wrote: Hi Denis, This is wrong - using __weak on the declaration in a header will cause the weak attribute to be applied to all implementations too (presuming the C files containing the implementations include the header). You then get whichever

[PATCH v2 1/5] PCI: Convert pci_resource_to_user to a weak function

2019-07-29 Thread Denis Efremov
The patch turns pci_resource_to_user() to a weak function. Thus, architecture-specific versions will automatically override the generic one. This allows to remove the HAVE_ARCH_PCI_RESOURCE_TO_USER macro and avoid the conditional compilation for this single function. Signed-off-by: Denis Efremov

[PATCH v2 0/5] PCI: Convert pci_resource_to_user() to a weak function

2019-07-29 Thread Denis Efremov
Architectures currently define HAVE_ARCH_PCI_RESOURCE_TO_USER if they want to provide their own pci_resource_to_user() implementation. This could be simplified if we make the generic version a weak function. Thus, architecture specific versions will automatically override the generic one. Changes

Re: [RFC PATCH 05/10] powerpc/fsl_booke/32: introduce reloc_kernel_entry() helper

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : Add a new helper reloc_kernel_entry() to jump back to the start of the new kernel. After we put the new kernel in a randomized place we can use this new helper to enter the kernel and begin to relocate again. Signed-off-by: Jason Yan Cc: Diana

Re: [PATCH 4/5] powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses

2019-07-29 Thread Christophe Leroy
Le 24/07/2019 à 10:46, Nicholas Piggin a écrit : Ensure __va is given a physical address below PAGE_OFFSET, and __pa is given a virtual address above PAGE_OFFSET. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/page.h | 14 -- 1 file changed, 12 insertions(+), 2

Re: [RFC PATCH 04/10] powerpc/fsl_booke/32: introduce create_tlb_entry() helper

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : Add a new helper create_tlb_entry() to create a tlb entry by the virtual and physical address. This is a preparation to support boot kernel at a randomized address. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe

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

2019-07-29 Thread Christophe Leroy
Le 17/07/2019 à 10:06, Jason Yan a écrit : 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

Re: [RFC PATCH 05/10] powerpc/fsl_booke/32: introduce reloc_kernel_entry() helper

2019-07-29 Thread Jason Yan
On 2019/7/29 19:08, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : Add a new helper reloc_kernel_entry() to jump back to the start of the new kernel. After we put the new kernel in a randomized place we can use this new helper to enter the kernel and begin to relocate

[PATCH 00/18] powerpc/64s/exception: cleanup and gas macroify, round 2

2019-07-29 Thread Nicholas Piggin
This series goes on top of the unmerged machine check handler changes https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=118814 This carries on with the goal of unwinding macros and consolidating code. This gets most of the way there, but we have traded that improvement for another

[PATCH 07/18] powerpc/64s/exception: remove EXCEPTION_PROLOG_0/1, rename _2

2019-07-29 Thread Nicholas Piggin
EXCEPTION_PROLOG_0 and _1 have only a single caller, so expand them into it. Rename EXCEPTION_PROLOG_2_REAL to INT_SAVE_SRR_AND_JUMP and EXCEPTION_PROLOG_2_VIRT to INT_VIRT_SAVE_SRR_AND_JUMP, which are more descriptive. No generated code change except BUG line number constants. Signed-off-by:

[PATCH 09/18] powerpc/64s/exception: INT_HANDLER support HDAR/HDSISR and use it in HDSI

2019-07-29 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 1c07b5fc6692..e5122ace5f05 100644 ---

[PATCH 11/18] powerpc/64s/exception: KVM_HANDLER reorder arguments to match other macros

2019-07-29 Thread Nicholas Piggin
Also change argument name (n -> vec) to match others. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH 14/18] powerpc/64s/exception: Expand EXCEPTION_COMMON macro into caller

2019-07-29 Thread Nicholas Piggin
No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 54 ++-- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH 15/18] powerpc/64s/exception: Expand EXCEPTION_PROLOG_COMMON_1 and 2 into caller

2019-07-29 Thread Nicholas Piggin
No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 85 +--- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH 06/18] powerpc/64s/exception: Replace PROLOG macros and EXC helpers with a gas macro

2019-07-29 Thread Nicholas Piggin
This creates a single macro that generates the exception prolog code, with variants specified by arguments, rather than assorted nested macros for different variants. The increasing length of macro argument list is not nice to read or modify, but this is a temporary condition that will be

Re: [PATCH v2] powerpc/imc: Dont create debugfs files for cpu-less nodes

2019-07-29 Thread Michael Ellerman
Anju T Sudhakar writes: > Hi Qian, > > On 7/16/19 12:11 AM, Qian Cai wrote: >> On Thu, 2019-07-11 at 14:53 +1000, Michael Ellerman wrote: >>> Hi Maddy, >>> >>> Madhavan Srinivasan writes: diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c

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

2019-07-29 Thread Jason Yan
On 2019/7/29 19:33, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : 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

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

2019-07-29 Thread Jason Yan
On 2019/7/29 19:38, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : One may want to disable kaslr when boot, so provide a cmdline parameter 'nokaslr' to support this. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin

[PATCH 08/18] powerpc/64s/exception: Add the virt variant of the denorm interrupt handler

2019-07-29 Thread Nicholas Piggin
All other virt handlers have the prolog code in the virt vector rather than branch to the real vector. Follow this pattern in the denorm virt handler. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH 18/18] powerpc/64s/exception: program check handler do not branch into a macro

2019-07-29 Thread Nicholas Piggin
It's a bit too clever to jump to a label inside an expanded macro, particularly when the label is just a number rather than a descriptive name. So expand interrupt handler code twice, for the stack and no stack cases, and branch to those. The slight code size increase is worth the improved

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

2019-07-29 Thread Diana Madalina Craciun
Reviewed-by: Diana Craciun Tested-by: Diana Craciun On 7/17/2019 10:49 AM, Jason Yan wrote: > 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. > > Since CONFIG_RELOCATABLE has

Re: [PATCH] powerpc: Use nid as fallback for chip_id

2019-07-29 Thread Michael Ellerman
Srikar Dronamraju writes: > One of the uses of chip_id is to find out all cores that are part of the same > chip. However ibm,chip_id property is not present in device-tree of PowerVM > Lpars. Hence lscpu output shows one core per socket and multiple cores. > > Before the patch. > # lscpu >

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

2019-07-29 Thread Jason Yan
On 2019/7/29 19:43, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : 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.

[PATCH 01/18] powerpc/64s/exception: Fix DAR load for handle_page_fault error case

2019-07-29 Thread Nicholas Piggin
This buglet goes back to before the 64/32 arch merge, but it does not seem to have had practical consequences because bad_page_fault does not use the 2nd argument, but rather regs->dar/nip. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1

[PATCH 05/18] powerpc/64s/exception: remove 0xb00 handler

2019-07-29 Thread Nicholas Piggin
This vector is not used by any supported processor, and has been implemented as an unknown exception going back to 2.6. There is nothing special about 0xb00, so remove it like other unused vectors. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 ++ 1 file

[PATCH 12/18] powerpc/64s/exception: Merge EXCEPTION_PROLOG_COMMON_2/3

2019-07-29 Thread Nicholas Piggin
Merge EXCEPTION_PROLOG_COMMON_3 into EXCEPTION_PROLOG_COMMON_2. No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git

[PATCH 16/18] powerpc/64s/exception: INT_COMMON add DIR, DSISR, reconcile options

2019-07-29 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 111 --- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index dcb60f082fdc..456926439e41 100644 ---

[PATCH 17/18] powerpc/64s/exception: move interrupt entry code above the common handler

2019-07-29 Thread Nicholas Piggin
This better reflects the order in which the code is executed. No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 450 +-- 1 file changed, 225 insertions(+), 225 deletions(-) diff --git

Re: [RFC PATCH 04/10] powerpc/fsl_booke/32: introduce create_tlb_entry() helper

2019-07-29 Thread Jason Yan
On 2019/7/29 19:05, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : Add a new helper create_tlb_entry() to create a tlb entry by the virtual and physical address. This is a preparation to support boot kernel at a randomized address. Signed-off-by: Jason Yan Cc: Diana

Re: [RFC PATCH 08/10] powerpc/fsl_booke/kaslr: clear the original kernel if randomized

2019-07-29 Thread Jason Yan
On 2019/7/29 19:19, Christophe Leroy wrote: Le 17/07/2019 à 10:06, Jason Yan a écrit : The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

[PATCH 02/18] powerpc/64s/exception: move head-64.h exception code to exception-64s.S

2019-07-29 Thread Nicholas Piggin
The head-64.h code should deal only with the head code sections and offset calculations. No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/head-64.h | 41 arch/powerpc/kernel/exceptions-64s.S |

[PATCH 03/18] powerpc/64s/exception: Add EXC_HV_OR_STD, for HSRR if HV=1 else SRR

2019-07-29 Thread Nicholas Piggin
Use EXC_HV_OR_STD to de-duplicate the 0x500 external interrupt. This helps with consolidation in future. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 102 +-- 1 file changed, 79 insertions(+), 23 deletions(-) diff --git

[PATCH 04/18] powerpc/64s/exception: Fix performance monitor virt handler

2019-07-29 Thread Nicholas Piggin
The perf virt handler uses EXCEPTION_PROLOG_2_REAL rather than _VIRT. In practice this is okay because the _REAL variant is usable by virt mode interrupts, but should be fixed (and is a performance win). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file

[PATCH 10/18] powerpc/64s/exception: Add INT_KVM_HANDLER gas macro

2019-07-29 Thread Nicholas Piggin
Replace the 4 variants of cpp macros with one gas macro. No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 99 +++- 1 file changed, 40 insertions(+), 59 deletions(-) diff --git

[PATCH 13/18] powerpc/64s/exception: Add INT_COMMON gas macro to generate common exception code

2019-07-29 Thread Nicholas Piggin
No generated code change except BUG line number constants. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 52 +--- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

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

2019-07-29 Thread Christoph Hellwig
I think you need to keep the more restrictive EXPORT_SYMBOL_GPL from the 64-bit code to keep the intention of all authors intact.

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

2019-07-29 Thread Kees Cook
On Sun, Jul 28, 2019 at 07:26:08PM -0500, Gustavo A. R. Silva wrote: > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warnings: > > drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_npiv_login_done': > drivers/scsi/ibmvscsi/ibmvfc.c:4022:3:

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

2019-07-29 Thread Christoph Hellwig
On Wed, Jul 17, 2019 at 04:06:14PM +0800, Jason Yan wrote: > Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we > need a variable to store the kernel base. This should probably merged into the patch actually using it.

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Nathan Chancellor
On Mon, Jul 29, 2019 at 01:25:41PM -0700, Nick Desaulniers wrote: > Commit 6c5875843b87 ("powerpc: slightly improve cache helpers") exposed > what looks like a codegen bug in Clang's handling of `%y` output > template with `Z` constraint. This is resulting in panics during boot > for 32b powerpc

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Nathan Chancellor
On Mon, Jul 29, 2019 at 01:45:35PM -0700, Nick Desaulniers wrote: > On Mon, Jul 29, 2019 at 1:32 PM Nathan Chancellor > wrote: > > > > On Mon, Jul 29, 2019 at 01:25:41PM -0700, Nick Desaulniers wrote: > > > But I'm not sure how the inlined code generated would be affected. > > > > For the record:

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Nick Desaulniers
On Mon, Jul 29, 2019 at 1:47 PM Nathan Chancellor wrote: > > On Mon, Jul 29, 2019 at 01:45:35PM -0700, Nick Desaulniers wrote: > > On Mon, Jul 29, 2019 at 1:32 PM Nathan Chancellor > > wrote: > > > > > > On Mon, Jul 29, 2019 at 01:25:41PM -0700, Nick Desaulniers wrote: > > > > But I'm not sure