<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/lib/sstep.c, branch linux-5.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-06-03T14:39:08Z</updated>
<entry>
<title>powerpc/sstep: Fix kernel crash if VSX is not present</title>
<updated>2018-06-03T14:39:08Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2018-05-21T04:21:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83afab4ce05660c728f4a5d45f5970d9cc9ee6d2'/>
<id>urn:sha1:83afab4ce05660c728f4a5d45f5970d9cc9ee6d2</id>
<content type='text'>
emulate_step() is not checking runtime VSX feature flag before
emulating an instruction. This is causing kernel crash when kernel
is compiled with CONFIG_VSX=y but running on a machine where VSX
is not supported or disabled. Ex, while running emulate_step tests
on P6 machine:

  Oops: Exception in kernel mode, sig: 4 [#1]
  NIP [c000000000095c24] .load_vsrn+0x28/0x54
  LR [c000000000094bdc] .emulate_loadstore+0x167c/0x17b0
  Call Trace:
    0x40fe240c7ae147ae (unreliable)
    .emulate_loadstore+0x167c/0x17b0
    .emulate_step+0x25c/0x5bc
    .test_lxvd2x_stxvd2x+0x64/0x154
    .test_emulate_step+0x38/0x4c
    .do_one_initcall+0x5c/0x2c0
    .kernel_init_freeable+0x314/0x4cc
    .kernel_init+0x24/0x160
    .ret_from_kernel_thread+0x58/0xb4

With fix:
  emulate_step_test: lxvd2x         : FAIL
  emulate_step_test: stxvd2x        : FAIL

Reported-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/sstep: Introduce GETTYPE macro</title>
<updated>2018-06-03T11:19:40Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2018-05-21T04:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6684d07e4308430b9b6497265781a6fb9fd87a0'/>
<id>urn:sha1:e6684d07e4308430b9b6497265781a6fb9fd87a0</id>
<content type='text'>
Replace 'op-&gt;type &amp; INSTR_TYPE_MASK' expression with GETTYPE(op-&gt;type)
macro.

Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/lib: Fix "integer constant is too large" build failure</title>
<updated>2018-05-18T06:04:02Z</updated>
<author>
<name>Finn Thain</name>
</author>
<published>2018-05-18T01:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20acf7fc9409e48cfbfb38262aa53466dfbc22bb'/>
<id>urn:sha1:20acf7fc9409e48cfbfb38262aa53466dfbc22bb</id>
<content type='text'>
My powerpc-linux-gnu-gcc v4.4.5 compiler can't build a 32-bit kernel
any more:

arch/powerpc/lib/sstep.c: In function 'do_popcnt':
arch/powerpc/lib/sstep.c:1068: error: integer constant is too large for 'long' type
arch/powerpc/lib/sstep.c:1069: error: integer constant is too large for 'long' type
arch/powerpc/lib/sstep.c:1069: error: integer constant is too large for 'long' type
arch/powerpc/lib/sstep.c:1070: error: integer constant is too large for 'long' type
arch/powerpc/lib/sstep.c:1079: error: integer constant is too large for 'long' type
arch/powerpc/lib/sstep.c: In function 'do_prty':
arch/powerpc/lib/sstep.c:1117: error: integer constant is too large for 'long' type

This file gets compiled with -std=gnu89 which means a constant can be
given the type 'long' even if it won't fit. Fix the errors with a 'ULL'
suffix on the relevant constants.

Fixes: 2c979c489fee ("powerpc/lib/sstep: Add prty instruction emulation")
Fixes: dcbd19b48d31 ("powerpc/lib/sstep: Add popcnt instruction emulation")
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/32: Move the inline keyword at the beginning of function declaration</title>
<updated>2018-03-13T04:50:33Z</updated>
<author>
<name>Mathieu Malaterre</name>
</author>
<published>2018-02-25T17:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=174b701d3dcd14514f869e2bc08ac404b16fdb9d'/>
<id>urn:sha1:174b701d3dcd14514f869e2bc08ac404b16fdb9d</id>
<content type='text'>
The inline keyword was not at the beginning of the function declaration.
Fix the following warning (treated as error in W=1):

  arch/powerpc/lib/sstep.c:283:1: error: ‘inline’ is not at beginning of declaration
   static int nokprobe_inline copy_mem_in(u8 *dest, unsigned long ea, int nb,
  arch/powerpc/lib/sstep.c:388:1: error: ‘inline’ is not at beginning of declaration
   static int nokprobe_inline copy_mem_out(u8 *dest, unsigned long ea, int nb,

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/kprobes: Blacklist emulate_update_regs() from kprobes</title>
<updated>2017-11-12T12:51:42Z</updated>
<author>
<name>Naveen N. Rao</name>
</author>
<published>2017-10-23T16:37:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=67ac0bfe29e9b4359012a8961c196baa813c707a'/>
<id>urn:sha1:67ac0bfe29e9b4359012a8961c196baa813c707a</id>
<content type='text'>
Commit 3cdfcbfd32b9d ("powerpc: Change analyse_instr so it doesn't
modify *regs") introduced emulate_update_regs() to perform part of what
emulate_step() was doing earlier. However, this function was not added
to the kprobes blacklist. Add it so as to prevent it from being probed.

Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fixes' into next</title>
<updated>2017-11-10T09:55:03Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2017-11-10T09:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a54c61f46e25345e99eec06a402f746fe33febc6'/>
<id>urn:sha1:a54c61f46e25345e99eec06a402f746fe33febc6</id>
<content type='text'>
We have some dependencies &amp; conflicts between patches in fixes and
things to go in next, both in the radix TLB flush code and the IMC PMU
driver. So merge fixes into next.
</content>
</entry>
<entry>
<title>powerpc/lib/sstep: Fix count leading zeros instructions</title>
<updated>2017-10-10T09:16:32Z</updated>
<author>
<name>Sandipan Das</name>
</author>
<published>2017-10-10T06:45:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0490a04e736356e427e227902b17f9927a56caf'/>
<id>urn:sha1:b0490a04e736356e427e227902b17f9927a56caf</id>
<content type='text'>
According to the GCC documentation, the behaviour of __builtin_clz()
and __builtin_clzl() is undefined if the value of the input argument
is zero. Without handling this special case, these builtins have been
used for emulating the following instructions:
  * Count Leading Zeros Word (cntlzw[.])
  * Count Leading Zeros Doubleword (cntlzd[.])

This fixes the emulated behaviour of these instructions by adding an
additional check for this special case.

Fixes: 3cdfcbfd32b9d ("powerpc: Change analyse_instr so it doesn't modify *regs")
Signed-off-by: Sandipan Das &lt;sandipan@linux.vnet.ibm.com&gt;
Reviewed-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/lib/sstep: Fix fixed-point shift instructions that set CA32</title>
<updated>2017-10-04T00:28:04Z</updated>
<author>
<name>Sandipan Das</name>
</author>
<published>2017-09-29T05:44:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a75aff178df005b0619703cf7886d5c8e28e486'/>
<id>urn:sha1:0a75aff178df005b0619703cf7886d5c8e28e486</id>
<content type='text'>
This fixes the emulated behaviour of existing fixed-point shift right
algebraic instructions that are supposed to set both the CA and CA32
bits of XER when running on a system that is compliant with POWER ISA
v3.0 independent of whether the system is executing in 32-bit mode or
64-bit mode. The following instructions are affected:
  * Shift Right Algebraic Word Immediate (srawi[.])
  * Shift Right Algebraic Word (sraw[.])
  * Shift Right Algebraic Doubleword Immediate (sradi[.])
  * Shift Right Algebraic Doubleword (srad[.])

Fixes: 0016a4cf5582 ("powerpc: Emulate most Book I instructions in emulate_step()")
Signed-off-by: Sandipan Das &lt;sandipan@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/lib/sstep: Fix fixed-point arithmetic instructions that set CA32</title>
<updated>2017-10-04T00:28:03Z</updated>
<author>
<name>Sandipan Das</name>
</author>
<published>2017-09-29T05:44:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc39c1d68f256990d4bb0033a219e8ca15ba4d7f'/>
<id>urn:sha1:dc39c1d68f256990d4bb0033a219e8ca15ba4d7f</id>
<content type='text'>
There are existing fixed-point arithmetic instructions that always set the
CA bit of XER to reflect the carry out of bit 0 in 64-bit mode and out of
bit 32 in 32-bit mode. In ISA v3.0, these instructions also always set the
CA32 bit of XER to reflect the carry out of bit 32.

This fixes the emulated behaviour of such instructions when running on a
system that is compliant with POWER ISA v3.0. The following instructions
are affected:
  * Add Immediate Carrying (addic)
  * Add Immediate Carrying and Record (addic.)
  * Subtract From Immediate Carrying (subfic)
  * Add Carrying (addc[.])
  * Subtract From Carrying (subfc[.])
  * Add Extended (adde[.])
  * Subtract From Extended (subfe[.])
  * Add to Minus One Extended (addme[.])
  * Subtract From Minus One Extended (subfme[.])
  * Add to Zero Extended (addze[.])
  * Subtract From Zero Extended (subfze[.])

Fixes: 0016a4cf5582 ("powerpc: Emulate most Book I instructions in emulate_step()")
Signed-off-by: Sandipan Das &lt;sandipan@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/lib/sstep: Add XER bits introduced in POWER ISA v3.0</title>
<updated>2017-10-04T00:28:03Z</updated>
<author>
<name>Sandipan Das</name>
</author>
<published>2017-09-29T05:44:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=924c8feb041c3ef22d46ac2e7468161aad85e979'/>
<id>urn:sha1:924c8feb041c3ef22d46ac2e7468161aad85e979</id>
<content type='text'>
This adds definitions for the OV32 and CA32 bits of XER that
were introduced in POWER ISA v3.0. There are some existing
instructions that currently set the OV and CA bits based on
certain conditions.

The emulation behaviour of all these instructions needs to
be updated to set these new bits accordingly.

Signed-off-by: Sandipan Das &lt;sandipan@linux.vnet.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;
</content>
</entry>
</feed>
