<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/rseq, branch v5.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-12-07T21:09:45Z</updated>
<entry>
<title>rseq/selftests: Fix MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ build error under other arch.</title>
<updated>2020-12-07T21:09:45Z</updated>
<author>
<name>Xingxing Su</name>
<email>suxingxing@loongson.cn</email>
</author>
<published>2020-11-25T04:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f39cecdb6018234a47dcea15121f01b9903d16b'/>
<id>urn:sha1:6f39cecdb6018234a47dcea15121f01b9903d16b</id>
<content type='text'>
Except arch x86, the function rseq_offset_deref_addv is not defined.
The function test_membarrier_manager_thread call rseq_offset_deref_addv
produces a build error.

The RSEQ_ARCH_HAS_OFFSET_DEREF_ADD should contain all the code
for the MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ.
If the other Arch implements this feature,
defined RSEQ_ARCH_HAS_OFFSET_DEREF_ADD in the header file
to ensure that this feature is available.

Following build errors:

param_test.c: In function ‘test_membarrier_worker_thread’:
param_test.c:1164:10: warning: implicit declaration of function ‘rseq_offset_deref_addv’
    ret = rseq_offset_deref_addv(&amp;args-&gt;percpu_list_ptr,
          ^~~~~~~~~~~~~~~~~~~~~~
/tmp/ccMj9yHJ.o: In function `test_membarrier_worker_thread':
param_test.c:1164: undefined reference to `rseq_offset_deref_addv'
param_test.c:1164: undefined reference to `rseq_offset_deref_addv'
collect2: error: ld returned 1 exit status
make: *** [/selftests/rseq/param_test_benchmark] Error 1

Signed-off-by: Xingxing Su &lt;suxingxing@loongson.cn&gt;
Acked-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rseq/selftests: Test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ</title>
<updated>2020-09-25T12:23:27Z</updated>
<author>
<name>Peter Oskolkov</name>
<email>posk@google.com</email>
</author>
<published>2020-09-23T23:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f166b111e0491486fca0d105f09655ab718bd1c8'/>
<id>urn:sha1:f166b111e0491486fca0d105f09655ab718bd1c8</id>
<content type='text'>
Based on Google-internal RSEQ work done by Paul Turner and Andrew
Hunter.

This patch adds a selftest for MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ.
The test quite often fails without the previous patch in this
patchset, but consistently passes with it.

Signed-off-by: Peter Oskolkov &lt;posk@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Link: https://lkml.kernel.org/r/20200923233618.2572849-3-posk@google.com
</content>
</entry>
<entry>
<title>rseq/selftests,x86_64: Add rseq_offset_deref_addv()</title>
<updated>2020-09-25T12:23:27Z</updated>
<author>
<name>Peter Oskolkov</name>
<email>posk@google.com</email>
</author>
<published>2020-09-23T23:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ea366dd79c05fcd4cf5e225d2de8a3a7c293160c'/>
<id>urn:sha1:ea366dd79c05fcd4cf5e225d2de8a3a7c293160c</id>
<content type='text'>
This patch adds rseq_offset_deref_addv() function to
tools/testing/selftests/rseq/rseq-x86.h, to be used in a selftest in
the next patch in the patchset.

Once an architecture adds support for this function they should define
"RSEQ_ARCH_HAS_OFFSET_DEREF_ADDV".

Signed-off-by: Peter Oskolkov &lt;posk@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Link: https://lkml.kernel.org/r/20200923233618.2572849-2-posk@google.com
</content>
</entry>
<entry>
<title>.gitignore: add SPDX License Identifier</title>
<updated>2020-03-25T10:50:48Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-03-03T13:35:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d198b34f3855eee2571dda03eea75a09c7c31480'/>
<id>urn:sha1:d198b34f3855eee2571dda03eea75a09c7c31480</id>
<content type='text'>
Add SPDX License Identifier to all .gitignore files.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/rseq: Fix out-of-tree compilation</title>
<updated>2020-02-20T15:57:12Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2020-02-20T11:37:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef89d0545132d685f73da6f58b7e7fe002536f91'/>
<id>urn:sha1:ef89d0545132d685f73da6f58b7e7fe002536f91</id>
<content type='text'>
Currently if you build with O=... the rseq tests don't build:

  $ make O=$PWD/output -C tools/testing/selftests/ TARGETS=rseq
  make: Entering directory '/linux/tools/testing/selftests'
  ...
  make[1]: Entering directory '/linux/tools/testing/selftests/rseq'
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./  -shared -fPIC rseq.c -lpthread -o /linux/output/rseq/librseq.so
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./  basic_test.c -lpthread -lrseq -o /linux/output/rseq/basic_test
  /usr/bin/ld: cannot find -lrseq
  collect2: error: ld returned 1 exit status

This is because the library search path points to the source
directory, not the output.

We can fix it by changing the library search path to $(OUTPUT).

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: Install settings files to fix TIMEOUT failures</title>
<updated>2020-02-20T15:56:42Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2020-02-20T04:42:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b9167c8078c3527de6da241c8a1a75a9224ed90a'/>
<id>urn:sha1:b9167c8078c3527de6da241c8a1a75a9224ed90a</id>
<content type='text'>
Commit 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second
timeout per test") added a 45 second timeout for tests, and also added
a way for tests to customise the timeout via a settings file.

For example the ftrace tests take multiple minutes to run, so they
were given longer in commit b43e78f65b1d ("tracing/selftests: Turn off
timeout setting").

This works when the tests are run from the source tree. However if the
tests are installed with "make -C tools/testing/selftests install",
the settings files are not copied into the install directory. When the
tests are then run from the install directory the longer timeouts are
not applied and the tests timeout incorrectly.

So add the settings files to TEST_FILES of the appropriate Makefiles
to cause the settings files to be installed using the existing install
logic.

Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second timeout per test")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rseq/selftests: Clarify rseq_prepare_unload() helper requirements</title>
<updated>2019-12-23T17:52:41Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2019-12-20T20:33:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a1f40adfb54ca65dc4c93bad444dd23b800a76e'/>
<id>urn:sha1:2a1f40adfb54ca65dc4c93bad444dd23b800a76e</id>
<content type='text'>
The rseq.h UAPI now documents that the rseq_cs field must be cleared
before reclaiming memory that contains the targeted struct rseq_cs, but
also that the rseq_cs field must be cleared before reclaiming memory of
the code pointed to by the rseq_cs start_ip and post_commit_offset
fields.

While we can expect that use of dlclose(3) will typically unmap
both struct rseq_cs and its associated code at once, nothing would
theoretically prevent a JIT from reclaiming the code without
reclaiming the struct rseq_cs, which would erroneously allow the
kernel to consider new code which is not a rseq critical section
as a rseq critical section following a code reclaim.

Suggested-by: Florian Weimer &lt;fw@deneb.enyo.de&gt;
Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Florian Weimer &lt;fw@deneb.enyo.de&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Paul Turner &lt;pjt@google.com&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rseq/selftests: Fix: Namespace gettid() for compatibility with glibc 2.30</title>
<updated>2019-12-23T17:52:41Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2019-12-11T16:17:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8df34c56321479bfa1ec732c675b686c2b4df412'/>
<id>urn:sha1:8df34c56321479bfa1ec732c675b686c2b4df412</id>
<content type='text'>
glibc 2.30 introduces gettid() in public headers, which clashes with
the internal static definition within rseq selftests.

Rename gettid() to rseq_gettid() to eliminate this symbol name clash.

Reported-by: Tommi T. Rantala &lt;tommi.t.rantala@nokia.com&gt;
Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Tommi T. Rantala &lt;tommi.t.rantala@nokia.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Paul Turner &lt;pjt@google.com&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;	# v4.18+
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rseq/selftests: Turn off timeout setting</title>
<updated>2019-12-23T17:52:41Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2019-12-11T16:28:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af9cb29c5488381083b0b5ccdfb3cd931063384a'/>
<id>urn:sha1:af9cb29c5488381083b0b5ccdfb3cd931063384a</id>
<content type='text'>
As the rseq selftests can run for a long period of time, disable the
timeout that the general selftests have.

Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Paul Turner &lt;pjt@google.com&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rseq/selftests: Fix Thumb mode build failure on arm32</title>
<updated>2019-07-08T19:00:41Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2019-06-30T13:56:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee8a84c60bcc1f1615bd9cb3edfe501e26cdc85b'/>
<id>urn:sha1:ee8a84c60bcc1f1615bd9cb3edfe501e26cdc85b</id>
<content type='text'>
Using ".arm .inst" for the arm signature introduces build issues for
programs compiled in Thumb mode because the assembler stays in the
arm mode for the rest of the inline assembly. Revert to using a ".word"
to express the signature as data instead.

The choice of signature is a valid trap instruction on arm32 little
endian, where both code and data are little endian.

ARMv6+ big endian (BE8) generates mixed endianness code vs data:
little-endian code and big-endian data. The data value of the signature
needs to have its byte order reversed to generate the trap instruction.

Prior to ARMv6, -mbig-endian generates big-endian code and data
(which match), so the endianness of the data representation of the
signature should not be reversed. However, the choice between BE32
and BE8 is done by the linker, so we cannot know whether code and
data endianness will be mixed before the linker is invoked. So rather
than try to play tricks with the linker, the rseq signature is simply
data (not a trap instruction) prior to ARMv6 on big endian. This is
why the signature is expressed as data (.word) rather than as
instruction (.inst) in assembler.

Because a ".word" is used to emit the signature, it will be interpreted
as a literal pool by a disassembler, not as an actual instruction.
Considering that the signature is not meant to be executed except in
scenarios where the program execution is completely bogus, this should
not be an issue.

Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
CC: Peter Zijlstra &lt;peterz@infradead.org&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Joel Fernandes &lt;joelaf@google.com&gt;
CC: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
CC: Dave Watson &lt;davejwatson@fb.com&gt;
CC: Will Deacon &lt;will.deacon@arm.com&gt;
CC: Shuah Khan &lt;shuah@kernel.org&gt;
CC: Andi Kleen &lt;andi@firstfloor.org&gt;
CC: linux-kselftest@vger.kernel.org
CC: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
CC: Chris Lameter &lt;cl@linux.com&gt;
CC: Russell King &lt;linux@arm.linux.org.uk&gt;
CC: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
CC: "Paul E . McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
CC: Paul Turner &lt;pjt@google.com&gt;
CC: Boqun Feng &lt;boqun.feng@gmail.com&gt;
CC: Josh Triplett &lt;josh@joshtriplett.org&gt;
CC: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Ben Maurer &lt;bmaurer@fb.com&gt;
CC: linux-api@vger.kernel.org
CC: Andy Lutomirski &lt;luto@amacapital.net&gt;
CC: Andrew Morton &lt;akpm@linux-foundation.org&gt;
CC: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
CC: Carlos O'Donell &lt;carlos@redhat.com&gt;
CC: Florian Weimer &lt;fweimer@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
