On Thu Nov 10, 2022 at 10:39 AM AEST, Jordan Niethe wrote:
> On Thu, 2022-07-28 at 16:31 +1000, Nicholas Piggin wrote:
> [resend as utf-8, not utf-7]
> > The first 16 bits of the lock are only modified by the owner, and other
> > modifications always use atomic operations on the
On Thu Nov 10, 2022 at 10:36 AM AEST, Jordan Niethe wrote:
> On Thu, 2022-07-28 at 16:31 +1000, Nicholas Piggin wrote:
>
> [resend as utf-8, not utf-7]
> >
> > +/*
> > + * Bitfields in the atomic value:
> > + *
> > + * 0: locked bit
> > +
On Thu Nov 10, 2022 at 10:35 AM AEST, Jordan Niethe wrote:
> On Thu, 2022-07-28 at 16:31 +1000, Nicholas Piggin wrote:
>
> > -#define queued_spin_lock queued_spin_lock
> >
> > -static inline void queued_spin_unlock(struct qspinlock *lock)
> > +static __always_
On Tue Nov 8, 2022 at 2:39 AM AEST, Segher Boessenkool wrote:
> Hi!
>
> On Mon, Nov 07, 2022 at 02:31:59PM +1100, Rohan McLure wrote:
> > Add Kconfig option for enabling clearing of registers on arrival in an
> > interrupt handler. This reduces the speculation influence of registers
> > on kernel
on't mind either way.
Thanks,
Nick
>
> Le 31/10/2022 à 06:54, Nicholas Piggin a écrit :
> > ---
> > arch/powerpc/include/asm/ppc_asm.h | 18 --
> > 1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm
On Sat Nov 5, 2022 at 6:00 PM AEST, Christophe Leroy wrote:
>
>
> Le 04/11/2022 à 18:27, Andrew Donnellan a écrit :
> > powerpc unfortunately has too many places where we run stuff in real mode.
> >
> > With CONFIG_VMAP_STACK enabled, this means we need to be able to swap the
> > stack pointer to
On Mon Nov 7, 2022 at 10:58 AM AEST, Russell Currey wrote:
> On Mon, 2022-10-31 at 15:54 +1000, Nicholas Piggin wrote:
> > Most callers just want to validate an arbitrary kernel stack pointer,
> > some need a particular size. Make the size case the exceptional one
> > w
On Mon Nov 7, 2022 at 4:58 PM AEST, Benjamin Gray wrote:
> On Thu, 2022-11-03 at 11:39 +1100, Benjamin Gray wrote:
> > On Wed, 2022-11-02 at 09:56 +, Christophe Leroy wrote:
> > > By the way, 'extern' keyword is pointless and deprecated for
> > > functions
> > > prototypes, please don't add
On Thu Nov 3, 2022 at 6:35 PM AEST, Christophe Leroy wrote:
>
>
> Le 31/10/2022 à 13:07, Nicholas Piggin a écrit :
> > Override the generic module ELF check to provide a check for the ELF ABI
> > version. This becomes important if we allow big-endian ELF ABI V2 builds
&g
On Sat Oct 29, 2022 at 2:00 AM AEST, Laurent Dufour wrote:
> At boot time, the FDT is parsed to compute the number of CPUs.
> In addition count the number of CPU nodes and export it.
>
> This is useful when building the FDT for a kexeced kernel since we need to
> take in account the CPU node added
On Tue Oct 25, 2022 at 1:38 PM AEST, Rohan McLure wrote:
> Stack frames used by syscall handlers support random offsets as of
> commit f4a0318f278d (powerpc: add support for syscall stack randomization).
> Implement the same for general interrupt handlers, by applying the
> random stack offset and
+linux-arch
FYI most preempt_enable_no_resched() calls outside of core scheduler
code come from kprobes copy-and-paste, and can possibly be fixed in
similar ways as this series. It's a bit of a footgun API that should
be banished from outside kernel/sched/, at least without an explicit
comment
ult to zero in optprobes. These are not
> relevant under kprobes and should not be used by the handlers.
This is for CFAR, which we can't get anyway because we just branched
here. I would rather zero it explicitly though.
Otherwise,
Reviewed-by: Nicholas Piggin
>
> Signed-off-by: Naveen N.
gt; just use preempt_enable().
Reviewed-by: Nicholas Piggin
>
> Reported-by: Nicholas Piggin
> Signed-off-by: Naveen N. Rao
> ---
> arch/powerpc/kernel/kprobes.c | 12 ++--
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/kernel/kprobes.c b/a
removed irq disabling for optprobes in commit f72180cc93a2c6
> ("powerpc/kprobes: Do not disable interrupts for optprobes and
> kprobes_on_ftrace").
Looks okay. Even if we did have irqs disabled here, we should just use
preempt_enable(), which nests properly inside or outside loc
isable preemption around the call to
> get_kprobe(). Drop the same.
And prepare_kprobe() and register_aggr_kprobe() are both called with
kprobe_mutex held so you rely on the same protection. This seems to
fix a lost-resched bug with preempt kernels too.
Reviewed-by: Nicholas Piggin
>
>
]
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/module.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index f6d6ae0a1692..d46bf9bfda26 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel
elf_validity_check().
Cc: Michael Ellerman
Signed-off-by: Jessica Yu
[np: added changelog, adjust name, rebase]
Signed-off-by: Nicholas Piggin
---
include/linux/moduleloader.h | 3 +++
kernel/module/main.c | 10 ++
2 files changed, 13 insertions(+)
diff --git a/include/linux/moduleloader.h
object to the
code in the first place).
Thanks,
Nick
Nicholas Piggin (2):
module: add module_elf_check_arch for module-specific checks
powerpc/64: Add module check for ELF ABI version
arch/powerpc/kernel/module.c | 17 +
include/linux/moduleloader.h | 3 +++
kernel/module/main.c
There are 4 unused bytes in the minimum frame in the ELFv2 ABI. At the
risk of causing a future ABI incompatibility, use this and save 16 bytes
from interrupt and switch frames.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 15 ++-
1 file changed, 10
The marker is a 32-bit constant across all platforms now, so use 32-bit
memory accesses.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h| 1 -
arch/powerpc/kernel/exceptions-64e.S | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel/interrupt_64.S
This is equal to STACK_FRAME_MIN_SIZE on 32-bit and 64-bit ELFv1, and no
longer used in 64-bit ELFv2, so replace it with that constant.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff
This requires an extra 16 bytes beyond the minimum frame size for the
aligned regs marker for the int frame. The switch frame needs to match
that because they share some offset definitions.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 21 +++--
1 file
This affects only 64-bit ELFv2 kernels, and reduces the minimum
asm-created stack frame size from 112 to 32 byte on those kernels.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/head_40x.S | 2 +-
arch/powerpc/kernel/head_44x.S | 6 +++---
arch/powerpc/kernel/head_64.S
Most callers just want to validate an arbitrary kernel stack pointer,
some need a particular size. Make the size case the exceptional one
with an extra function.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/processor.h | 15 ---
arch/powerpc/kernel/process.c
egs ... ]
NIP [7fffa72f56d8] 0x7fffa72f56d8
LR [] 0x0
--- interrupt: 3000
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/process.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 27956831f
-by: Nicholas Piggin
---
arch/powerpc/kernel/process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a097879b0474..27956831fa5d 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
This is open-coded in process.c, ppc32 uses a different define with the
same value, and the C definition is name differently which makes it an
extra indirection to grep for.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 6 --
arch/powerpc/kernel/asm-offsets.c | 2
The user interrupt frame is a different size from the kernel frame, so
give it its own name.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 6 +++---
arch/powerpc/kernel/process.c | 6 +++---
arch/powerpc/kernel/stacktrace.c | 4 ++--
3 files changed, 8 insertions
This is a count of longs from the stack pointer to the regs marker.
Rename it to make it more distinct from the other byte offsets. It
can be derived from the byte offset definitions just added.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 4 ++--
arch/powerpc/kernel
Define a constant rather than open-code the offset for the
"regs" marker.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 2 ++
arch/powerpc/kernel/entry_32.S | 2 +-
arch/powerpc/kernel/exceptions-64e.S| 2 +-
arch/powerpc/kernel/except
This is a common offset that currently uses the overloaded
STACK_FRAME_OVERHEAD constant. It's easier to read and more
flexible to use a specific regs offset for this.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h | 2 +
arch/powerpc/kernel/asm-offsets.c
Adjust the pt_regs pointer so the interrupt frame offsets can be used
directly to save registers.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/ppc_save_regs.S | 58 +++--
1 file changed, 14 insertions(+), 44 deletions(-)
diff --git a/arch/powerpc/kernel
---
arch/powerpc/include/asm/ppc_asm.h | 18 --
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/ppc_asm.h
b/arch/powerpc/include/asm/ppc_asm.h
index 753a2757bcd4..ac44383d350a 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++
This call may use the min size stack frame. The scratch space used is
in the caller's parameter area frame, not this function's frame.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/platforms/pseries/hvCall.S | 38 +
1 file changed, 20 insertions(+), 18 deletions
These are unused. Remove.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/irqflags.h | 29 -
1 file changed, 29 deletions(-)
diff --git a/arch/powerpc/include/asm/irqflags.h
b/arch/powerpc/include/asm/irqflags.h
index 1a6c1ce17735..81e0a5025be8 100644
This makes it a bit clearer where the stack frame is created, and will
allow easier use of some of the stack offset constants in a later
change.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/process.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch
as a fix.
Thanks,
Nick
Nicholas Piggin (19):
powerpc/perf: callchain validate kernel stack pointer bounds
powerpc: Rearrange copy_thread child stack creation
powerpc/64: Remove asm interrupt tracing call helpers
powerpc/pseries: hvcall stack frame overhead
powerpc/32: Use load and store
The interrupt frame detection and loads from the hypothetical pt_regs
are not bounds-checked. The next-frame validation only bounds-checks
STACK_FRAME_OVERHEAD, which does not include the pt_regs. Add another
test for this.
Signed-off-by: Nicholas Piggin
---
Could the user set r1 to be equal
the features that might be
enabled by nmi_enter(), like RCU or printk are unlikely to be usable
in real mode anyway.
Reported-by: Michael Ellerman
Cc: Mahesh Salgaonkar
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/interrupt.h | 49 +---
1 file changed, 16 insertions
the TLB (in the case of bare metal) to increase and slightly
randomise kernel fault activity.
Signed-off-by: Nicholas Piggin
---
I tried this a while ago and it had some lockup issues, I think I fixed
them. Deadlock if the same hpte group is used as the one to be cleared,
solved by deferring
when
returning to soft-masked context")
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/interrupt_64.S | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/interrupt_64.S
b/arch/powerpc/kernel/interrupt_64.S
index 978a173eb339..a019ed6fc8
On Thu Oct 20, 2022 at 2:55 PM AEST, Sachin Sant wrote:
> While running powerpc kselftests (mm/stress_code_patching.sh)
> on a PowerVM LPAR following warning is seen. The test passes.
> I can reliably recreate it on a Power9 server, not so easily on
> Power10.
>
> # ./stress_code_patching.sh
>
On Wed Oct 19, 2022 at 8:21 PM AEST, Dan Horák wrote:
> Hi,
>
> in my first boot with the 6.1 rc1 kernel I have received a couple of
> warnings from change_protection on Talos II P9 system, see the details
> below. Nothing like that was noticed in 6.0 or earlier.
Thanks for the report. This is a
The context tracking code in PR-KVM and BookE implementations is not
complete, and can cause host crashes if context tracking is enabled.
Make these implementations depend on !CONTEXT_TRACKING_USER.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kvm/Kconfig | 4
1 file changed, 4
These are several fixes for regressions and crash bugs. Since v1
I cut down the fixes to a minimum.
Thanks,
Nick
Nicholas Piggin (2):
KVM: PPC: BookS PR-KVM and BookE do not support context tracking
powerpc/64/interrupt: Prevent NMI PMI causing a dangerous warning
arch/powerpc/kernel
.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64e.S | 7 +++
arch/powerpc/kernel/exceptions-64s.S | 7 +++
arch/powerpc/kernel/interrupt.c | 12 +---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64e.S
b
This lock is taken while the raw kfence_freelist_lock is held, so it
must also be a raw spinlock, as reported by lockdep when raw lock
nesting checking is enabled.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/mm/book3s64/hash_utils.c | 12 ++--
1 file changed, 6 insertions(+), 6
ile taking either of these
locks. Don't just disable bh because several of the more common cases
already disable irqs, so this just makes the locks always irq-safe.
Reported-by: Guenter Roeck
Signed-off-by: Nicholas Piggin
---
arch/powerpc/mm/book3s64/hash_native.c | 27 --
1 f
Add lockdep annotation for the HPTE bit-spinlock. Modern systems don't
take the tlbie lock, so this shows up some of the same lockdep warnings
that were being reported by the ppc970. And they're not taken in exactly
the same places so this is nice to have in its own right.
Signed-off-by: Nicholas
by
generating an interrupt to reschedule the context if need_resched() got
set.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/lib/vmx-helper.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/lib/vmx-helper.c b/arch/powerpc/lib/vmx-helper.c
index
apply_to_page_range on kernel pages does not disable preemption, which
is a requirement for hash's lazy mmu mode, which keeps track of the
TLBs to flush with a per-cpu array.
Reported-by: Guenter Roeck
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/book3s/64/tlbflush-hash.h | 6
. This leaves a small chance that this thread will be migrated to
another CPU, so the master work would be done by a CPU from a different
context. Better for test coverage to make that a common case by just
having the first CPU to call in become the master.
Signed-off-by: Nicholas Piggin
---
arch/powerpc
The recently moved dtl code must be compiled-in if
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y even if CONFIG_DTL=n.
Reported-by: Guenter Roeck
Fixes: 6ba5aa541aaa0 ("powerpc/pseries: Move dtl scanning and steal time
accounting to pseries platform")
Signed-off-by: Nicholas Piggin
---
ar
("powerpc/64/interrupt: Fix return to masked context after
hard-mask irq becomes pending")
Signed-off-by: Nicholas Piggin
---
I credit Sachin as well because he likely ran into it here,
https://lists.ozlabs.org/pipermail/linuxppc-dev/2022-March/240971.html
It was much more difficult to
On Thu Oct 13, 2022 at 10:21 AM AEST, Guenter Roeck wrote:
> On Thu, Oct 13, 2022 at 11:03:34AM +1100, Michael Ellerman wrote:
> > Guenter Roeck writes:
> > > On Wed, Oct 12, 2022 at 11:20:38AM -0600, Jason A. Donenfeld wrote:
> > >>
> > >> I've also managed to not hit this bug a few times. When
On Thu Oct 13, 2022 at 4:37 AM AEST, Jason A. Donenfeld wrote:
> On Wed, Oct 12, 2022 at 10:48:26AM -0700, Guenter Roeck wrote:
> > > I've also managed to not hit this bug a few times. When it triggers,
> > > after "kprobes: kprobe jump-optimization is enabled. All kprobes are
> > > optimized if
On Thu Oct 13, 2022 at 2:43 PM AEST, Guenter Roeck wrote:
> On 10/12/22 10:20, Jason A. Donenfeld wrote:
> > On Wed, Oct 12, 2022 at 09:44:52AM -0700, Guenter Roeck wrote:
> >> On Wed, Oct 12, 2022 at 09:49:26AM -0600, Jason A. Donenfeld wrote:
> >>> On Wed, Oct 12, 2022 at 07:18:27AM -0700,
On Thu Oct 13, 2022 at 10:21 AM AEST, Guenter Roeck wrote:
> On Thu, Oct 13, 2022 at 11:03:34AM +1100, Michael Ellerman wrote:
> > Guenter Roeck writes:
> > > On Wed, Oct 12, 2022 at 11:20:38AM -0600, Jason A. Donenfeld wrote:
> > >>
> > >> I've also managed to not hit this bug a few times. When
and bisecting this and
developing a trivial reproducer. The perfect bug report.
Reported-by: Jason A. Donenfeld
Signed-off-by: Nicholas Piggin
---
Since posting the patch in the bug thread:
- dropped sync_file_range2 from the ppc32 syscalls.
- updated some comments on sys_ppc32.c, which now has
sync_file_range2 is not a special unaligned-odd-pair calling convention
syscall, it's just a regular one that does not have a generic compat
definition. Move it out of sys_ppc32.c and into syscalls.c.
Signed-off-by: Nicholas Piggin
---
This one doesn't fix anything and is not required
On Tue Oct 11, 2022 at 7:35 PM AEST, Michael Ellerman wrote:
> "Jason A. Donenfeld" writes:
> > On Tue, Oct 11, 2022 at 12:53:17PM +1100, Michael Ellerman wrote:
> >> "Jason A. Donenfeld" writes:
> >> > On Mon, Oct 10, 2022 at 01:25:25PM -0600, Jason A. Donenfeld wrote:
> >> >> Hi Michael,
> >>
On Thu Sep 29, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote:
> On Wed, Sep 28, 2022 at 10:51 AM Nicholas Piggin wrote:
> >
> > On Wed Sep 28, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote:
> > > Thank Nick for reviewing my patch
> > >
> > > On Tue, Sep 27, 2022
On Fri Oct 7, 2022 at 4:07 AM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 08:23, Nicholas Piggin a écrit :
> > On Fri Sep 23, 2022 at 3:46 PM AEST, Christophe Leroy wrote:
> >>
> >>
> >> Le 23/09/2022 à 05:30, Nicholas Piggin a écrit :
> >>
On Fri Oct 7, 2022 at 9:23 AM AEST, Segher Boessenkool wrote:
> On Fri, Oct 07, 2022 at 07:56:09AM +1000, Nicholas Piggin wrote:
> > On Fri Oct 7, 2022 at 5:54 AM AEST, Segher Boessenkool wrote:
> > > On Fri, Sep 23, 2022 at 01:30:04PM +1000, Nicholas Piggin wrote:
>
On Fri Oct 7, 2022 at 4:07 AM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 08:23, Nicholas Piggin a écrit :
> > On Fri Sep 23, 2022 at 3:46 PM AEST, Christophe Leroy wrote:
> >>
> >>
> >> Le 23/09/2022 à 05:30, Nicholas Piggin a écrit :
> >>
On Fri Oct 7, 2022 at 5:54 AM AEST, Segher Boessenkool wrote:
> Hi!
>
> On Fri, Sep 23, 2022 at 01:30:04PM +1000, Nicholas Piggin wrote:
> > This adds basic POWER10_CPU option, which builds with -mcpu=power10.
>
> > +# No prefix or pcrel
> > +KBUILD_CFLAGS +=
If the boot CPU tries to access per-cpu data of other CPUs before
per cpu areas are set up, it will unexpectedly use offset 0.
Try to catch such accesses by poisoning the __per_cpu_offset array.
Signed-off-by: Nicholas Piggin
---
With the early boot machine check handler added to 64s
The hard-coded marker is out of date now, fix it using the nice define.
Fixes: 17773afdcd15 ("powerpc/64: use 32-bit immediate for
STACK_FRAME_REGS_MARKER")
Reported-by: Joel Stanley
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +-
1 file changed, 1
Use irq_enter/irq_exit around irq replay to prevent softirqs running
while interrupts are being replayed. Instead they run at the irq_exit()
call where reentrancy is less problematic. A new PACA_IRQ_REPLAYING is
added to prevent interrupt handlers hard-enabling EE while being
replayed.
---
I
that isn't tested, but
it should work, modulo possible incorrect instruction relocation
address when enabling IR.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kvm/Kconfig | 2 --
arch/powerpc/kvm/book3s_exports.c| 7 +++
arch/powerpc/kvm/book3s_pr.c | 10 +-
arch
cputime_t is no longer a type, so VIRT_CPU_ACCOUNTING_GEN does not
have any affect on the type for 32-bit architectures, so there is
no reason it can't be supported.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/Kconfig
Context tracking involves tracking user, kernel, guest switches. This
enables existing context tracking code for interrupt entry on 32-bit.
interrupt exit already has context tracking calls, and KVM can not be
selected if CONTEXT_TRACKING_USER=y.
Signed-off-by: Nicholas Piggin
---
arch/powerpc
On top of the previous fix to prevent KVM being selected with
context tracking on 32-bit, this should be good to go.
Since RFC:
- Improved code sharing in interrupt.h
- Minimal patch for VIRT_CPU_ACCOUNTING_GEN support
Thanks,
Nick
Nicholas Piggin (2):
powerpc/32: implement
].
This also tidies some of the warnings, no need to duplicate them in
both should_hard_irq_enable() and do_hard_irq_enable().
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/hw_irq.h | 41 ++-
arch/powerpc/kernel/dbell.c | 2 +-
arch/powerpc/kernel
interrupt would hit while reporting bug, and
that would cause another bug, and so on.
Work around this for now just by disabling that warning on 64e, which
improves stability. Make a note of what the cleaner fix would be.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64e.S | 7
EXCEPTION_RESTORE_REGS, so
this makes perf interrupts consistent with that and seems like the best
fix.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64s.S | 14 +-
arch/powerpc/kernel/traps.c | 2 --
2 files changed, 13 insertions(+), 3 deletions(-)
diff
The context tracking code in PR-KVM and BookE implementations is not
complete, and can cause host crashes if context tracking is enabled.
Make these implementations depend on !CONTEXT_TRACKING_USER.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kvm/Kconfig | 4
1 file changed, 4
These are several fixes for regressions and bugs that can crash
the host.
Thanks,
Nick
Nicholas Piggin (4):
KVM: PPC: BookS PR-KVM and BookE do not support context tracking
powerpc/64s/interrupt: Perf NMI should not take normal exit path
powerpc/64e/interrupt: Prevent NMI PMI causing
o_nsecs()") did that, but justdidn't remove
the then-unused cputime_to_usecs(), cputime_t type, and associated
remnants.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/cputime.h | 17 +
arch/powerpc/kernel/time.c | 23 ++-
2 files changed,
On Tue Oct 4, 2022 at 9:32 PM AEST, Christophe Leroy wrote:
>
>
> Le 04/10/2022 à 08:33, Nicholas Piggin a écrit :
> > Context tracking involves tracking user, kernel, guest switches. This
> > enables existing context tracking code for interrupt entry on 32-bit.
> > KVM
On Tue Oct 4, 2022 at 9:58 PM AEST, Christophe Leroy wrote:
>
>
> Le 04/10/2022 à 08:33, Nicholas Piggin a écrit :
> > Doesn't seem to be much more involved in adding context tracking and
> > generic virt cpu accounting support for 32-bit, which is all that's
> >
move early boot ILE fixup into a
macro")
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64s.S | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S
b/arch/powerpc/kernel/exceptions-64s.S
index fed983cc7ee0..ec5dfc7b5517 100644
--- a/ar
ve it.
Cc: linux-a...@vger.kernel.org
Cc: Kevin Hilman
Cc: Frederic Weisbecker
Signed-off-by: Nicholas Piggin
---
arch/Kconfig | 11 ---
arch/arm/Kconfig | 1 -
arch/csky/Kconfig | 1 -
arch/loongarch/Kconfig | 1 -
arch/mips/Kconfig | 1 -
arch/xtensa/Kconf
cputime_t is no longer, converted to u64.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/cputime.h | 17 +
arch/powerpc/kernel/time.c | 23 ++-
2 files changed, 3 insertions(+), 37 deletions(-)
diff --git a/arch/powerpc/include/asm
Context tracking involves tracking user, kernel, guest switches. This
enables existing context tracking code for interrupt entry on 32-bit.
KVM and interrupt exit already has context tracking calls.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc
if it can be tested.
I assume the virt cpu accounting gen option removal is okay, but not
exactly sure what to look for in terms of possible problems, so we'll
see what comments that gets back.
Thanks,
Nick
Nicholas Piggin (3):
powerpc/32: Implement HAVE_CONTEXT_TRACKING_USER support
powerpc
() | MSR_FP) is racy if it can
be called with local irqs disabled, unless a hard_irq_disable has been
done.
Reported-by: Sachin Sant
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/hw_irq.h | 24
arch/powerpc/kernel/process.c | 4 ++--
2 files changed, 26
This new assertion added is generally harmless and gets fixed up
naturally, but it does indicate a problem with MSR manipulation
somewhere.
Fixes: c39fb71a54f0 ("powerpc/64s/interrupt: masked handler debug check for
previous hard disable")
Reported-by: Sachin Sant
Signed-off-by: Nicho
On Sat Sep 24, 2022 at 2:47 AM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 17:41, Nicholas Piggin a écrit :
> > WARN_ONCE and similar are often used in frequently executed code, and
> > should not crash the system. The program check interrupt caused by
> > WARN_O
arch/powerpc/kernel/systbl_chk.sh has not been referenced since commit
ab66dcc76d6a ("powerpc: generate uapi header and system call table
files"). Remove it.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/systbl_chk.sh | 30 --
1 file changed, 30
endian, so
> it always appears as "REGS", eg:
>
> c4733e70 52454753 |REGS|
>
> Signed-off-by: Michael Ellerman
Both look fine to me.
Acked-by: Nicholas Piggin
> ---
> arch/powerpc/include/asm/ptrace.h | 5 +
>
On Wed Sep 28, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote:
> Thank Nick for reviewing my patch
>
> On Tue, Sep 27, 2022 at 12:25 PM Nicholas Piggin wrote:
> >
> > On Tue Sep 27, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote:
> > > This is second version of my fix to P
On Tue Sep 27, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote:
> This is second version of my fix to PPC's "WARNING: suspicious RCU usage",
> I improved my fix under Paul E. McKenney's guidance:
> Link:
> https://lore.kernel.org/lkml/20220914021528.15946-1-zhouzho...@gmail.com/T/
>
> During the cpu
On Mon Sep 26, 2022 at 4:18 PM AEST, Ganesh Goudar wrote:
> Part of machine check error handling is done in realmode,
> As of now instrumentation is not possible for any code that
> runs in realmode.
> When MCE is injected on KASAN enabled kernel, crash is
> observed, Hence force inline or mark no
could be printed to console at this point in any case because
even udbg is only set up after the boot paca is set, so this shouldn't
be missed.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64s.S | 15 +--
arch/powerpc/kernel/head_64.S| 3 +++
arch/powerpc
The idea is to get to the point where if r13 is non-zero, then it should
contain a reasonable paca. This can be used in early boot program check
and machine check handlers to avoid running off into the weeds if they
hit before r13 has a paca.
Signed-off-by: Nicholas Piggin
---
arch/powerpc
be used
as another fixed reg one day.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/reloc_64.S | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/reloc_64.S b/arch/powerpc/kernel/reloc_64.S
index 232e4549defe..efd52f2e7033 100644
, and the machine check stack is temporarily set to the
middle of the init task stack.
This allows machine checks (e.g., due to invalid data access in real
mode) to print something useful earlier in boot (as soon as udbg is set
up, if CONFIG_PPC_EARLY_DEBUG=y).
Signed-off-by: Nicholas Piggin
---
arch
In preparation for using this sequence in machine check interrupt, move
it into a macro, with a small change to make it position independent.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64s.S | 100 +++
1 file changed, 55 insertions(+), 45 deletions
701 - 800 of 6140 matches
Mail list logo