<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/include/asm/ppc_asm.h, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-04-14T13:04:20Z</updated>
<entry>
<title>powerpc/64e/interrupt: use new interrupt return</title>
<updated>2021-04-14T13:04:20Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2021-03-16T10:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0c2472de23aea5ce9139a3e887191925759d1259'/>
<id>urn:sha1:0c2472de23aea5ce9139a3e887191925759d1259</id>
<content type='text'>
Update the new C and asm interrupt return code to account for 64e
specifics, switch over to use it.

The now-unused old ret_from_except code, that was moved to 64e after the
64s conversion, is removed.

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/20210316104206.407354-5-npiggin@gmail.com
</content>
</entry>
<entry>
<title>powerpc/32: Entry cpu time accounting in C</title>
<updated>2021-03-29T02:22:04Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-03-12T12:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f93d866e14b746112fb29d69197dd83075bbd28c'/>
<id>urn:sha1:f93d866e14b746112fb29d69197dd83075bbd28c</id>
<content type='text'>
There is no need for this to be in asm,
use the new interrupt entry wrapper.

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/daca4c3e05cdfe54d237162a0718b3aaca897662.1615552866.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc/64: entry cpu time accounting in C</title>
<updated>2021-02-08T13:10:49Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2021-01-30T13:08:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56acfdd8bf9f75e83a1b2957bd415368f39b67b6'/>
<id>urn:sha1:56acfdd8bf9f75e83a1b2957bd415368f39b67b6</id>
<content type='text'>
There is no need for this to be in asm, use the new interrupt entry wrapper.

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/20210130130852.2952424-39-npiggin@gmail.com
</content>
</entry>
<entry>
<title>powerpc/vdso: Fix DOTSYM for 32-bit LE VDSO</title>
<updated>2020-12-21T11:06:26Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2020-12-18T11:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2eda7f11000646909a10298951c9defb2321b240'/>
<id>urn:sha1:2eda7f11000646909a10298951c9defb2321b240</id>
<content type='text'>
Skirmisher reported on IRC that the 32-bit LE VDSO was hanging. This
turned out to be due to a branch to self in eg. __kernel_gettimeofday.
Looking at the disassembly with objdump -dR shows why:

  00000528 &lt;__kernel_gettimeofday&gt;:
   528:   f0 ff 21 94     stwu    r1,-16(r1)
   52c:   a6 02 08 7c     mflr    r0
   530:   f0 ff 21 94     stwu    r1,-16(r1)
   534:   14 00 01 90     stw     r0,20(r1)
   538:   05 00 9f 42     bcl     20,4*cr7+so,53c &lt;__kernel_gettimeofday+0x14&gt;
   53c:   a6 02 a8 7c     mflr    r5
   540:   ff ff a5 3c     addis   r5,r5,-1
   544:   c4 fa a5 38     addi    r5,r5,-1340
   548:   f0 00 a5 38     addi    r5,r5,240
   54c:   01 00 00 48     bl      54c &lt;__kernel_gettimeofday+0x24&gt;
                          54c: R_PPC_REL24        .__c_kernel_gettimeofday

Because we don't process relocations for the VDSO, this branch remains
a branch from 0x54c to 0x54c.

With the preceding patch to prohibit R_PPC_REL24 relocations, we
instead get a build failure:

  0000054c R_PPC_REL24       .__c_kernel_gettimeofday
  00000598 R_PPC_REL24       .__c_kernel_clock_gettime
  000005e4 R_PPC_REL24       .__c_kernel_clock_gettime64
  00000630 R_PPC_REL24       .__c_kernel_clock_getres
  0000067c R_PPC_REL24       .__c_kernel_time
  arch/powerpc/kernel/vdso32/vdso32.so.dbg: dynamic relocations are not supported

The root cause is that we're branching to `.__c_kernel_gettimeofday`.
But this is 32-bit LE code, which doesn't use function descriptors, so
there are no dot symbols.

The reason we're trying to branch to a dot symbol is because we're
using the DOTSYM macro, but the ifdefs we use to define the DOTSYM
macro do not currently work for 32-bit LE.

So like previous commits we need to differentiate if the current
compilation unit is 64-bit, rather than the kernel as a whole. ie.
switch from CONFIG_PPC64 to __powerpc64__.

With that fixed 32-bit LE code gets the empty version of DOTSYM, which
just resolves to the original symbol name, leading to a direct branch
and no relocations:

  000003f8 &lt;__kernel_gettimeofday&gt;:
   3f8:   f0 ff 21 94     stwu    r1,-16(r1)
   3fc:   a6 02 08 7c     mflr    r0
   400:   f0 ff 21 94     stwu    r1,-16(r1)
   404:   14 00 01 90     stw     r0,20(r1)
   408:   05 00 9f 42     bcl     20,4*cr7+so,40c &lt;__kernel_gettimeofday+0x14&gt;
   40c:   a6 02 a8 7c     mflr    r5
   410:   ff ff a5 3c     addis   r5,r5,-1
   414:   f4 fb a5 38     addi    r5,r5,-1036
   418:   f0 00 a5 38     addi    r5,r5,240
   41c:   85 06 00 48     bl      aa0 &lt;__c_kernel_gettimeofday&gt;

Fixes: ab037dd87a2f ("powerpc/vdso: Switch VDSO to generic C implementation.")
Reported-by: "Will Springer &lt;skirmisher@protonmail.com&gt;"
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20201218111619.1206391-3-mpe@ellerman.id.au
</content>
</entry>
<entry>
<title>powerpc/vdso: Prepare for switching VDSO to generic C implementation.</title>
<updated>2020-12-03T14:01:10Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-11-26T13:10:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce7d8056e38b770f070fc4499c577322b6ccb9c7'/>
<id>urn:sha1:ce7d8056e38b770f070fc4499c577322b6ccb9c7</id>
<content type='text'>
Prepare for switching VDSO to generic C implementation in following
patch. Here, we:
- Prepare the helpers to call the C VDSO functions
- Prepare the required callbacks for the C VDSO functions
- Prepare the clocksource.h files to define VDSO_ARCH_CLOCKMODES
- Add the C trampolines to the generic C VDSO functions

powerpc is a bit special for VDSO as well as system calls in the
way that it requires setting CR SO bit which cannot be done in C.
Therefore, entry/exit needs to be performed in ASM.

Implementing __arch_get_vdso_data() would clobber the link register,
requiring the caller to save it. As the ASM calling function already
has to set a stack frame and saves the link register before calling
the C vdso function, retriving the vdso data pointer there is lighter.

Implement __arch_vdso_capable() and always return true.

Provide vdso_shift_ns(), as the generic x &gt;&gt; s gives the following
bad result:

  18:	35 25 ff e0 	addic.  r9,r5,-32
  1c:	41 80 00 10 	blt     2c &lt;shift+0x14&gt;
  20:	7c 64 4c 30 	srw     r4,r3,r9
  24:	38 60 00 00 	li      r3,0
  ...
  2c:	54 69 08 3c 	rlwinm  r9,r3,1,0,30
  30:	21 45 00 1f 	subfic  r10,r5,31
  34:	7c 84 2c 30 	srw     r4,r4,r5
  38:	7d 29 50 30 	slw     r9,r9,r10
  3c:	7c 63 2c 30 	srw     r3,r3,r5
  40:	7d 24 23 78 	or      r4,r9,r4

In our case the shift is always &lt;= 32. In addition,  the upper 32 bits
of the result are likely nul. Lets GCC know it, it also optimises the
following calculations.

With the patch, we get:
   0:	21 25 00 20 	subfic  r9,r5,32
   4:	7c 69 48 30 	slw     r9,r3,r9
   8:	7c 84 2c 30 	srw     r4,r4,r5
   c:	7d 24 23 78 	or      r4,r9,r4
  10:	7c 63 2c 30 	srw     r3,r3,r5

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/20201126131006.2431205-6-mpe@ellerman.id.au
</content>
</entry>
<entry>
<title>powerpc: Remove RFI macro</title>
<updated>2020-11-19T05:56:55Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-11-08T16:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62182e6c0faf75117f8d1719c118bb5fc8574012'/>
<id>urn:sha1:62182e6c0faf75117f8d1719c118bb5fc8574012</id>
<content type='text'>
RFI macro is just there to add an infinite loop past
rfi in order to avoid prefetch on 40x in half a dozen
of places in entry_32 and head_32.

Those places are already full of #ifdefs, so just add a
few more to explicitely show those loops and remove RFI.

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/f7e9cb9e9240feec63cb330abf40b67d1aad852f.1604854583.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc/64s: Replace RFI by RFI_TO_KERNEL and remove RFI</title>
<updated>2020-11-19T05:56:54Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-11-08T16:57:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=879add7720172ffd2986c44587510fabb7af52f5'/>
<id>urn:sha1:879add7720172ffd2986c44587510fabb7af52f5</id>
<content type='text'>
In head_64.S, we have two places using RFI to return to
kernel. Use RFI_TO_KERNEL instead.

They are the two only places using RFI on book3s/64, so
the RFI macro can go away.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Acked-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/7719261b0a0d2787772339484c33eb809723bca7.1604854583.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc: Remove support for PowerPC 601</title>
<updated>2020-10-08T10:17:13Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-09-29T06:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b14e1dff067195dca7a42321771437cb33a99e9'/>
<id>urn:sha1:8b14e1dff067195dca7a42321771437cb33a99e9</id>
<content type='text'>
PowerPC 601 has been retired.

Remove all associated specific code.

CPU_FTRS_PPC601 has CPU_FTR_COHERENT_ICACHE and CPU_FTR_COMMON.

CPU_FTR_COMMON is already present via other CPU_FTRS.
None of the remaining CPU selects CPU_FTR_COHERENT_ICACHE.

So CPU_FTRS_PPC601 can be removed from the possible features,
hence can be removed completely.

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/60b725d55e21beec3335175c20b77903ff98284f.1601362098.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc: Drop SYNC_601() ISYNC_601() and SYNC()</title>
<updated>2020-10-08T10:17:13Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-09-29T06:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2a5cd83ee984c0e9fc172d2df9591c264261a52'/>
<id>urn:sha1:d2a5cd83ee984c0e9fc172d2df9591c264261a52</id>
<content type='text'>
Those macros are now empty at all time. Drop them.

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/7990bb63fc53e460bfa94f8040184881d9e6fbc3.1601362098.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc: Remove CONFIG_PPC601_SYNC_FIX</title>
<updated>2020-10-08T10:17:13Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2020-09-29T06:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e42a64002a507bf61e57106ed5323b1854371563'/>
<id>urn:sha1:e42a64002a507bf61e57106ed5323b1854371563</id>
<content type='text'>
This config option isn't in any defconfig.

The very first versions of Powerpc 601 have a bug which
requires additional sync before and/or after some instructions.

This was more than 25 years ago and time has come to retire
those buggy versions of the 601 from the kernel.

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/55b46bff16705b1ae7bf0a60ccd522b1010ebf75.1601362098.git.christophe.leroy@csgroup.eu
</content>
</entry>
</feed>
