[PATCH v3 1/4] powerpc/64s: Fix HV NMI vs HV interrupt recoverability test

2019-02-25 Thread Nicholas Piggin
corrupted. Fix this by marking NMIs non-recoverable if they land in HV interrupt ranges. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 8 +++ arch/powerpc/include/asm/nmi.h| 2 + arch/powerpc/kernel/exceptions-64s.S | 8 +++ arch/powerpc/kernel

[PATCH v3 0/4] Fixes for 3 separate NMI reentrancy bugs

2019-02-25 Thread Nicholas Piggin
it does not seem to follow the architecture wrt leaving MSR[RI] unchanged for HV interrupts. Mambo clears MSR[RI], so you have to account for that manually. Since v1: - Fixed several build bugs. Since v2: - Improved changelog and comments. - Fixed the NIA test for virt mode interrupts. Nicholas

[PATCH v3 2/4] powerpc/64s: system reset interrupt preserve HSRRs

2019-02-25 Thread Nicholas Piggin
HSRRs. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/traps.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 12b54908c15d..f2191755fdf5 100644 --- a/arch/powerpc/kernel/traps.c

[PATCH v3 3/4] powerpc/64s: Prepare to handle data interrupts vs d-side MCE reentrancy

2019-02-25 Thread Nicholas Piggin
: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 48 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index d2e9fc968655..0b8b57597837 100644 --- a/arch/powerpc/kernel

[PATCH v3 4/4] powerpc/64s: Fix data interrupts vs d-side MCE reentrancy

2019-02-25 Thread Nicholas Piggin
: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 36 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 0b8b57597837..77e9c70f1b49 100644 --- a/arch/powerpc/kernel

[PATCH v4 0/4] Fixes for 3 separate NMI reentrancy bugs

2019-02-26 Thread Nicholas Piggin
: - Fixed HPT crash due to use of PACA_EXGEN rather than EXSLB in the SLB interrupt handlers. Nicholas Piggin (4): powerpc/64s: Fix HV NMI vs HV interrupt recoverability test powerpc/64s: system reset interrupt preserve HSRRs powerpc/64s: Prepare to handle data interrupts vs d-side MCE

[PATCH v4 1/4] powerpc/64s: Fix HV NMI vs HV interrupt recoverability test

2019-02-26 Thread Nicholas Piggin
corrupted. Fix this by marking NMIs non-recoverable if they land in HV interrupt ranges. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 8 +++ arch/powerpc/include/asm/nmi.h| 2 + arch/powerpc/kernel/exceptions-64s.S | 8 +++ arch/powerpc/kernel

[PATCH v4 2/4] powerpc/64s: system reset interrupt preserve HSRRs

2019-02-26 Thread Nicholas Piggin
HSRRs. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/traps.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 12b54908c15d..f2191755fdf5 100644 --- a/arch/powerpc/kernel/traps.c

[PATCH v4 3/4] powerpc/64s: Prepare to handle data interrupts vs d-side MCE reentrancy

2019-02-26 Thread Nicholas Piggin
: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 48 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index d2e9fc968655..0b8b57597837 100644 --- a/arch/powerpc/kernel

[PATCH v4 4/4] powerpc/64s: Fix data interrupts vs d-side MCE reentrancy

2019-02-26 Thread Nicholas Piggin
: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 36 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 0b8b57597837..0e6f274788dd 100644 --- a/arch/powerpc/kernel

[PATCH] powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C

2019-02-26 Thread Nicholas Piggin
void link stack corruption. This requires a skiboot fix as well to keep the call stack balanced. A NULL call is more costly after this, (410ns->430ns on POWER9), but OPAL calls are generally not performance critical at this scale. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/as

Re: [PATCH 00/18] Add FADump support on PowerNV platform

2019-02-26 Thread Nicholas Piggin
Hari Bathini's on February 22, 2019 3:35 am: > Firmware-Assisted Dump (FADump) is currently supported only on pseries > platform. This patch series adds support for powernv platform too. > > The first and third patches refactor the FADump code to make use of common > code across multiple platforms

Re: [PATCH v2] powerpc/powernv/idle: Restore IAMR after idle

2019-02-27 Thread Nicholas Piggin
, instead use _DAR (thanks mpe) > - remove isync and pnv_wakeup_noloss section (thanks Nick) Thanks for that, looks good. Reviewed-by: Nicholas Piggin

[PATCH] powerpc/64s: Fix unrelocated interrupt trampoline address test

2019-03-01 Thread Nicholas Piggin
The recent commit got this test wrong, it declared the assembler symbols the wrong way, and also used the wrong symbol name (xxx_start rather than start_xxx, see asm/head-64.h). Fixes: ccd477028a ("powerpc/64s: Fix HV NMI vs HV interrupt recoverability test") Signed-off-by: Nicho

Re: [PATCH v2] arch/powerpc: Rework local_paca to avoid LTO warnings

2019-03-25 Thread Nicholas Piggin
Alastair D'Silva's on March 14, 2019 12:31 pm: > From: Alastair D'Silva > > When building an LTO kernel, the existing code generates warnings: > ./arch/powerpc/include/asm/paca.h:37:30: warning: register of > ‘local_paca’ used for multiple global register variables > register str

Re: [PATCH v2] arch/powerpc: Rework local_paca to avoid LTO warnings

2019-03-26 Thread Nicholas Piggin
Alastair D'Silva's on March 27, 2019 2:37 pm: > On Tue, 2019-03-26 at 15:58 +1000, Nicholas Piggin wrote: >> Alastair D'Silva's on March 14, 2019 12:31 pm: >> > From: Alastair D'Silva >> > >> > When building an LTO kernel, the existing

Re: [PATCH v2] kbuild: strip whitespace in cmd_record_mcount findstring

2019-03-26 Thread Nicholas Piggin
Joe Lawrence's on March 27, 2019 3:33 am: > On Tue, Mar 26, 2019 at 02:29:47PM +0900, Masahiro Yamada wrote: >> On Tue, Mar 26, 2019 at 1:05 AM Joe Lawrence wrote: >> > >> > CC_FLAGS_FTRACE may contain trailing whitespace that interferes with >> > findstring. >> > >> > For example, commit 6977f95e

[PATCH] powerpc/64s/radix: Fix radix segment exception handling

2019-03-29 Thread Nicholas Piggin
er. Fixes: 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C") Cc: Aneesh Kumar K.V Reported-by: Anton Blanchard Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 12 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/kernel

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-03-29 Thread Nicholas Piggin
Suraj Jitindar Singh's on March 29, 2019 3:20 pm: > On Wed, 2019-03-27 at 17:51 +0100, Cédric Le Goater wrote: >> On 3/27/19 5:37 PM, Cédric Le Goater wrote: >> > On 3/27/19 1:36 PM, Sebastian Andrzej Siewior wrote: >> > > With qemu-system-ppc64le -machine pseries -smp 4 I get: >> > > >> > > > #

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-03-29 Thread Nicholas Piggin
Steven Rostedt's on March 30, 2019 1:31 am: > [ Added Peter ] > > On Fri, 29 Mar 2019 19:13:55 +1000 > Nicholas Piggin wrote: > >> Suraj Jitindar Singh's on March 29, 2019 3:20 pm: >> > On Wed, 2019-03-27 at 17:51 +0100, Cédric Le Goater wrote: >>

[PATCH] powerpc/watchdog: Use hrtimers for per-CPU heartbeat

2019-04-02 Thread Nicholas Piggin
stop, so the root cause is never detected. Fix this by using hrtimer based timers for the watchdog heartbeat, like the generic kernel hardlockup detector. Reported-by: Ravikumar Bangoria Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/watchdog.c | 34

Re: [PATCH] powerpc/watchdog: Use hrtimers for per-CPU heartbeat

2019-04-04 Thread Nicholas Piggin
Gautham R Shenoy's on April 4, 2019 9:19 pm: > Hello Nicholas, > > On Tue, Apr 2, 2019 at 4:57 PM Nicholas Piggin wrote: >> >> Using a jiffies timer creates a dependency on the tick_do_timer_cpu >> incrementing jiffies. If that CPU has locked up and jiffies is n

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-04 Thread Nicholas Piggin
Christophe Leroy's on April 3, 2019 4:31 am: > > > Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : >> Currently, our mm_context_t on book3s64 include all hash specific >> context details like slice mask, subpage protection details. We >> can skip allocating those on radix. This will help us to

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-04-04 Thread Nicholas Piggin
Peter Zijlstra's on April 1, 2019 6:38 pm: > > + fweisbec, who did the remote bits > > On Sat, Mar 30, 2019 at 01:10:28PM +1000, Nicholas Piggin wrote: >> Something like this? >> >> kernel/irq_work: Do not raise an IPI when queueing work on the local CPU >

[PATCH v8 1/2] powerpc/64s: reimplement book3s idle code in C

2019-04-07 Thread Nicholas Piggin
c in the normal idle wakeup path. Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin Notes: - The KVM code has been significantly changed and now actually boots a HPT on radix guest with dependent threads mode and >0 secondaries. With previous iterations my test wasn't a

[PATCH v8 2/2] powerpc/64s: KVM update for reimplement book3s idle code in C

2019-04-07 Thread Nicholas Piggin
This is the KVM update to the new idle code. A few improvements: - Idle sleepers now always return to caller rather than branch out to KVM first. - This allows optimisations like very fast return to caller when no state has been lost. - KVM no longer requires nap_state_lost because it controls

[PATCH v2] powerpc/64s/radix: Fix radix segment exception handling

2019-04-08 Thread Nicholas Piggin
er. Fixes: 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C") Cc: Aneesh Kumar K.V Reported-by: Anton Blanchard Signed-off-by: Nicholas Piggin --- - Add a selftests that triggers the crash arch/powerpc/kernel/exceptions-64s.S | 12 +++ tools/testing/selftests

[PATCH v2] powerpc/watchdog: Use hrtimers for per-CPU heartbeat

2019-04-08 Thread Nicholas Piggin
stop, so the root cause is never detected. Fix this by using hrtimer based timers for the watchdog heartbeat, like the generic kernel hardlockup detector. Cc: Gautham R. Shenoy Reported-by: Ravikumar Bangoria Signed-off-by: Nicholas Piggin --- v2: Fix per-CPU hrtimer startup noticed by Gautham

Re: [PATCH] powerpc/mm/radix: Do slb preload only with hash translation mode

2019-04-09 Thread Nicholas Piggin
Aneesh Kumar K.V's on April 9, 2019 2:03 pm: > Add radix_enabled check to avoid slb preload with radix translation. > > Signed-off-by: Aneesh Kumar K.V Acked-by: Nicholas Piggin > --- > > Without this we result in kernel crash as we move hash related variable

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-04-09 Thread Nicholas Piggin
Frederic Weisbecker's on April 6, 2019 10:06 am: > On Mon, Apr 01, 2019 at 10:38:27AM +0200, Peter Zijlstra wrote: >> >> + fweisbec, who did the remote bits >> >> On Sat, Mar 30, 2019 at 01:10:28PM +1000, Nicholas Piggin wrote: >> > diff --git a/kernel/

[PATCH v2 0/5] Allow CPU0 to be nohz full

2019-04-10 Thread Nicholas Piggin
Nicholas Piggin (5): sched/core: allow the remote scheduler tick to be started on CPU0 PM / suspend: add function to disable secondaries for suspend kernel/cpu: Allow non-zero CPU to be primary for suspend / kexec freeze kernel/sched/isolation: require a present CPU in housekeeping mask

[PATCH v2 1/5] sched/core: allow the remote scheduler tick to be started on CPU0

2019-04-10 Thread Nicholas Piggin
This has no effect yet because CPU0 will always be a housekeeping CPU until a later change. Signed-off-by: Nicholas Piggin --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4778c48a7fda..10e05ec049b6

[PATCH v2 2/5] PM / suspend: add function to disable secondaries for suspend

2019-04-10 Thread Nicholas Piggin
This adds a function to disable secondary CPUs for suspend that are not necessarily non-zero / non-boot CPUs. Platforms will be able to use this to suspend using non-zero CPUs. Cc: Rafael J. Wysocki Signed-off-by: Nicholas Piggin --- include/linux/cpu.h | 10 ++ kernel

[PATCH v2 3/5] kernel/cpu: Allow non-zero CPU to be primary for suspend / kexec freeze

2019-04-10 Thread Nicholas Piggin
suspend/wake effectively support this by handing off the final stage to CPU0 when kernel housekeeping is no longer required. Another option is to make housekeeping / nohz_full mask dynamic at runtime, but the complexity could not be justified at this time. Signed-off-by: Nicholas Piggin --- arch

[PATCH v2 4/5] kernel/sched/isolation: require a present CPU in housekeeping mask

2019-04-10 Thread Nicholas Piggin
During housekeeping mask setup, currently a possible CPU is required. That does not guarantee the CPU would be available at boot time, so check to ensure that at least one present CPU is in the mask. Signed-off-by: Nicholas Piggin --- kernel/sched/isolation.c | 18 +- 1 file

[PATCH v2 5/5] nohz_full: Allow the boot CPU to be nohz_full

2019-04-10 Thread Nicholas Piggin
uses CPU0 for housekeeping could be achieved by modifying their system, but it is preferable if nohz_full can support their environment without modification. Signed-off-by: Nicholas Piggin --- kernel/time/tick-common.c | 50 +++ kernel/time/tick-sched.c | 34

Re: powerpc/64s/radix: Fix radix segment exception handling

2019-04-11 Thread Nicholas Piggin
Michael Ellerman's on April 11, 2019 12:49 am: > On Fri, 2019-03-29 at 07:42:57 UTC, Nicholas Piggin wrote: >> Commit 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C") >> broke the radix-mode segment exception handler. In radix mode, this is >> exc

Re: [PATCH v8 1/2] powerpc/64s: reimplement book3s idle code in C

2019-04-12 Thread Nicholas Piggin
Satheesh Rajendran's on April 8, 2019 5:32 pm: > Hi, > > Hit with below kernel crash during Power8 Host boot with this patch series on > top > of powerpc merge branch commit > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=merge&id=6a821ffee18a6e6c0027c523fa8c958df98

[PATCH v9 1/2] powerpc/64s: reimplement book3s idle code in C

2019-04-12 Thread Nicholas Piggin
Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin Notes: - The KVM code has been significantly changed and now actually boots a HPT on radix guest with dependent threads mode and >0 secondaries. With previous iterations my test wasn't actually catching this case and there w

[PATCH v9 2/2] powerpc/64s: KVM update for reimplement book3s idle code in C

2019-04-12 Thread Nicholas Piggin
This is the KVM update to the new idle code. A few improvements: - Idle sleepers now always return to caller rather than branch out to KVM first. - This allows optimisations like very fast return to caller when no state has been lost. - KVM no longer requires nap_state_lost because it controls

[RFC PATCH] powerpc/64/ftrace: mprofile-kernel patch out mflr

2019-04-12 Thread Nicholas Piggin
The new mprofile-kernel mcount sequence is mflr r0 bl_mcount Dynamic ftrace patches the branch instruction with a noop, but leaves the mflr. mflr is executed by the branch unit that can only execute one per cycle on POWER9 and shared with branches, so it would be nice to avoid it where p

Re: powerpc/64s/radix: Fix radix segment exception handling

2019-04-12 Thread Nicholas Piggin
Michael Ellerman's on April 13, 2019 1:39 pm: > Nicholas Piggin writes: >> Michael Ellerman's on April 11, 2019 12:49 am: >>> On Fri, 2019-03-29 at 07:42:57 UTC, Nicholas Piggin wrote: >>>> Commit 48e7b76957 ("powerpc/64s/hash: Convert SLB miss hand

Re: [PATCH v9 2/2] powerpc/64s: KVM update for reimplement book3s idle code in C

2019-04-12 Thread Nicholas Piggin
drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-64s-reimplement-book3s-idle-code-in-C/20190413-002437 > base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next > config: powerp

Re: [PATCH v3] powerpc/pseries: Only wait for dying CPU after call to rtas_stop_self()

2019-04-15 Thread Nicholas Piggin
Thiago Jung Bauermann's on April 11, 2019 9:08 am: > > Hello, > > Ping? > > -- > Thiago Jung Bauermann > IBM Linux Technology Center > > > Thiago Jung Bauermann writes: > >> When testing DLPAR CPU add/remove on a system under stress, >> pseries_cpu_die() doesn't wait long enough for a CPU t

Re: [PATCH v3 7/8] powerpc/mm: Consolidate radix and hash address map details

2019-04-16 Thread Nicholas Piggin
Aneesh Kumar K.V's on April 16, 2019 8:07 pm: > We now have > > 4K page size config > > kernel_region_map_size = 16TB > kernel vmalloc start = 0xc0001000 > kernel IO start= 0xc0002000 > kernel vmemmap start = 0xc0003000 > > with 64K page size config: > >

Re: [PATCH v3 7/8] powerpc/mm: Consolidate radix and hash address map details

2019-04-17 Thread Nicholas Piggin
Michael Ellerman's on April 17, 2019 10:34 pm: > Nicholas Piggin writes: >> Aneesh Kumar K.V's on April 16, 2019 8:07 pm: >>> We now have >>> >>> 4K page size config >>> >>> kernel_region_map_size = 16TB >&

Re: [PATCH v3] powerpc/pseries: Only wait for dying CPU after call to rtas_stop_self()

2019-04-17 Thread Nicholas Piggin
Thiago Jung Bauermann's on April 18, 2019 11:00 am: > > Hello Nick, > > Thank you very much for reviewing this patch! > > Nicholas Piggin writes: > >> Thiago Jung Bauermann's on April 11, 2019 9:08 am: >>> >>> Thiago Jung Bauermann write

Re: [PATCH v3 09/14] powerpc/xmon: Add initial support for prefixed instructions

2020-02-27 Thread Nicholas Piggin
Jordan Niethe's on February 28, 2020 10:37 am: > On Thu, Feb 27, 2020 at 6:14 PM Christophe Leroy > wrote: >> >> >> >> Le 27/02/2020 à 01:11, Jordan Niethe a écrit : >> > On Wed, Feb 26, 2020 at 6:10 PM Nicholas Piggin wrote: >> >> >

Re: [PATCH v3 11/14] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-27 Thread Nicholas Piggin
Jordan Niethe's on February 27, 2020 10:58 am: > On Wed, Feb 26, 2020 at 6:18 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on February 26, 2020 2:07 pm: >> > @@ -136,11 +148,14 @@ int arch_prepare_kprobe(struct kprobe *p) >

Re: [PATCH v3 11/14] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-27 Thread Nicholas Piggin
Nicholas Piggin's on February 28, 2020 11:47 am: > Jordan Niethe's on February 27, 2020 10:58 am: >> On Wed, Feb 26, 2020 at 6:18 PM Nicholas Piggin wrote: >> + >> +#define DEREF_PPC_INST_PTR(ptr)\ >> +({

Re: [PATCH v3 07/14] powerpc/traps: Check for prefixed instructions in facility_unavailable_exception()

2020-02-27 Thread Nicholas Piggin
Jordan Niethe's on February 27, 2020 9:52 am: > On Wed, Feb 26, 2020 at 5:53 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on February 26, 2020 2:07 pm: >> > If prefixed instructions are made unavailable by the [H]FSCR, attempting >> > to use them

[PATCH] Add OPAL_GET_SYMBOL / OPAL_LOOKUP_SYMBOL

2020-02-27 Thread Nicholas Piggin
than the skiboot symbols, e.g., the wake-up code in the HOMER (where CPUs have been seen to get stuck). Signed-off-by: Nicholas Piggin --- core/opal.c | 2 + core/utils.c| 92 +++-- doc/opal-api/opal-get-symbol-18

[PATCH 1/2] kallsyms: architecture specific symbol lookups

2020-02-27 Thread Nicholas Piggin
Provide CONFIG_ARCH_HAS_ADDRESS_LOOKUP which allows architectures to do their own symbol/address lookup if kernel and module lookups miss. powerpc will use this to deal with firmware symbols. Signed-off-by: Nicholas Piggin --- include/linux/kallsyms.h | 20 kernel

[PATCH 2/2] powerpc/powernv: Wire up OPAL address lookups

2020-02-27 Thread Nicholas Piggin
] .dummy_console_write_buffer_space+0x20/0x64 [OPAL] LR [3000378c] opal_entry+0x14c/0x17c [OPAL] This won't unwind the firmware stack (or its Linux caller) properly if firmware and kernel endians don't match, but that problem could be solved in powerpc's unwinder. Signed-off-by: Nicholas Pi

Re: [PATCH v3 01/14] powerpc: Enable Prefixed Instructions

2020-02-27 Thread Nicholas Piggin
Jordan Niethe's on February 28, 2020 12:52 pm: > On Wed, Feb 26, 2020 at 5:50 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on February 26, 2020 2:07 pm: >> > From: Alistair Popple >> > >> > Prefix instructions have their own FSCR bit which

Re: [PATCH v3 11/14] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-27 Thread Nicholas Piggin
Jordan Niethe's on February 28, 2020 1:23 pm: > On Fri, Feb 28, 2020 at 12:48 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on February 27, 2020 10:58 am: >> > On Wed, Feb 26, 2020 at 6:18 PM Nicholas Piggin wrote: >> >> >> >> Jordan

[PATCH] powerpc/64s/radix: Fix !SMP build

2020-03-01 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/book3s64/radix_pgtable.c | 1 + arch/powerpc/mm/book3s64/radix_tlb.c | 7 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index

[RFC PATCH] powerpc/64s: CONFIG_PPC_HASH_MMU

2020-03-01 Thread Nicholas Piggin
This allows the 64s hash MMU code to be compiled out if radix is selected. This saves about 128kB kernel image size (90kB text) on powernv_defconfig minus KVM, 40kB on a tiny config. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 1 + arch/powerpc/include

[PATCH] powerpc/build: vdso linker warning for orphan sections

2020-03-02 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vdso32/Makefile | 2 +- arch/powerpc/kernel/vdso32/vdso32.lds.S | 1 + arch/powerpc/kernel/vdso64/Makefile | 2 +- arch/powerpc/kernel/vdso64/vdso64.lds.S | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch

[PATCH] powerpc/64: BE option to use ELFv2 ABI for big endian kernels

2020-03-02 Thread Nicholas Piggin
: Nicholas Piggin --- arch/powerpc/Kconfig| 19 +++ arch/powerpc/Makefile | 15 ++- arch/powerpc/boot/Makefile | 4 drivers/crypto/vmx/Makefile | 4 drivers/crypto/vmx/aesp8-ppc.pl | 2 +- drivers/crypto/vmx/ppc-xlate.pl | 11

Re: [PATCH] powerpc/64: BE option to use ELFv2 ABI for big endian kernels

2020-03-04 Thread Nicholas Piggin
Segher Boessenkool's on March 4, 2020 9:09 am: > Hi! > > On Tue, Mar 03, 2020 at 11:45:27AM +1000, Nicholas Piggin wrote: >> Provide an option to use ELFv2 ABI for big endian builds. This works on >> GCC and clang (since 2014). it is is not officially supported by the GN

Re: [PATCH 2/2] powerpc/powernv: Wire up OPAL address lookups

2020-03-04 Thread Nicholas Piggin
Michael Ellerman's on March 3, 2020 9:43 pm: > Nicholas Piggin writes: >> Use ARCH_HAS_ADDRESS_LOOKUP to look up the opal symbol table. This >> allows crashes and xmon debugging to print firmware symbols. >> >> Oops: System Reset, sig: 6 [#1] >> LE PA

Re: [PATCH] Add OPAL_GET_SYMBOL / OPAL_LOOKUP_SYMBOL

2020-03-06 Thread Nicholas Piggin
Oliver O'Halloran's on March 6, 2020 12:42 pm: > On Fri, Feb 28, 2020 at 2:09 PM Nicholas Piggin wrote: >> >> These calls can be used by Linux to annotate BUG addresses with symbols, >> look up symbol addresses in xmon, etc. >> >> This is preferable

[PATCH] Fix powerpc/64: system call zero volatile registers when returning

2020-03-06 Thread Nicholas Piggin
Here's an incremental fix that can be folded into the patch. Segher Boessenkool's on February 26, 2020 7:20 am: > Hi! > > On Wed, Feb 26, 2020 at 03:35:35AM +1000, Nicholas Piggin wrote: >> Kernel addresses and potentially other sensitive data could be leaked >>

Re: [PATCH] powerpc/64: BE option to use ELFv2 ABI for big endian kernels

2020-03-06 Thread Nicholas Piggin
Segher Boessenkool's on March 5, 2020 8:55 pm: > On Thu, Mar 05, 2020 at 01:34:22PM +1000, Nicholas Piggin wrote: >> Segher Boessenkool's on March 4, 2020 9:09 am: >> >> +override flavour := linux-ppc64v2 >> > >> > That isn't a good name, he

Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems

2020-03-06 Thread Nicholas Piggin
Daniel Axtens's on March 6, 2020 5:30 pm: > kcov instrumentation is collected the __sanitizer_cov_trace_pc hook in > kernel/kcov.c. The compiler inserts these hooks into every basic block > unless kcov is disabled for that file. > > We then have a deep call-chain: > - __sanitizer_cov_trace_pc cal

Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems

2020-03-13 Thread Nicholas Piggin
Daniel Axtens's on March 11, 2020 9:03 am: So: - change the test when setting up a PACA to consider the actual value of the MSR rather than the CPU feature. - move the PACA setup to before the cpu feature parsing. >>> >>> Hmm. Problem is that equally we want PACA to b

Re: [PATCH] powerpc/pseries: Fix MCE handling on pseries

2020-03-13 Thread Nicholas Piggin
Ganesh Goudar's on March 14, 2020 12:04 am: > MCE handling on pSeries platform fails as recent rework to use common > code for pSeries and PowerNV in machine check error handling tries to > access per-cpu variables in realmode. The per-cpu variables may be > outside the RMO region on pSeries platfo

[PATCH 0/7] powerpc/64: machine check and other RAS fixes

2020-03-17 Thread Nicholas Piggin
previous kernels but it might want to be backported. We can do that after upstreaming. This doesn't solve Ganesh's machine check RMO problem, but at least the reconciling should help squash some warnings. Thanks, Nick Nicholas Piggin (7): powerpc/64: mark emergency stacks valid t

[PATCH 1/7] powerpc/64: mark emergency stacks valid to unwind

2020-03-17 Thread Nicholas Piggin
00 6000 7d2000a6 71298000 4c820020 <0fe0> 4e800020 6000 6000 Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kern

[PATCH 2/7] powerpc/pseries/ras: avoid calling rtas_token in NMI paths

2020-03-17 Thread Nicholas Piggin
In the interest of reducing code and possible failures in the machine check and system reset paths, grab the "ibm,nmi-interlock" token at init time. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/firmware.h| 1 + arch/powerpc/platforms/pseries/ras.c | 2 +- ar

[PATCH 3/7] powerpc/64s: Change irq reconcile for NMIs from reusing _DAR to RESULT

2020-03-17 Thread Nicholas Piggin
A spare interrupt stack slot is needed to save irq state when reconciling NMIs (sreset and decrementer soft-nmi). _DAR is used for this, but we want to reconcile machine checks as well, which do use _DAR. Switch to using RESULT instead, as it's used by system calls. Signed-off-by: Nicholas P

[PATCH 4/7] powerpc/64s: machine check reconcile irq state

2020-03-17 Thread Nicholas Piggin
] machine_check_early_common+0x134/0x1f0 --- interrupt: 200 at 0x13f1307c8 LR = 0x7fff888b8528 Instruction dump: 6000 7d2000a6 71298000 41820068 3922 7d210164 4b9c 6000 6000 7d2000a6 71298000 4c820020 <0fe0> 4e800020 6000 6000 Signed-off-by: Ni

[PATCH 5/7] powerpc/pseries/ras: FWNMI_VALID off by one

2020-03-17 Thread Nicholas Piggin
This was discovered developing qemu fwnmi sreset support. This off-by-one bug means the last 16 bytes of the rtas area can not be used for a 16 byte save area. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH 6/7] powerpc/pseries/ras: fwnmi avoid modifying r3 in error case

2020-03-17 Thread Nicholas Piggin
If there is some error with the fwnmi save area, r3 has already been modified which doesn't help with debugging. Only update r3 when to restore the saved value. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 7 --- 1 file changed, 4 insertions(+), 3 dele

[PATCH 7/7] powerpc/pseries/ras: fwnmi sreset should not interlock

2020-03-17 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 48 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index a40598e6e525..833ae34b7fec 100644 ---

Re: [PATCH] powerpc/pseries: Fix MCE handling on pseries

2020-03-17 Thread Nicholas Piggin
Ganesh's on March 16, 2020 9:47 pm: > > > On 3/14/20 9:18 AM, Nicholas Piggin wrote: >> Ganesh Goudar's on March 14, 2020 12:04 am: >>> MCE handling on pSeries platform fails as recent rework to use common >>> code for pSeries and PowerNV in machine c

[PATCH] Fix "[v3, 28/32] powerpc/64s: interrupt implement exit logic in C"

2020-03-19 Thread Nicholas Piggin
Accessing thread_info flags can cause an SLB fault, so it must not be done with MSR[RI]=0, which leads to SLB unrecoverable fault error. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/syscall_64.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch

Re: [RFC PATCH] powerpc/64s: CONFIG_PPC_HASH_MMU

2020-03-19 Thread Nicholas Piggin
Michael Ellerman's on March 19, 2020 2:15 pm: > Nicholas Piggin writes: >> This allows the 64s hash MMU code to be compiled out if radix is >> selected. This saves about 128kB kernel image size (90kB text) on >> powernv_defconfig minus KVM, 40kB on a tiny config

Re: [PATCH] powerpc/pseries: Fix MCE handling on pseries

2020-03-19 Thread Nicholas Piggin
Ganesh's on March 18, 2020 12:35 am: > > > On 3/17/20 3:31 PM, Nicholas Piggin wrote: >> Ganesh's on March 16, 2020 9:47 pm: >>> >>> On 3/14/20 9:18 AM, Nicholas Piggin wrote: >>>> Ganesh Goudar's on March 14, 2020 12:04 am: >>

Re: [PATCH v3 25/32] powerpc/64: system call implement entry/exit logic in C

2020-03-19 Thread Nicholas Piggin
Christophe Leroy's on March 19, 2020 7:18 pm: > > > Le 25/02/2020 à 18:35, Nicholas Piggin a écrit : >> System call entry and particularly exit code is beyond the limit of what >> is reasonable to implement in asm. >> >> This conversion moves all co

[PATCH] powerpc/64s/hash: add torture_segments kernel boot option to increase SLB faults

2020-03-20 Thread Nicholas Piggin
This option increases the number of SLB misses by limiting the number of kernel SLB entries, and increased flushing of cached lookaside information. This helps stress test difficult to hit paths in the kernel. Signed-off-by: Nicholas Piggin --- .../admin-guide/kernel-parameters.txt

[PATCH] powerpc/pseries: avoid harmless preempt warning

2020-03-20 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/lpar.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 3c3da25b445c..e4ed5317f117 100644 --- a/arch/powerpc

[PATCH] powerpc/64: ftrace don't trace real mode

2020-03-20 Thread Nicholas Piggin
This warns and prevents tracing attempted in a real-mode context. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/trace/ftrace.c| 3 +++ .../powerpc/kernel/trace/ftrace_64_mprofile.S | 19 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a

[PATCH] powerpc/64: allow rtas to be called in real-mode, use this in machine check

2020-03-20 Thread Nicholas Piggin
uld not be rentered. Create minimal rtas call that should be usable by guest machine check code, use it there to call "ibm,nmi-interlock". Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/entry_64.S | 12 ++-- arch/p

Re: [PATCH] powerpc/64: ftrace don't trace real mode

2020-03-20 Thread Nicholas Piggin
Naveen N. Rao's on March 21, 2020 4:39 am: > Hi Nick, > > Nicholas Piggin wrote: >> This warns and prevents tracing attempted in a real-mode context. > > Is this something you're seeing often? Last time we looked at this, KVM > was the biggest offender and we

Re: [PATCH] powerpc/pseries: avoid harmless preempt warning

2020-03-20 Thread Nicholas Piggin
Christophe Leroy's on March 21, 2020 1:33 am: > > > Le 20/03/2020 à 16:24, Nicholas Piggin a écrit : >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/platforms/pseries/lpar.c | 10 +- >> 1 file changed, 9 insertions(+), 1 deletion(-) >

Re: [PATCH V7 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 18, 2020 5:27 am: > On Tue, 2020-03-17 at 16:28 +1100, Michael Ellerman wrote: >> Haren Myneni writes: >> > For each fault CRB, update fault address in CRB (fault_storage_addr) >> > and translation error status in CSB so that user space can touch the >> > fault address and

Re: [PATCH v8 01/14] powerpc/xive: Define xive_native_alloc_irq_on_chip()

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:12 pm: > > This function allocates IRQ on a specific chip. VAS needs per chip > IRQ allocation and will have IRQ handler per VAS instance. Can't see a problem, but don't really know the XIVE code. Cédric seems like an obvious omission from CC here. Thanks, Nic

Re: [PATCH v8 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:13 pm: > > Kernel sets fault address and status in CRB for NX page fault on user > space address after processing page fault. User space gets the signal > and handles the fault mentioned in CRB by bringing the page in to > memory and send NX request again. > > S

Re: [PATCH v8 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:14 pm: > > Alloc IRQ and get trigger port address for each VAS instance. Kernel > register this IRQ per VAS instance and sets this port for each send > window. NX interrupts the kernel when it sees page fault. Again, should cc Cedric and Greg for XIVE / interrup

Re: [PATCH v8 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 23, 2020 10:57 am: > On Mon, 2020-03-23 at 10:30 +1000, Nicholas Piggin wrote: >> Haren Myneni's on March 19, 2020 4:13 pm: >> > >> > Kernel sets fault address and status in CRB for NX page fault on user >> > space address af

Re: [PATCH v8 06/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:15 pm: > > Setup thread IRQ handler per each VAS instance. When NX sees a fault > on CRB, kernel gets an interrupt and vas_fault_handler will be > executed to process fault CRBs. Read all valid CRBs from fault FIFO, > determine the corresponding send window from

Re: [PATCH v8 08/14] powerpc/vas: Take reference to PID and mm for user space windows

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:16 pm: > > When process opens a window, its pid and tgid will be saved in vas_window > struct. This window will be closed when the process exits. Kernel handles > NX faults by updating CSB or send SEGV signal to pid if user space csb_addr > is invalid. Bit of a

Re: [PATCH v8 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:17 pm: > > For each fault CRB, update fault address in CRB (fault_storage_addr) > and translation error status in CSB so that user space can touch the > fault address and resend the request. If the user space passed invalid > CSB address send signal to process wi

Re: [PATCH v8 11/14] powerpc/vas: Do not use default credits for receive window

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:18 pm: > > System checkstops if RxFIFO overruns with more requests than the > maximum possible number of CRBs allowed in FIFO at any time. So > max credits value (rxattr.wcreds_max) is set and is passed to > vas_rx_win_open() by the the driver. This seems like i

Re: [PATCH v8 12/14] powerpc/vas: Return credits after handling fault

2020-03-22 Thread Nicholas Piggin
Haren Myneni's on March 19, 2020 4:19 pm: > > NX expects OS to return credit for send window after processing each > fault. Also credit has to be returned even for fault window. And this should be merged in the fault handler function. > > Signed-off-by: Sukadev Bhattiprolu > Signed-off-by: Har

Re: [PATCH] powerpc/64: ftrace don't trace real mode

2020-03-22 Thread Nicholas Piggin
Naveen N. Rao's on March 23, 2020 2:17 am: > Nicholas Piggin wrote: >> Naveen N. Rao's on March 21, 2020 4:39 am: >>> Hi Nick, >>> >>> Nicholas Piggin wrote: >>>> This warns and prevents tracing attempted in a real-mode context. >>&

[PATCH 1/2] Fix "[v3, 25/32] powerpc/64: system call implement entry/exit logic in C"

2020-03-22 Thread Nicholas Piggin
Changes Christophe asked for to help ppc32 implementation, and move a stray hunk into a later patch. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 4 --- arch/powerpc/include/asm/cputime.h| 38 +-- 2 files changed, 21 insertions

[PATCH 2/2] Fix 2 "[v3, 28/32] powerpc/64s: interrupt implement exit logic in C"

2020-03-22 Thread Nicholas Piggin
This completes the move of the stray hunk. Also fixes an irq tracer bug, returning to irqs-disabled context should not trace_hardirqs_on(). Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 2 ++ arch/powerpc/kernel/syscall_64.c | 1 - 2 files changed, 2

  1   2   3   4   5   6   7   8   9   10   >