<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/tools/testing/selftests/powerpc, branch v5.8</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>selftests/powerpc: Use proper error code to check fault address</title>
<updated>2020-07-15T13:10:17+00:00</updated>
<author>
<name>Haren Myneni</name>
<email>haren@linux.ibm.com</email>
</author>
<published>2020-07-10T23:49:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f0479c4bcbd92d1a457d4a43bcab79f29d11334a'/>
<id>f0479c4bcbd92d1a457d4a43bcab79f29d11334a</id>
<content type='text'>
ERR_NX_TRANSLATION(CSB.CC=5) is for internal to VAS for fault handling
and should not used by OS. ERR_NX_AT_FAULT(CSB.CC=250) is the proper
error code should be reported by OS when NX encounters address
translation failure.

This patch uses CC=250 to determine the fault address when the request
is not successful.

Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/0315251705baff94f678c33178491b5008723511.camel@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ERR_NX_TRANSLATION(CSB.CC=5) is for internal to VAS for fault handling
and should not used by OS. ERR_NX_AT_FAULT(CSB.CC=250) is the proper
error code should be reported by OS when NX encounters address
translation failure.

This patch uses CC=250 to determine the fault address when the request
is not successful.

Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/0315251705baff94f678c33178491b5008723511.camel@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Fix build failure in ebb tests</title>
<updated>2020-06-26T02:53:09+00:00</updated>
<author>
<name>Harish</name>
<email>harish@linux.ibm.com</email>
</author>
<published>2020-06-25T16:57:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=896066aa0685af3434637998b76218c2045142a8'/>
<id>896066aa0685af3434637998b76218c2045142a8</id>
<content type='text'>
We use OUTPUT directory as TMPOUT for checking no-pie option.

Since commit f2f02ebd8f38 ("kbuild: improve cc-option to clean up all
temporary files") when building powerpc/ from selftests directory, the
OUTPUT directory points to powerpc/pmu/ebb/ and gets removed when
checking for -no-pie option in try-run routine, subsequently build
fails with the following:

  $ make -C powerpc
  ...
  TARGET=ebb; BUILD_TARGET=$OUTPUT/$TARGET; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C $TARGET all
  make[2]: Entering directory '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb'
  make[2]: *** No rule to make target 'Makefile'.
  make[2]: Failed to remake makefile 'Makefile'.
  make[2]: *** No rule to make target 'ebb.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'ebb_handler.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'trace.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'busy_loop.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: Target 'all' not remade because of errors.

Fix this by adding a suffix to the OUTPUT directory so that the
failure is avoided.

Fixes: 9686813f6e9d ("selftests/powerpc: Fix try-run when source tree is not writable")
Signed-off-by: Harish &lt;harish@linux.ibm.com&gt;
[mpe: Mention that commit that triggered the breakage]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200625165721.264904-1-harish@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use OUTPUT directory as TMPOUT for checking no-pie option.

Since commit f2f02ebd8f38 ("kbuild: improve cc-option to clean up all
temporary files") when building powerpc/ from selftests directory, the
OUTPUT directory points to powerpc/pmu/ebb/ and gets removed when
checking for -no-pie option in try-run routine, subsequently build
fails with the following:

  $ make -C powerpc
  ...
  TARGET=ebb; BUILD_TARGET=$OUTPUT/$TARGET; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C $TARGET all
  make[2]: Entering directory '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb'
  make[2]: *** No rule to make target 'Makefile'.
  make[2]: Failed to remake makefile 'Makefile'.
  make[2]: *** No rule to make target 'ebb.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'ebb_handler.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'trace.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: *** No rule to make target 'busy_loop.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'.
  make[2]: Target 'all' not remade because of errors.

Fix this by adding a suffix to the OUTPUT directory so that the
failure is avoided.

Fixes: 9686813f6e9d ("selftests/powerpc: Fix try-run when source tree is not writable")
Signed-off-by: Harish &lt;harish@linux.ibm.com&gt;
[mpe: Mention that commit that triggered the breakage]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200625165721.264904-1-harish@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add a test of counting larx/stcx</title>
<updated>2020-05-15T01:58:55+00:00</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2020-04-26T11:44:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7481cad4747303442209bc5dba2f56c3afcea07d'/>
<id>7481cad4747303442209bc5dba2f56c3afcea07d</id>
<content type='text'>
This is based on the count_instructions test.

However this one also counts the number of failed stcx's, and in
conjunction with knowing the size of the stcx loop, can calculate the
total number of instructions executed even in the face of
non-deterministic stcx failures.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200426114410.3917383-1-mpe@ellerman.id.au
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is based on the count_instructions test.

However this one also counts the number of failed stcx's, and in
conjunction with knowing the size of the stcx loop, can calculate the
total number of instructions executed even in the face of
non-deterministic stcx failures.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200426114410.3917383-1-mpe@ellerman.id.au
</pre>
</div>
</content>
</entry>
<entry>
<title>powerpc/mm: Replace zero-length array with flexible-array</title>
<updated>2020-05-15T01:58:54+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-05-07T18:57:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=02bddf21c34d0a918acc8647195ba4507e3db8fc'/>
<id>02bddf21c34d0a918acc8647195ba4507e3db8fc</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200507185755.GA15014@embeddedor
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200507185755.GA15014@embeddedor
</pre>
</div>
</content>
</entry>
<entry>
<title>powerpc: Use trap metadata to prevent double restart rather than zeroing trap</title>
<updated>2020-05-15T01:58:54+00:00</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2020-05-07T12:13:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4e0e45b07d790253643ee05300784ab2156e2d5e'/>
<id>4e0e45b07d790253643ee05300784ab2156e2d5e</id>
<content type='text'>
It's not very nice to zero trap for this, because then system calls no
longer have trap_is_syscall(regs) invariant, and we can't distinguish
between sc and scv system calls (in a later patch).

Take one last unused bit from the low bits of the pt_regs.trap word
for this instead. There is not a really good reason why it should be
in trap as opposed to another field, but trap has some concept of
flags and it exists. Ideally I think we would move trap to 2-byte
field and have 2 more bytes available independently.

Add a selftests case for this, which can be seen to fail if
trap_norestart() is changed to return false.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
[mpe: Make them static inlines]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200507121332.2233629-4-mpe@ellerman.id.au
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's not very nice to zero trap for this, because then system calls no
longer have trap_is_syscall(regs) invariant, and we can't distinguish
between sc and scv system calls (in a later patch).

Take one last unused bit from the low bits of the pt_regs.trap word
for this instead. There is not a really good reason why it should be
in trap as opposed to another field, but trap has some concept of
flags and it exists. Ideally I think we would move trap to 2-byte
field and have 2 more bytes available independently.

Add a selftests case for this, which can be seen to fail if
trap_norestart() is changed to return false.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
[mpe: Make them static inlines]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200507121332.2233629-4-mpe@ellerman.id.au
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add README for GZIP engine tests</title>
<updated>2020-04-21T12:51:34+00:00</updated>
<author>
<name>Raphael Moreira Zinsly</name>
<email>rzinsly@linux.ibm.com</email>
</author>
<published>2020-04-20T20:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=722c1963aba5a86778f7d044116e10e1c73e87a8'/>
<id>722c1963aba5a86778f7d044116e10e1c73e87a8</id>
<content type='text'>
Include a README file with the instructions to use the
testcases at selftests/powerpc/nx-gzip.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-6-rzinsly@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Include a README file with the instructions to use the
testcases at selftests/powerpc/nx-gzip.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-6-rzinsly@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add NX-GZIP engine decompress testcase</title>
<updated>2020-04-21T12:51:34+00:00</updated>
<author>
<name>Raphael Moreira Zinsly</name>
<email>rzinsly@linux.ibm.com</email>
</author>
<published>2020-04-20T20:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=841fb73ad2195ac7d79ce970fa3d7ed7a5bb0ecd'/>
<id>841fb73ad2195ac7d79ce970fa3d7ed7a5bb0ecd</id>
<content type='text'>
Include a decompression testcase for the powerpc NX-GZIP
engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-5-rzinsly@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Include a decompression testcase for the powerpc NX-GZIP
engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-5-rzinsly@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add NX-GZIP engine compress testcase</title>
<updated>2020-04-21T12:51:34+00:00</updated>
<author>
<name>Raphael Moreira Zinsly</name>
<email>rzinsly@linux.ibm.com</email>
</author>
<published>2020-04-20T20:55:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=647c734f62f882bb742683cd5f5596f0abadf758'/>
<id>647c734f62f882bb742683cd5f5596f0abadf758</id>
<content type='text'>
Add a compression testcase for the powerpc NX-GZIP engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-4-rzinsly@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a compression testcase for the powerpc NX-GZIP engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-4-rzinsly@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add header files for NX compresion/decompression</title>
<updated>2020-04-21T12:51:34+00:00</updated>
<author>
<name>Raphael Moreira Zinsly</name>
<email>rzinsly@linux.ibm.com</email>
</author>
<published>2020-04-20T20:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f49b75724cfa2a6264aa5a77f33c3883701852af'/>
<id>f49b75724cfa2a6264aa5a77f33c3883701852af</id>
<content type='text'>
Add files to be able to compress and decompress files using the
powerpc NX-GZIP engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-3-rzinsly@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add files to be able to compress and decompress files using the
powerpc NX-GZIP engine.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-3-rzinsly@linux.ibm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests/powerpc: Add header files for GZIP engine test</title>
<updated>2020-04-21T12:51:33+00:00</updated>
<author>
<name>Raphael Moreira Zinsly</name>
<email>rzinsly@linux.ibm.com</email>
</author>
<published>2020-04-20T20:55:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d53979b589609d87036d8daf9500f7eccb0c6317'/>
<id>d53979b589609d87036d8daf9500f7eccb0c6317</id>
<content type='text'>
Add files to access the powerpc NX-GZIP engine in user space.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-2-rzinsly@linux.ibm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add files to access the powerpc NX-GZIP engine in user space.

Signed-off-by: Bulent Abali &lt;abali@us.ibm.com&gt;
Signed-off-by: Raphael Moreira Zinsly &lt;rzinsly@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200420205538.25181-2-rzinsly@linux.ibm.com
</pre>
</div>
</content>
</entry>
</feed>
