<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kernel/asm-offsets.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-10T10:00:44Z</updated>
<entry>
<title>powerpc/vdso: Fix VDSO data access when running in a non-root time namespace</title>
<updated>2024-10-10T10:00:44Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2024-09-06T08:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7270e5f957faa3e57878042984c1443486385c22'/>
<id>urn:sha1:7270e5f957faa3e57878042984c1443486385c22</id>
<content type='text'>
[ Upstream commit c73049389e58c01e2e3bbfae900c8daeee177191 ]

When running in a non-root time namespace, the global VDSO data page
is replaced by a dedicated namespace data page and the global data
page is mapped next to it. Detailed explanations can be found at
commit 660fd04f9317 ("lib/vdso: Prepare for time namespace support").

When it happens, __kernel_get_syscall_map and __kernel_get_tbfreq
and __kernel_sync_dicache don't work anymore because they read 0
instead of the data they need.

To address that, clock_mode has to be read. When it is set to
VDSO_CLOCKMODE_TIMENS, it means it is a dedicated namespace data page
and the global data is located on the following page.

Add a macro called get_realdatapage which reads clock_mode and add
PAGE_SIZE to the pointer provided by get_datapage macro when
clock_mode is equal to VDSO_CLOCKMODE_TIMENS. Use this new macro
instead of get_datapage macro except for time functions as they handle
it internally.

Fixes: 74205b3fc2ef ("powerpc/vdso: Add support for time namespaces")
Reported-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Closes: https://lore.kernel.org/all/ZtnYqZI-nrsNslwy@zx2c4.com/
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>powerpc: Remove duplicate/unnecessary ifdefs</title>
<updated>2024-02-21T04:15:40Z</updated>
<author>
<name>Shrikanth Hegde</name>
</author>
<published>2024-02-16T05:30:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c328de8fd5046eb3ec5a7ff7b682a8175e986c3'/>
<id>urn:sha1:8c328de8fd5046eb3ec5a7ff7b682a8175e986c3</id>
<content type='text'>
When an ifdef is used in the below manner, second one could be considered
as duplicate.

  ifdef DEFINE_A
  ...code block...
  ifdef DEFINE_A       &lt;-- This is a duplicate.
  ...code block...
  endif
  else
  ifndef DEFINE_A     &lt;-- This is also duplicate.
  ...code block...
  endif
  endif

More details about the script and methods used to find these code
patterns are in cover letter of [1].

Few places in arch/powerpc where this pattern was seen:

  paca.h:
  Hunk1: Code is under check of CONFIG_PPC64 from line 13, hence the
  second CONFIG_PPC64 at line 166 is a duplicate.
  Hunk2: CONFIG_PPC_BOOK3S_64 was defined back to back. Merged the two
  ifdefs.

  asm-offsets.c:
  Code is under check of CONFIG_PPC64 from line 176 hence second
  CONFIG_PPC64 at line 249 is a duplicate.

  powermac/feature.c:
  #ifndef CONFIG_PPC64 is used at line 2066. And then in #else again
  #ifdef CONFIG_PPC64 is used. Which is a duplicate since in #else means
  CONFIG_PPC64 is defined.

  xmon.c:
  Code is under the check of CONFIG_SMP from line 521 hence the same
  check of CONFIG_SMP at line 646 is a duplicate.

No functional change is intended here. It only aims to improve code
readability.

[1] https://lore.kernel.org/all/20240118080326.13137-1-sshegde@linux.ibm.com/

Signed-off-by: Shrikanth Hegde &lt;sshegde@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20240216053016.528906-1-sshegde@linux.ibm.com

</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 a define for the switch frame size and regs offset</title>
<updated>2022-12-02T06:54:08Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2022-11-27T12:49:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f291a03819e4051ebc870471d26915ef2e6ba31'/>
<id>urn:sha1:6f291a03819e4051ebc870471d26915ef2e6ba31</id>
<content type='text'>
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 &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20221127124942.1665522-12-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc: add definition for pt_regs offset within an interrupt frame</title>
<updated>2022-12-02T06:54:08Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2022-11-27T12:49:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c03be0a3f3cc656eab5c427b78959b8f1b169a11'/>
<id>urn:sha1:c03be0a3f3cc656eab5c427b78959b8f1b169a11</id>
<content type='text'>
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 &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20221127124942.1665522-8-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/kvm: Remove unused macros from asm-offset</title>
<updated>2022-11-24T12:31:47Z</updated>
<author>
<name>Disha Goel</name>
</author>
<published>2022-09-16T10:57:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2223552256dfc48435e0699dbe1e9b8d2cd56b06'/>
<id>urn:sha1:2223552256dfc48435e0699dbe1e9b8d2cd56b06</id>
<content type='text'>
The kvm code was refactored to convert some of kvm assembly routines to C.
This includes commits which moved code path for the kvm guest entry/exit
for p7/8 from aseembly to C. As part of the code changes, usage of some of
the macros were removed. But definitions still exist in the assembly files.
Commits are listed below:

Commit 2e1ae9cd56f8 ("KVM: PPC: Book3S HV: Implement radix prefetch workaround by disabling MMU")
Commit 9769a7fd79b6 ("KVM: PPC: Book3S HV: Remove radix guest support from P7/8 path")
Commit fae5c9f3664b ("KVM: PPC: Book3S HV: remove ISA v3.0 and v3.1 support from P7/8 path")
Commit 57dc0eed73ca ("KVM: PPC: Book3S HV P9: Implement PMU save/restore in C")

Many of the asm-offset macro definitions were missed to remove. Patch
fixes by removing the unused macros.

Signed-off-by: Disha Goel &lt;disgoel@linux.vnet.ibm.com&gt;
Reviewed-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Reviewed-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220916105736.268153-2-disgoel@linux.vnet.ibm.com

</content>
</entry>
<entry>
<title>powerpc: Remove CONFIG_PPC_FSL_BOOK3E</title>
<updated>2022-09-26T13:00:13Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2022-09-19T17:01:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e7318584dfec11992f3ac45658c4bc1210b3778'/>
<id>urn:sha1:3e7318584dfec11992f3ac45658c4bc1210b3778</id>
<content type='text'>
CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500.

Remove it.

And rename five files accordingly.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
[mpe: Rename include guards to match new file names]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/795cb93b88c9a0279289712e674f39e3b108a1b4.1663606876.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: Remove CONFIG_PPC_BOOK3E</title>
<updated>2022-09-26T13:00:13Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2022-09-19T17:01:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0d68273d7069537701bb91c51d90d1e12aacc33'/>
<id>urn:sha1:e0d68273d7069537701bb91c51d90d1e12aacc33</id>
<content type='text'>
CONFIG_PPC_BOOK3E is redundant with CONFIG_PPC_BOOK3E_64.

The later is more explicit about the fact that it's a 64 bits target.

Remove CONFIG_PPC_BOOK3E.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/5d0891490813c19cdcfc04678f512ea68cba3e64.1663606876.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: Add a new config for P8 debug timing</title>
<updated>2022-06-29T09:21:21Z</updated>
<author>
<name>Fabiano Rosas</name>
</author>
<published>2022-05-25T13:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f8ed993be3cf154a91d9ab5e80470c6c755adbe'/>
<id>urn:sha1:3f8ed993be3cf154a91d9ab5e80470c6c755adbe</id>
<content type='text'>
Turn the existing Kconfig KVM_BOOK3S_HV_EXIT_TIMING into
KVM_BOOK3S_HV_P8_TIMING in preparation for the addition of a new
config for P9 timings.

This applies only to P8 code, the generic timing code is still kept
under KVM_BOOK3S_HV_EXIT_TIMING.

Signed-off-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220525130554.2614394-3-farosas@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/ftrace: Add support for livepatch to PPC32</title>
<updated>2022-02-07T10:03:10Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-12-20T16:38:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a4520b25276500f1abcfc55d24f1251b7b08eff6'/>
<id>urn:sha1:a4520b25276500f1abcfc55d24f1251b7b08eff6</id>
<content type='text'>
PPC64 needs some special logic to properly set up the TOC.
See commit 85baa095497f ("powerpc/livepatch: Add live patching support
on ppc64le") for details.

PPC32 doesn't have TOC so it doesn't need that logic, so adding
LIVEPATCH support is straight forward.

Add CONFIG_LIVEPATCH_64 and move livepatch stack logic into that item.

Livepatch sample modules all work.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/63cb094125b6a6038c65eeac2abaabbabe63addd.1640017960.git.christophe.leroy@csgroup.eu

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