<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/include/asm/inst.h, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-16T14:09:06Z</updated>
<entry>
<title>powerpc/inst: Refactor PPC32 and PPC64 versions</title>
<updated>2021-06-16T14:09:06Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=077c4dedef09796ade917459a5330e3940fb5860'/>
<id>urn:sha1:077c4dedef09796ade917459a5330e3940fb5860</id>
<content type='text'>
ppc_inst() ppc_inst_prefixed() ppc_inst_swab() can easily be made common
to both PPC32 and PPC64.

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/d54c63dcac6d190e1cc0d2fe3259d6e621928cdf.1621516826.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: Don't use 'struct ppc_inst' to reference instruction location</title>
<updated>2021-06-16T14:09:00Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69d4d6e5fd9f4e805280ad831932c3df7b9d7cc7'/>
<id>urn:sha1:69d4d6e5fd9f4e805280ad831932c3df7b9d7cc7</id>
<content type='text'>
'struct ppc_inst' is an internal representation of an instruction, but
in-memory instructions are and will remain a table of 'u32' forever.

Replace all 'struct ppc_inst *' used for locating an instruction in
memory by 'u32 *'. This removes a lot of undue casts to 'struct
ppc_inst *'.

It also helps locating ab-use of 'struct ppc_inst' dereference.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
[mpe: Fix ppc_inst_next(), use u32 instead of unsigned int]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/7062722b087228e42cbd896e39bfdf526d6a340a.1621516826.git.christophe.leroy@csgroup.eu
</content>
</entry>
<entry>
<title>powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal()</title>
<updated>2021-06-16T13:35:57Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=036b5560bebc72c61d955ae0b115e8e69da8a563'/>
<id>urn:sha1:036b5560bebc72c61d955ae0b115e8e69da8a563</id>
<content type='text'>
Avoid casting/dereferencing ppc_inst() as u64* , check each member
of the struct when relevant.

And remove the 0xff initialisation of the suffix for non
prefixed instruction. An instruction with 0xff as a suffix
might be invalid, but still is a prefixed instruction and
has to be considered as this.

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/d8b155e930b7a9708ca110e8ff0ace6713a7af75.1621516826.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc/inst: Improve readability of get_user_instr() and friends</title>
<updated>2021-06-16T13:35:30Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=042e0860e1c1d60a0ab1ff3f16b7f420573133e0'/>
<id>urn:sha1:042e0860e1c1d60a0ab1ff3f16b7f420573133e0</id>
<content type='text'>
Remove unneeded line splits.

And remove unneeded local variable initialisation.

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/fb097fda78cc6852905ef00f8f7bf371b6cc66f7.1621516826.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc/inst: Reduce casts in get_user_instr()</title>
<updated>2021-06-16T13:35:10Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9134806e149ebb214f122f0f84254096d3768bb2'/>
<id>urn:sha1:9134806e149ebb214f122f0f84254096d3768bb2</id>
<content type='text'>
Declare __gui_ptr as 'u32 *' instead of casting it at each use to
'unsigned int *' (which is an equivalent type).

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
[mpe: Use u32 * instead of unsigned int *]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/2c2123998e05535d08ba03a96ea1eea921d06a86.1621516826.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc/inst: Fix sparse detection on get_user_instr()</title>
<updated>2021-06-15T14:16:49Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-05-20T13:50:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3a9e523237013477bea914b7fbfbe420428b988'/>
<id>urn:sha1:b3a9e523237013477bea914b7fbfbe420428b988</id>
<content type='text'>
get_user_instr() lacks sparse detection for the __user tag.

This is because __gui_ptr is assigned with a cast.

Fix that by adding a __chk_user_ptr()

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/0320e5b41a794fd456ab8c5993bbfadcf9e1d8b4.1621516826.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: Rename probe_kernel_read_inst()</title>
<updated>2021-04-21T12:52:33Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-04-14T13:08:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41d6cf68b5f611934bcc6a7d4a1a2d9bfd04b420'/>
<id>urn:sha1:41d6cf68b5f611934bcc6a7d4a1a2d9bfd04b420</id>
<content type='text'>
When probe_kernel_read_inst() was created, it was to mimic
probe_kernel_read() function.

Since then, probe_kernel_read() has been renamed
copy_from_kernel_nofault().

Rename probe_kernel_read_inst() into copy_inst_from_kernel_nofault().

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/b783d1f7cdb8914992384a669a2af57051b6bdcf.1618405715.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: Make probe_kernel_read_inst() common to PPC32 and PPC64</title>
<updated>2021-04-21T12:52:33Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-04-14T13:08:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6449078d50111c839bb7156c3b99b9def80eed42'/>
<id>urn:sha1:6449078d50111c839bb7156c3b99b9def80eed42</id>
<content type='text'>
We have two independant versions of probe_kernel_read_inst(), one for
PPC32 and one for PPC64.

The PPC32 is identical to the first part of the PPC64 version.
The remaining part of PPC64 version is not relevant for PPC32, but
not contradictory, so we can easily have a common function with
the PPC64 part opted out via a IS_ENABLED(CONFIG_PPC64).

The only need is to add a version of ppc_inst_prefix() for PPC32.

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/f7b9dfddef3b3760182c7e5466356c121a293dc9.1618405715.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: Remove probe_user_read_inst()</title>
<updated>2021-04-21T12:52:33Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-04-14T13:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ac7897f08e04b47df3955d7691652e9d12d4068'/>
<id>urn:sha1:6ac7897f08e04b47df3955d7691652e9d12d4068</id>
<content type='text'>
Its name comes from former probe_user_read() function.
That function is now called copy_from_user_nofault().

probe_user_read_inst() uses copy_from_user_nofault() to read only
a few bytes. It is suboptimal.

It does the same as get_user_inst() but in addition disables
page faults.

But on the other hand, it is not used for the time being. So remove it
for now. If one day it is really needed, we can give it a new name
more in line with today's naming, and implement it using get_user_inst()

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/5f6f82572242a59bfee1e19a71194d8f7ef5fca4.1618405715.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc/inst: ppc_inst_as_u64() becomes ppc_inst_as_ulong()</title>
<updated>2021-04-21T12:52:32Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-04-20T14:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=693557ebf407a85ea400a0b501bb97687d8f4856'/>
<id>urn:sha1:693557ebf407a85ea400a0b501bb97687d8f4856</id>
<content type='text'>
In order to simplify use on PPC32, change ppc_inst_as_u64()
into ppc_inst_as_ulong() that returns the 32 bits instruction
on PPC32.

Will be used when porting OPTPROBES to PPC32.

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/22cadf29620664b600b82026d2a72b8b23351777.1618927318.git.christophe.leroy@csgroup.eu

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