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
r14 could 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 10
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
This series provides a machine check handler to catch out of
bounds memory accesses in early boot before the MMU is enabled.
Since v1:
- 64e compile fix
Nicholas Piggin (5):
powerpc/64s/interrupt: move early boot ILE fixup into a macro
powerpc/64s: early boot machine check handler
powerpc
it
is more consistent with how interrupt handlers are called.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/irq_64.c | 93 +++-
1 file changed, 61 insertions(+), 32 deletions(-)
diff --git a/arch/powerpc/kernel/irq_64.c b/arch/powerpc/kernel/irq_64.c
for this and switch most bugs in
the interrupt entry wrapper over to use it.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/interrupt.h | 33 +---
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/include/asm/interrupt.h
b/arch
Prior changes eliminated cases of masked PACA_IRQ_MUST_HARD_MASK
interrupts that re-fire due to MSR[EE] being enabled while they are
pending. Add a debug check in the masked interrupt handler to catch
if this occurs.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/exceptions-64s.S | 10
unexpected and may trip warnings or cause
other problems as we tighten up this state management. Fix this by only
re-enabling if PACA_IRQ_HARD_DIS is clear.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/runlatch.h | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --
. interrupt_exit_kernel_prepare() clears PACA_IRQ_HARD_DIS
10. interrupt returns with MSR[EE]=1
11. PMU interrupt fires, perf handler runs
Fixes: 4423eb5ae32e ("powerpc/64/interrupt: make normal synchronous interrupts
enable MSR[EE] if possible")
Signed-off-by: Nicholas Piggin
---
arch/powe
ned-off-by: Nicholas Piggin
---
arch/powerpc/kernel/setup_64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 2b2d0b0fbb30..ce8fc6575eaa 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/
Commit 171476775d32 ("context_tracking: Convert state to atomic_t")
added a CONTEXT_IDLE state which can be encountered by interrupts from
kernel mode in the idle thread, causing a false positive warning.
Fixes: 171476775d32 ("context_tracking: Convert state to atomic_t")
Sig
No real changes since last posting, I just pulled fixes from several
series together and rearranged them and updated changelogs slightly.
Thanks,
Nick
Nicholas Piggin (7):
powerpc/64/interrupt: Fix false warning in context tracking due to
idle state
powerpc/64: mark irqs hard disabled in
The .toc section is not really intended for arbitrary data. Writable
data in particular prevents making the TOC read-only after relocation.
Move hcall_tracepoint_refcount into the .data section.
Signed-off-by: Nicholas Piggin
---
This is split out from "[v2,2/5] powerpc/64: asm use consi
t/toc optimization is not supported" messages by the linker. Having
r2 be one of the saved registers and using that for TOC addressing may
be the best way to avoid that and switch this to TOC addressing.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ppc_asm.h | 11 +++
ar
A later change stops the kernel using r2 and loads it with a poison
value. Provide a PACATOC loading abstraction which can hide this
detail.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ppc_asm.h | 6 ++
arch/powerpc/kernel/exceptions-64e.S | 12
There is no need to use GOT addressing within the kernel.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/boot/ppc_asm.h| 3 ++-
arch/powerpc/include/asm/ppc_asm.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot
Use helper macros to access global variables, and place them in .data
sections rather than in .toc. Putting addresses in TOC is not required
because the kernel is linked with a single TOC.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/boot/opal-calls.S | 6 +++---
arch/powerpc
ot wrapper compile.
Nicholas Piggin (5):
powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER
powerpc/64: asm use consistent global variable declaration and access
powerpc/64: switch asm helpers from GOT to TOC relative addressing
powerpc/64: provide a helper macro to load r2 with the
bytes and 64-bit has 0x in the top bytes.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h| 4 ++--
arch/powerpc/kernel/entry_32.S | 6 +++---
arch/powerpc/kernel/exceptions-64e.S | 8 +---
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel
On Sat Sep 24, 2022 at 8:15 AM AEST, Segher Boessenkool wrote:
> On Sat, Sep 24, 2022 at 02:26:52AM +1000, Nicholas Piggin wrote:
> > I still don't see what clauses guarantees asm("%0" ::"r"(foo)) to give
> > 13. It doesn't say access via inline assem
On Fri Sep 23, 2022 at 10:18 PM AEST, Segher Boessenkool wrote:
> On Fri, Sep 23, 2022 at 05:08:13PM +1000, Nicholas Piggin wrote:
> > On Tue Sep 20, 2022 at 4:41 PM AEST, Christophe Leroy wrote:
> > > local_paca is declared as global register asm("r13"), it is therefo
WARN_ONCE and similar are often used in frequently executed code, and
should not crash the system. The program check interrupt caused by
WARN_ON_ONCE can be a significant overhead even when nothing is being
printed. This can cause performance to become unacceptable, having the
same effective impact
adds a recovery address to the bug_entry struct instead of
using the extable. The size of the bug entry table plus the extable
go from 137kB to 126kB.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/Kconfig | 4
arch/powerpc/include/asm/bug.h | 31
On Fri Sep 23, 2022 at 1:02 AM AEST, Laurent Dufour wrote:
> On 28/07/2022 08:31:19, Nicholas Piggin wrote:
> > Provide an option that holds off queueing indefinitely while the lock
> > owner is preempted. This could reduce queueing latencies for very
> > overcomm
On Wed Sep 21, 2022 at 4:56 PM AEST, Rohan McLure wrote:
> Clear user state in gprs (assign to zero) to reduce the influence of user
> registers on speculation within kernel syscall handlers. Clears occur
> at the very beginning of the sc and scv 0 interrupt handlers, with
> restores occurring foll
muck around
What's this doing? Why can't it continue using the declaration in
syscalls.h?
Aside from that and the stray hunk to go in the previous patch,
Reviewed-by: Nicholas Piggin
Thanks,
Nick
+ regs->gpr[6], regs->gpr[7], regs->gpr[8]);
which got into your next patch.
Otherwise I think it looks good.
Reviewed-by: Nicholas Piggin
gnature type of the target handler.
>
> Signed-off-by: Rohan McLure
> Reported-by: Nicholas Piggin
Thanks for digging through it to make sure things will work right
without this. Some handlers look problematic without the rest of your
series, right? e.g., upstream compat_sys_mmap2 has long
On Thu Sep 22, 2022 at 1:22 AM AEST, Segher Boessenkool wrote:
> Hi!
>
> On Wed, Sep 21, 2022 at 11:01:18AM +1000, Nicholas Piggin wrote:
> > On Wed Sep 21, 2022 at 8:16 AM AEST, Segher Boessenkool wrote:
> > > On Tue, Sep 20, 2022 at 12:01:47AM +1000, Nicholas Piggin wrote
On Thu Sep 22, 2022 at 4:50 AM AEST, Segher Boessenkool wrote:
> On Wed, Sep 21, 2022 at 11:41:02AM +1000, Nicholas Piggin wrote:
> > Big-endian GENERIC_CPU supports 970, but builds with -mcpu=power5.
> > POWER5 is ISA v2.02 whereas 970 is v2.01 plus Altivec. 2.02 added
> > th
On Tue Sep 20, 2022 at 4:41 PM AEST, Christophe Leroy wrote:
> local_paca is declared as global register asm("r13"), it is therefore
> garantied to always ever be r13.
>
> It is therefore not required to opencode r13 in the assembly, use
> a reference to local_paca->irq_soft_mask instead.
>
> This
x27;t open code
> irq_soft_mask helpers"")
>
> irq_soft_mask_set_return() and irq_soft_mask_or_return()
> are overset of irq_soft_mask_set().
>
> Have them use irq_soft_mask_set() instead of duplicating it.
>
> Signed-off-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
> ---
> arch
On Fri Sep 23, 2022 at 3:46 PM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 05:30, Nicholas Piggin a écrit :
> > This adds basic POWER10_CPU option, which builds with -mcpu=power10.
> >
> > Signed-off-by: Nicholas Piggin
> > ---
> > There's quit
On Fri Sep 23, 2022 at 3:34 PM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 05:25, Nicholas Piggin a écrit :
> > Using a 32-bit constant for this marker allows it to be loaded with
> > two ALU instructions, like 32-bit. This avoids a TOC entry and a
> > TOC load t
This adds basic POWER10_CPU option, which builds with -mcpu=power10.
Signed-off-by: Nicholas Piggin
---
There's quite a lot of asm and linker changes slated for the next merge
window already so I may leave the pcrel patch for next time. I think we
can add the basic POWER10 build option t
t/toc optimization is not supported" messages by the linker. Having
r2 be one of the saved registers and using that for TOC addressing may
be the best way to avoid that and switch this to TOC addressing.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ppc_asm.h | 11 +++
ar
A later change stops the kernel using r2 and loads it with a poison
value. Provide a PACATOC loading abstraction which can hide this
detail.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ppc_asm.h | 6 ++
arch/powerpc/kernel/exceptions-64e.S | 12
There is no need to use GOT addressing within the kernel.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/boot/ppc_asm.h| 3 ++-
arch/powerpc/include/asm/ppc_asm.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot
Use helper macros to access global variables, and place them in .data
sections rather than in .toc. Putting addresses in TOC is not required
because the kernel is linked with a single TOC.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/boot/opal-calls.S | 6 +++---
arch/powerpc
bytes and 64-bit has 0x in the top bytes.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h| 5 +++--
arch/powerpc/kernel/entry_32.S | 6 +++---
arch/powerpc/kernel/exceptions-64e.S | 8 +---
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel
touching ppc32
much (only slight comment change and interrupt stack magic number
change).
Patch 2 is probably actually required before we make the TOC readonly
at runtime, because there is one case (hcall_tracepoint_refcount)
that puts read-write data in the TOC section.
Thanks,
Nick
Nicholas Piggin
Signed-off-by: Nicholas Piggin
---
The 970 option builds and boots a QEMU TCG 970 machine.
Documentation/powerpc/isa-versions.rst | 14 ++
arch/powerpc/Makefile | 5 +++--
arch/powerpc/platforms/Kconfig.cputype | 8
3 files changed, 21 insertions(+), 6
Big-endian GENERIC_CPU supports 970, but builds with -mcpu=power5.
POWER5 is ISA v2.02 whereas 970 is v2.01 plus Altivec. 2.02 added
the popcntb instruction which a compiler might use.
Use -mcpu=power4.
Fixes: 471d7ff8b51b ("powerpc/64s: Remove POWER4 support")
Signed-off-by: Nicho
On Wed Sep 21, 2022 at 8:16 AM AEST, Segher Boessenkool wrote:
> Hi!
>
> On Tue, Sep 20, 2022 at 12:01:47AM +1000, Nicholas Piggin wrote:
> > Update the 64s GENERIC_CPU option. POWER4 support has been dropped, so
> > make that clear in the option name.
>
> AFAIR the
benchmarks) on POWER10.
QEMU TCG only supports this instruction correctly since v7.1, versions
without the fix may cause hangs whne running POWER10 CPUs.
Reviewed-by: Segher Boessenkool
Signed-off-by: Nicholas Piggin
---
v4:
- Rebase, test with upstream qemu with fix
- Clarify asm commen
kernel only uses WC=0).
Reviewed-by: Segher Boessenkool
Signed-off-by: Nicholas Piggin
---
v2: Update naming, patch changelog and title.
v3: v2 sent incorrect patches, sorry.
v4: Rebase.
arch/powerpc/include/asm/ppc-opcode.h | 7 +--
arch/powerpc/kernel/idle_book3e.S | 2 +-
2 files
c5 next-20220916]
> > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > And when submitting patch, we suggest to use '--base' as documented in
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> >
> > url:
&
On Tue Sep 20, 2022 at 3:01 AM AEST, Christophe Leroy wrote:
> cpu_specs[] is full of #ifdefs depending on the different
> types of CPU.
>
> CPUs are mutually exclusive, it is therefore possible to split
> cpu_specs[] into smaller more readable pieces.
>
> Create cpu_specs_XXX.h that will each be d
nt PMU save/restore in
> C")
> Signed-off-by: Kajol Jain
And it was increased from 7 to 10 with 5752fe0b811bb which added the
POWER10 registers, so that makes sense to go back to 7 in the POWER8
path.
Reviewed-by: Nicholas Piggin
> ---
> arch/powerpc/include/asm/kvm_book3s_a
tions were missed to remove. Patch
> fixes by removing the unused macros.
>
> Signed-off-by: Disha Goel
Thanks, good cleanup.
Reviewed-by: Nicholas Piggin
> ---
> arch/powerpc/kernel/asm-offsets.c | 25 -
> 1 file changed, 25 deletions(-)
>
On Mon Sep 19, 2022 at 11:51 PM AEST, Nathan Lynch wrote:
> Nathan Lynch writes:
> > "Nicholas Piggin" writes:
> >> On Wed Sep 14, 2022 at 3:39 AM AEST, Leonardo Brás wrote:
> >>> On Mon, 2022-09-12 at 14:58 -0500, Nathan Lynch wrote:
> >>> &
On Mon Sep 19, 2022 at 4:03 PM AEST, Ganesh wrote:
> On 9/7/22 09:49, Nicholas Piggin wrote:
>
> > On Mon Sep 5, 2022 at 4:38 PM AEST, Ganesh Goudar wrote:
> >> Part of machine check error handling is done in realmode,
> >> As of now instrumentation is not possible
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
> Zero GPRS r0, r2-r11, r14-r31, on entry into the kernel for all
> other interrupt sources to limit influence of user-space values
> in potential speculation gadgets. The remaining gprs are overwritten by
> entry macros to interrupt handlers
ht end
up just simplifying code by always doing it... for now I'm happier to
have the option.
Acked-by: Nicholas Piggin
> ---
> V4 -> V5: New patch
> ---
> arch/powerpc/Kconfig | 9 +
> 1 file changed, 9 insertions(+)
>
> diff --git a/arch/powerpc/Kconfig b
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
> Clear user state in gprs (assign to zero) to reduce the influence of user
> registers on speculation within kernel syscall handlers. Clears occur
> at the very beginning of the sc and scv 0 interrupt handlers, with
> restores occurring foll
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
> Clear user state in gprs (assign to zero) to reduce the influence of user
> registers on speculation within kernel syscall handlers. Clears occur
> at the very beginning of the sc and scv 0 interrupt handlers, with
> restores occurring foll
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote:
> Implement syscall wrapper as per s390, x86, arm64. When enabled
> cause handlers to accept parameters from a stack frame rather than
> from user scratch register state. This allows for user registers to be
> safely cleared in order to reduc
defined there with the same name.
That can just use your new type AFAIKS.
We're hopefully solving the rodata thing separately, so long
as you've got the const there that's enough.
Other than that,
Reviewed-by: Nicholas Piggin
> 5 files changed, 14 insertions(+), 10 deletions
ing systbl.S in C, and including the
> linux/syscalls.h, linux/compat.h and asm/syscalls.h headers for
> prototypes.
>
> Reported-by: Arnd Bergmann
> Signed-off-by: Rohan McLure
> Reported-by: Nicholas Piggin
> ---
> V1 -> V2: New patch.
> V4 -> V5: For this patch
ith the compile time checking so it must be right :)
Acked-by: Nicholas Piggin
> ---
> V1 -> V2: Explicitly include prototypes.
> V2 -> V3: Remove extraneous #include and ppc_fallocate
> prototype. Rename header.
> V4 -> V5: Clean. Elaborate comment on long long munging.
patch series may allow for asm/unistd.h to signal
> through its defines that a generic implementation of these syscall
> handlers with the correct calling convention be emitted, through the
> __ARCH_WANT_COMPAT_SYS_... convention.
>
> Signed-off-by: Rohan McLure
Looks good
Review
r efficiently defining little endian compatibility syscalls.
>
> Architectures supporting big endianness may benefit from reciprocal
> argument translation, but are welcome also to implement their own.
>
> Signed-off-by: Rohan McLure
Better put Arnd and linux-arch on cc...
Revi
ff-by: Rohan McLure
I'm still not sure if ppc32 is usable with LE kernel, but in any case
the patch is good I think.
Reviewed-by: Nicholas Piggin
> ---
> V4 -> V5: New patch.
> ---
> arch/powerpc/include/asm/syscalls.h | 12
> arch/powerpc/kernel/sys_p
these saves has grown over the many
> revisions of this macro. Fix this by signalling with a comment where
> r11-r12 are saved to the PACA.
>
> Signed-off-by: Rohan McLure
> Reported-by: Nicholas Piggin
Reviewed-by: Nicholas Piggin
> ---
> V1 -> V2: Given its own comm
mploying the ZEROIZE_GPR macro when appropriate.
>
> Also simplify an invocation of SAVE_GPRS targetting all non-volatile
> registers to SAVE_NVGPRS.
>
> Signed-off-by: Rohan Mclure
> Reported-by: Nicholas Piggin
> ---
> V3 -> V4: New commit.
> ---
&g
gt; together restores at the end of the interrupt handler where the saved
> value is not consumed earlier in the handler code.
>
> Signed-off-by: Rohan McLure
> Reported-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
> ---
> V2 -> V3: New patch.
> V3 -> V4: Minimise resto
e constant at
assembly time. Even aligning the prefixed instruction can't generally
solve it. Fortunately it's only one place in the kernel so far.
This reduces kernel text size by about 6%.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/Makefile | 7 +++
arch
This adds basic POWER10_CPU option, which builds with -mcpu=power10.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/Makefile | 7 ++-
arch/powerpc/platforms/Kconfig.cputype | 8 +++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/Makefile
power5. Effectively the
minimum compiler version means power5 was always being selected here,
so this should not change anything. 970 / G5 code generation does not
seem to have been a problem with -mcpu=power5, but it's possible we
should go back to power4 to be really safe.
Signed-off-by: Nic
This macro is to be used in assembly where C functions are called.
pcrel addressing mode requires branches to functions with a
localentry value of 1 to have either a trailing nop or @notoc.
This macro permits the latter without changing callers.
Signed-off-by: Nicholas Piggin
---
arch/powerpc
A later change stops the kernel using r2 and loads it with a poison
value. Provide a PACATOC loading abstraction which can hide this
detail.
XXX: 64e, KVM, ftrace not entirely done
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ppc_asm.h | 3 +++
arch/powerpc/kernel
Use asm helpers to access global variables and to define them in asm.
Stop using got addressing and use the more common @toc offsets. 32-bit
already does this so that should be unchanged.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/boot/opal-calls.S | 6 +-
arch/powerpc/boot
ce that 32-bit uses, to avoid false positives.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/ptrace.h| 6 +++---
arch/powerpc/kernel/entry_32.S | 9 -
arch/powerpc/kernel/exceptions-64e.S | 8 +---
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel
e with the approach.
Aside from polishing, the major bit missing before merge is Kconfig
detection of compiler pcrel feature.
Thanks,
Nick
Nicholas Piggin (7):
powerpc: use 16-bit immediate for STACK_FRAME_REGS_MARKER
powerpc/64: abstract asm global variable declaration and access
powerpc/64:
ge as far as linking goes.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/systbl.S | 4
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index cb3358886203..0bec33e86f50 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/po
Follow the binutils ld internal linker script and merge .got and .toc
input sections in the .got output section.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S
b/arch
ELFv2 does not use function descriptors so .opd is not required.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S
b/arch/powerpc/kernel/vmlinux.lds.S
index ae0814063900..737825ae2ae0
.sdata2 is a readonly small data section for ppc32, and .data.rel.ro
is data that needs relocating but is read-only after that so these
can both be moved to the read only memory region.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 20
1 file
This moves linker-related tables from .data to read-only area.
Relocations are performed at early boot time before memory is protected,
after which there should be no modifications required.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 42
Following the example from the binutils default linker script, move
.got1 and .got2 out of .text, to just after RO_DATA.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc
follow read-only data.
This makes is_kernel_rodata() exactly cover the read-only region, as
well as other things using __end_rodata (e.g., kernel/dma/debug.c).
Boot dmesg also prints the rodata size more accurately.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S| 3
that patch, the relocations were a red herring.
- Update the changelog in the __end_rodata patch.
- Align __end_rodata to strict align size.
Nicholas Piggin (7):
powerpc: move __end_rodata to cover arch read-only sections
powerpc/32/build: move got1/got2 sections out of text
powerpc/build
On Wed Sep 14, 2022 at 3:39 AM AEST, Leonardo Brás wrote:
> On Mon, 2022-09-12 at 14:58 -0500, Nathan Lynch wrote:
> > Leonardo Brás writes:
> > > On Fri, 2022-09-09 at 09:04 -0500, Nathan Lynch wrote:
> > > > Leonardo Brás writes:
> > > > > On Wed, 2022-09-07 at 17:01 -0500, Nathan Lynch wrote:
so remove them.
>
Acked-by: Nicholas Piggin
> Fixes: 68b34588e202 ("powerpc/64/sycall: Implement syscall entry/exit logic
> in C")
> Signed-off-by: Michael Ellerman
> ---
> arch/powerpc/kernel/interrupt_64.S | 10 --
> 1 file changed, 10 deletions(-)
>
>
Seems okay to me, it probably better go through the KVM tree though.
Acked-by: Nicholas Piggin
Thanks,
Nick
On Tue Sep 13, 2022 at 10:50 PM AEST, Alexey Kardashevskiy wrote:
> Ping? It's been a while and probably got lost :-/
>
> On 18/05/2022 16:27, Alexey Karda
On Thu Sep 15, 2022 at 3:45 PM AEST, Rohan McLure wrote:
>
>
> > On 12 Sep 2022, at 8:56 pm, Nicholas Piggin wrote:
> >
> > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote:
> >> Cause syscall handlers to be typed as follows when called indi
On Thu Sep 15, 2022 at 4:55 PM AEST, Rohan McLure wrote:
>
>
> > On 12 Sep 2022, at 10:15 pm, Nicholas Piggin wrote:
> >
> > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote:
> >> Zero GPRS r0, r2-r11, r14-r31, on entry into the kernel for all
>
On Thu Sep 15, 2022 at 10:51 PM AEST, Michael Ellerman wrote:
> Christophe Leroy writes:
> > Le 14/09/2022 à 17:47, Nicholas Piggin a écrit :
> >> Const function pointers live in .data.rel.ro rather than .rodata because
> >> they must be relocated. This change prevents
On Thu Sep 15, 2022 at 10:47 PM AEST, Michael Ellerman wrote:
> Nicholas Piggin writes:
> > powerpc has a number of read-only sections and tables that are put
> > after RO_DATA(). Move the __end_rodata symbol to cover these as well.
> >
> > Setting memory to read
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 | 11 +--
arch/powerpc/kernel/head_64.S| 3 +++
arch/po
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
r14 could 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 10
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 | 101 +++
1 file changed, 56 insertions(+), 45 deletions
ned-off-by: Nicholas Piggin
---
arch/powerpc/kernel/setup_64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 2b2d0b0fbb30..ce8fc6575eaa 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/
This series is mostly 64s but has a few fixes that cover 64e too.
The main thing is the early boot machine check handler.
Thanks,
Nick
Nicholas Piggin (6):
powerpc/64: mark irqs hard disabled in boot paca
powerpc/64s/interrupt: move early boot ILE fixup into a macro
powerpc/64s: early boot
Follow the binutils ld internal linker script and merge .got and .toc
input sections in the .got output section.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S
b/arch
ELFv2 does not use function descriptors so .opd is not required.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S
b/arch/powerpc/kernel/vmlinux.lds.S
index 44050863032e..404944263db8
.sdata2 is a readonly small data section for ppc32, and .data.rel.ro
is data that needs relocating but is read-only after that so these
can both be moved to the read only memory region.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/vmlinux.lds.S | 20
1 file
901 - 1000 of 2809 matches
Mail list logo