<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kernel/head_64.S, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-01T11:01:27Z</updated>
<entry>
<title>powerpc/64e: Fix secondary thread bringup for ELFv2 kernels</title>
<updated>2023-08-01T11:01:27Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2023-08-01T10:26:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2dc0bc1138eecc88b2c376ccb0b0acb215c25a5c'/>
<id>urn:sha1:2dc0bc1138eecc88b2c376ccb0b0acb215c25a5c</id>
<content type='text'>
When booting on e6500 with an ELF v2 ABI kernel, the secondary threads do
not start correctly:

    [    0.051118] smp: Bringing up secondary CPUs ...
    [    5.072700] Processor 1 is stuck.

This occurs because the startup code is written to use function
descriptors when loading the entry point for the secondary threads. When
building with ELF v2 ABI there are no function descriptors, and the code
loads junk values for the entry point address.

Fix it by using ppc_function_entry() in C, and DOTSYM() in asm, both of
which work correctly for ELF v2 ABI as well as ELF v1 ABI kernels.

Fixes: 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230801102650.48705-1-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>powerpc/64: vmlinux support building with PCREL addresing</title>
<updated>2023-04-20T02:59:21Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-04-08T02:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e3a68be42e10f5fa5890e97afc0afd992355bc3'/>
<id>urn:sha1:7e3a68be42e10f5fa5890e97afc0afd992355bc3</id>
<content type='text'>
PC-Relative or PCREL addressing is an extension to the ELF ABI which
uses Power ISA v3.1 PC-relative instructions to calculate addresses,
rather than the traditional TOC scheme.

Add an option to build vmlinux using pcrel addressing. Modules continue
to use TOC addressing.

- TOC address helpers and r2 are poisoned with -1 when running vmlinux.
  r2 could be used for something useful once things are ironed out.

- Assembly must call C functions with @notoc annotation, or the linker
  complains aobut a missing nop after the call. This is done with the
  CFUNC macro introduced earlier.

- Boot: with the exception of prom_init, the execution branches to the
  kernel virtual address early in boot, before any addresses are
  generated, which ensures 34-bit pcrel addressing does not miss the
  high PAGE_OFFSET bits. TOC relative addressing has a similar
  requirement. prom_init does not go to the virtual address and its
  addresses should not carry over to the post-prom kernel.

- Ftrace trampolines are converted from TOC addressing to pcrel
  addressing, including module ftrace trampolines that currently use the
  kernel TOC to find ftrace target functions.

- BPF function prologue and function calling generation are converted
  from TOC to pcrel.

- copypage_64.S has an interesting problem, prefixed instructions have
  alignment restrictions so the linker can add padding, which makes the
  assembler treat the difference between two local labels as
  non-constant even if alignment is arranged so padding is not required.
  This may need toolchain help to solve nicely, for now move the prefix
  instruction out of the alternate patch section to work around it.

This reduces kernel text size by about 6%.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230408021752.862660-6-npiggin@gmail.com
</content>
</entry>
<entry>
<title>powerpc: add CFUNC assembly label annotation</title>
<updated>2023-04-20T02:54:24Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-04-08T02:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e991e3c16a350d1eeffc100ce3fb25292596d03'/>
<id>urn:sha1:4e991e3c16a350d1eeffc100ce3fb25292596d03</id>
<content type='text'>
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 &lt;npiggin@gmail.com&gt;
[mpe: Add dummy definitions to fix selftests build]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230408021752.862660-5-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/64s: Run at the kernel virtual address earlier in boot</title>
<updated>2023-04-20T02:23:14Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-04-08T02:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b270bebd34e36fb69363d65e24b00a9d148903e8'/>
<id>urn:sha1:b270bebd34e36fb69363d65e24b00a9d148903e8</id>
<content type='text'>
This mostly consolidates the Book3E and Book3S behaviour in boot WRT
executing from the physical or virtual address.

Book3E sets up kernel virtual linear map in start_initialization_book3e
and runs from the virtual linear alias after that. This change makes
Book3S begin to execute from the virtual alias at the same point. Book3S
can not use its MMU for that at this point, but when the MMU is disabled,
the virtual linear address correctly aliases to physical memory because
the top bits of the address are ignored with MMU disabled.

Secondaries execute from the virtual address similarly early.

This reduces the differences between subarchs, but the main motivation
was to enable the PC-relative addressing ABI for Book3S, where pointer
calculations must execute from the virtual address or the top bits of
the pointer will be lost. This is similar to the requirement the TOC
relative addressing already has that the TOC pointer use its virtual
address.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230408021752.862660-3-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/64: Move initial base and TOC pointer calculation</title>
<updated>2023-04-20T02:23:14Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-04-08T02:17:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f18b9e6ca58440394e86a53bf1be0d8a1920bcd'/>
<id>urn:sha1:4f18b9e6ca58440394e86a53bf1be0d8a1920bcd</id>
<content type='text'>
A later change moves the non-prom case to run at the virtual address
earlier, which calls for virtual TOC and kernel base. Split these two
calculations for prom and non-prom to make that change simpler.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
[mpe: Retain relative_toc call for start_initialization_book3e]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230408021752.862660-2-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/64: Fix unannotated intra-function call warning</title>
<updated>2023-02-17T11:11:55Z</updated>
<author>
<name>Sathvika Vasireddy</name>
</author>
<published>2023-02-17T04:32:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38d73b671a817328334f2a70a23fed4d1f4a952c'/>
<id>urn:sha1:38d73b671a817328334f2a70a23fed4d1f4a952c</id>
<content type='text'>
objtool throws the following warning:
  arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128:
  unannotated intra-function call

Fix the warning by annotating start_initialization_book3s symbol with the
SYM_FUNC_START_LOCAL and SYM_FUNC_END macros.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Sathvika Vasireddy &lt;sv@linux.ibm.com&gt;
Fixes: 58f24eea5278 ("powerpc/64s: Refactor initialisation after prom")
Suggested-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Tested-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20230217043226.1020041-1-sv@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/64e: Simplify address calculation in secondary hold loop</title>
<updated>2023-02-10T11:17:36Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-02-03T11:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffc8e90decc531a2dd59ef9e1e6f16a52057ab62'/>
<id>urn:sha1:ffc8e90decc531a2dd59ef9e1e6f16a52057ab62</id>
<content type='text'>
As the earlier comment explains, __secondary_hold_spinloop does not have
to be accessed at its virtual address, slightly simplifying code.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20230203113858.1152093-4-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/64s: Refactor initialisation after prom</title>
<updated>2023-02-10T11:17:36Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2023-02-03T11:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58f24eea5278cb6078552e16063fdd8b0a1b9676'/>
<id>urn:sha1:58f24eea5278cb6078552e16063fdd8b0a1b9676</id>
<content type='text'>
Move some basic Book3S initialisation after prom to a function similar
to what Book3E looks like. Book3E returns from this function at the
virtual address mapping, and Book3S will do the same in a later change,
so making them look similar helps with that.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20230203113858.1152093-3-npiggin@gmail.com

</content>
</entry>
<entry>
<title>Merge branch 'topic/objtool' into next</title>
<updated>2022-12-08T12:57:47Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2022-12-08T12:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f24f21c4122e837fa031cc512a7f20eb8c554c5e'/>
<id>urn:sha1:f24f21c4122e837fa031cc512a7f20eb8c554c5e</id>
<content type='text'>
Merge the powerpc objtool support, which we were keeping in a topic
branch in case of any merge conflicts.
</content>
</entry>
<entry>
<title>powerpc: allow minimum sized kernel stack frames</title>
<updated>2022-12-02T06:54:09Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2022-11-27T12:49:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=90f1b43196c5e79f6c986a359011a19857984c27'/>
<id>urn:sha1:90f1b43196c5e79f6c986a359011a19857984c27</id>
<content type='text'>
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 &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20221127124942.1665522-16-npiggin@gmail.com

</content>
</entry>
</feed>
