<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/lib/sstep.c, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-29T13:47:52Z</updated>
<entry>
<title>powerpc/sstep: Add support for divde[.] and divdeu[.] instructions</title>
<updated>2020-07-29T13:47:52Z</updated>
<author>
<name>Balamuruhan S</name>
</author>
<published>2020-07-28T13:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=151c32bf5ebdd41114267717dc4b53d2632cbd30'/>
<id>urn:sha1:151c32bf5ebdd41114267717dc4b53d2632cbd30</id>
<content type='text'>
This patch adds emulation support for divde, divdeu instructions,
  - Divide Doubleword Extended (divde[.])
  - Divide Doubleword Extended Unsigned (divdeu[.])

Signed-off-by: Balamuruhan S &lt;bala24@linux.ibm.com&gt;
Reviewed-by: Sandipan Das &lt;sandipan@linux.ibm.com&gt;
Acked-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200728130308.1790982-3-bala24@linux.ibm.com
</content>
</entry>
<entry>
<title>powerpc/sstep: Fix incorrect CONFIG symbol in scv handling</title>
<updated>2020-07-24T13:16:49Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2020-07-24T10:42:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=826b07b190c8ca69ce674f13b4dc9be2bc536fcd'/>
<id>urn:sha1:826b07b190c8ca69ce674f13b4dc9be2bc536fcd</id>
<content type='text'>
When I "fixed" the ppc64e build in Nick's recent patch, I typoed the
CONFIG symbol, resulting in one that doesn't exist. Fix it to use the
correct symbol.

Reported-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Fixes: 7fa95f9adaee ("powerpc/64s: system call support for scv/rfscv instructions")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200724131609.1640533-1-mpe@ellerman.id.au
</content>
</entry>
<entry>
<title>Merge branch 'scv' support into next</title>
<updated>2020-07-23T07:43:44Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2020-07-23T07:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=335aca5f65f1a39670944930131da5f2276f888f'/>
<id>urn:sha1:335aca5f65f1a39670944930131da5f2276f888f</id>
<content type='text'>
From Nick's cover letter:

Linux powerpc new system call instruction and ABI

System Call Vectored (scv) ABI
==============================

The scv instruction is introduced with POWER9 / ISA3, it comes with an
rfscv counter-part. The benefit of these instructions is
performance (trading slower SRR0/1 with faster LR/CTR registers, and
entering the kernel with MSR[EE] and MSR[RI] left enabled, which can
reduce MSR updates. The scv instruction has 128 levels (not enough to
cover the Linux system call space).

Assignment and advertisement
----------------------------
The proposal is to assign scv levels conservatively, and advertise
them with HWCAP feature bits as we add support for more.

Linux has not enabled FSCR[SCV] yet, so executing the scv instruction
will cause the kernel to log a "SCV facility unavilable" message, and
deliver a SIGILL with ILL_ILLOPC to the process. Linux has defined a
HWCAP2 bit PPC_FEATURE2_SCV for SCV support, but does not set it.

This change allocates the zero level ('scv 0'), advertised with
PPC_FEATURE2_SCV, which will be used to provide normal Linux system
calls (equivalent to 'sc').

Attempting to execute scv with other levels will cause a SIGILL to be
delivered the same as before, but will not log a "SCV facility
unavailable" message (because the processor facility is enabled).

Calling convention
------------------
The proposal is for scv 0 to provide the standard Linux system call
ABI with the following differences from sc convention[1]:

- LR is to be volatile across scv calls. This is necessary because the
  scv instruction clobbers LR. From previous discussion, this should
  be possible to deal with in GCC clobbers and CFI.

- cr1 and cr5-cr7 are volatile. This matches the C ABI and would allow
  the kernel system call exit to avoid restoring the volatile cr
  registers (although we probably still would anyway to avoid
  information leaks).

- Error handling: The consensus among kernel, glibc, and musl is to
  move to using negative return values in r3 rather than CR0[SO]=1 to
  indicate error, which matches most other architectures, and is
  closer to a function call.

Notes
-----
- r0,r4-r8 are documented as volatile in the ABI, but the kernel patch
  as submitted currently preserves them. This is to leave room for
  deciding which way to go with these. Some small benefit was found by
  preserving them[1] but I'm not convinced it's worth deviating from
  the C function call ABI just for this. Release code should follow
  the ABI.

Previous discussions:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-April/208691.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-April/209268.html

[1] https://github.com/torvalds/linux/blob/master/Documentation/powerpc/syscall64-abi.rst
[2] https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-April/209263.html
</content>
</entry>
<entry>
<title>powerpc/sstep: Introduce macros to retrieve Prefix instruction operands</title>
<updated>2020-07-23T07:43:11Z</updated>
<author>
<name>Balamuruhan S</name>
</author>
<published>2020-06-26T09:51:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68a180a44c29d7e918ae7d3c18a01b0751d1c22f'/>
<id>urn:sha1:68a180a44c29d7e918ae7d3c18a01b0751d1c22f</id>
<content type='text'>
retrieve prefix instruction operands RA and pc relative bit R values
using macros and adopt it in sstep.c and test_emulate_step.c.

Signed-off-by: Balamuruhan S &lt;bala24@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200626095158.1031507-4-bala24@linux.ibm.com
</content>
</entry>
<entry>
<title>powerpc/64s: system call support for scv/rfscv instructions</title>
<updated>2020-07-22T13:00:27Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2020-06-11T08:12:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fa95f9adaee7e5cbb195d3359741120829e488b'/>
<id>urn:sha1:7fa95f9adaee7e5cbb195d3359741120829e488b</id>
<content type='text'>
Add support for the scv instruction on POWER9 and later CPUs.

For now this implements the zeroth scv vector 'scv 0', as identical to
'sc' system calls, with the exception that LR is not preserved, nor
are volatile CR registers, and error is not indicated with CR0[SO],
but by returning a negative errno.

rfscv is implemented to return from scv type system calls. It can not
be used to return from sc system calls because those are defined to
preserve LR.

getpid syscall throughput on POWER9 is improved by 26% (428 to 318
cycles), largely due to reducing mtmsr and mtspr.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
[mpe: Fix ppc64e build]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200611081203.995112-3-npiggin@gmail.com
</content>
</entry>
<entry>
<title>powerpc sstep: Add support for prefixed fixed-point arithmetic</title>
<updated>2020-05-18T14:11:03Z</updated>
<author>
<name>Jordan Niethe</name>
</author>
<published>2020-05-06T03:40:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3920742b92f5ea19a220edb947b6f33c99f501da'/>
<id>urn:sha1:3920742b92f5ea19a220edb947b6f33c99f501da</id>
<content type='text'>
This adds emulation support for the following prefixed Fixed-Point
Arithmetic instructions:
  * Prefixed Add Immediate (paddi)

Signed-off-by: Jordan Niethe &lt;jniethe5@gmail.com&gt;
Reviewed-by: Balamuruhan S &lt;bala24@linux.ibm.com&gt;
[mpe: Squash in get_op() usage]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200506034050.24806-31-jniethe5@gmail.com
</content>
</entry>
<entry>
<title>powerpc sstep: Add support for prefixed load/stores</title>
<updated>2020-05-18T14:11:03Z</updated>
<author>
<name>Jordan Niethe</name>
</author>
<published>2020-05-06T03:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50b80a12e4ccff46d53b93754d817acd98bc9ae0'/>
<id>urn:sha1:50b80a12e4ccff46d53b93754d817acd98bc9ae0</id>
<content type='text'>
This adds emulation support for the following prefixed integer
load/stores:
  * Prefixed Load Byte and Zero (plbz)
  * Prefixed Load Halfword and Zero (plhz)
  * Prefixed Load Halfword Algebraic (plha)
  * Prefixed Load Word and Zero (plwz)
  * Prefixed Load Word Algebraic (plwa)
  * Prefixed Load Doubleword (pld)
  * Prefixed Store Byte (pstb)
  * Prefixed Store Halfword (psth)
  * Prefixed Store Word (pstw)
  * Prefixed Store Doubleword (pstd)
  * Prefixed Load Quadword (plq)
  * Prefixed Store Quadword (pstq)

the follow prefixed floating-point load/stores:
  * Prefixed Load Floating-Point Single (plfs)
  * Prefixed Load Floating-Point Double (plfd)
  * Prefixed Store Floating-Point Single (pstfs)
  * Prefixed Store Floating-Point Double (pstfd)

and for the following prefixed VSX load/stores:
  * Prefixed Load VSX Scalar Doubleword (plxsd)
  * Prefixed Load VSX Scalar Single-Precision (plxssp)
  * Prefixed Load VSX Vector [0|1]  (plxv, plxv0, plxv1)
  * Prefixed Store VSX Scalar Doubleword (pstxsd)
  * Prefixed Store VSX Scalar Single-Precision (pstxssp)
  * Prefixed Store VSX Vector [0|1] (pstxv, pstxv0, pstxv1)

Signed-off-by: Jordan Niethe &lt;jniethe5@gmail.com&gt;
Reviewed-by: Balamuruhan S &lt;bala24@linux.ibm.com&gt;
[mpe: Use CONFIG_PPC64 not __powerpc64__, use get_op()]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200506034050.24806-30-jniethe5@gmail.com
</content>
</entry>
<entry>
<title>powerpc: Add prefixed instructions to instruction data type</title>
<updated>2020-05-18T14:10:39Z</updated>
<author>
<name>Jordan Niethe</name>
</author>
<published>2020-05-15T02:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=650b55b707fdfa764e9f2b81314d3eb4216fb962'/>
<id>urn:sha1:650b55b707fdfa764e9f2b81314d3eb4216fb962</id>
<content type='text'>
For powerpc64, redefine the ppc_inst type so both word and prefixed
instructions can be represented. On powerpc32 the type will remain the
same. Update places which had assumed instructions to be 4 bytes long.

Signed-off-by: Jordan Niethe &lt;jniethe5@gmail.com&gt;
Reviewed-by: Alistair Popple &lt;alistair@popple.id.au&gt;
[mpe: Rework the get_user_inst() macros to be parameterised, and don't
      assign to the dest if an error occurred. Use CONFIG_PPC64 not
      __powerpc64__ in a few places. Address other comments from
      Christophe. Fix some sparse complaints.]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200506034050.24806-24-jniethe5@gmail.com
</content>
</entry>
<entry>
<title>powerpc: Use a datatype for instructions</title>
<updated>2020-05-18T14:10:37Z</updated>
<author>
<name>Jordan Niethe</name>
</author>
<published>2020-05-06T03:40:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94afd069d937d84fb4f696eb9a78db4084e43d21'/>
<id>urn:sha1:94afd069d937d84fb4f696eb9a78db4084e43d21</id>
<content type='text'>
Currently unsigned ints are used to represent instructions on powerpc.
This has worked well as instructions have always been 4 byte words.

However, ISA v3.1 introduces some changes to instructions that mean
this scheme will no longer work as well. This change is Prefixed
Instructions. A prefixed instruction is made up of a word prefix
followed by a word suffix to make an 8 byte double word instruction.
No matter the endianness of the system the prefix always comes first.
Prefixed instructions are only planned for powerpc64.

Introduce a ppc_inst type to represent both prefixed and word
instructions on powerpc64 while keeping it possible to exclusively
have word instructions on powerpc32.

Signed-off-by: Jordan Niethe &lt;jniethe5@gmail.com&gt;
[mpe: Fix compile error in emulate_spe()]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200506034050.24806-12-jniethe5@gmail.com
</content>
</entry>
<entry>
<title>powerpc: Use a function for getting the instruction op code</title>
<updated>2020-05-18T14:10:37Z</updated>
<author>
<name>Jordan Niethe</name>
</author>
<published>2020-05-06T03:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8094892d1aff14269d3b7bfcd8b941217eecd81f'/>
<id>urn:sha1:8094892d1aff14269d3b7bfcd8b941217eecd81f</id>
<content type='text'>
In preparation for using a data type for instructions that can not be
directly used with the '&gt;&gt;' operator use a function for getting the op
code of an instruction.

Signed-off-by: Jordan Niethe &lt;jniethe5@gmail.com&gt;
Reviewed-by: Alistair Popple &lt;alistair@popple.id.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200506034050.24806-9-jniethe5@gmail.com
</content>
</entry>
</feed>
