<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/tools/testing/selftests/powerpc/ptrace/Makefile, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/powerpc/ptrace/Makefile?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/powerpc/ptrace/Makefile?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-07-25T02:05:16Z</updated>
<entry>
<title>selftests/powerpc/ptrace: Do more of ptrace-gpr in asm</title>
<updated>2022-07-25T02:05:16Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-06-27T14:02:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=611e385087efc2cc3a7033aedd3f84ad0cf2a703'/>
<id>urn:sha1:611e385087efc2cc3a7033aedd3f84ad0cf2a703</id>
<content type='text'>
The ptrace-gpr test includes some inline asm to load GPR and FPR
registers. It then goes back to C to wait for the parent to trace it and
then checks register contents.

The split between inline asm and C is fragile, it relies on the compiler
not using any non-volatile GPRs after the inline asm block. It also
requires a very large and unwieldy inline asm block.

So convert the logic to set registers, wait, and store registers to a
single asm function, meaning there's no window for the compiler to
intervene.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220627140239.2464900-10-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc/ptrace: Build the ptrace-gpr test as 32-bit when possible</title>
<updated>2022-07-25T02:05:16Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-06-27T14:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=149a497d5fda3e996a00437260a4c170e43909c8'/>
<id>urn:sha1:149a497d5fda3e996a00437260a4c170e43909c8</id>
<content type='text'>
The ptrace-gpr test can now be built 32-bit, so do that if that's the
compiler default rather than forcing a 64-bit build.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220627140239.2464900-9-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc/ptrace: Split CFLAGS better</title>
<updated>2022-07-25T02:05:15Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-06-27T14:02:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3c20a1d07c377d7260ca853e216cc85bbd7857fa'/>
<id>urn:sha1:3c20a1d07c377d7260ca853e216cc85bbd7857fa</id>
<content type='text'>
Currently all ptrace tests are built 64-bit and with TM enabled.

Only the TM tests need TM enabled, so split those out into a separate
variable so that can be specified precisely.

Split the rest of the tests into a variable, and add -m64 to CFLAGS for
those tests, so that in a subsequent patch some tests can be made to
build 32-bit.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220627140239.2464900-3-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc/ptrace: Set LOCAL_HDRS</title>
<updated>2022-07-25T02:05:15Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-06-27T14:02:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=cf4baafd7846b3def67057a09b7603a6b566417a'/>
<id>urn:sha1:cf4baafd7846b3def67057a09b7603a6b566417a</id>
<content type='text'>
Set LOCAL_HDRS so header changes cause rebuilds. The lib.mk logic adds
all the headers in LOCAL_HDRS as dependencies, so there's no need to
also list them explicitly.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220627140239.2464900-2-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>powerpc/selftests: Add selftest to test concurrent perf/ptrace events</title>
<updated>2021-04-22T15:38:03Z</updated>
<author>
<name>Ravi Bangoria</name>
<email>ravi.bangoria@linux.ibm.com</email>
</author>
<published>2021-04-12T11:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=290f7d8ce2b1eea5413bb120e0d9d610675b7fba'/>
<id>urn:sha1:290f7d8ce2b1eea5413bb120e0d9d610675b7fba</id>
<content type='text'>
ptrace and perf watchpoints can't co-exists if their address range
overlaps. See commit 29da4f91c0c1 ("powerpc/watchpoint: Don't allow
concurrent perf and ptrace events") for more detail. Add selftest
for the same.

Sample o/p:
  # ./ptrace-perf-hwbreak
  test: ptrace-perf-hwbreak
  tags: git_version:powerpc-5.8-7-118-g937fa174a15d-dirty
  perf cpu event -&gt; ptrace thread event (Overlapping): Ok
  perf cpu event -&gt; ptrace thread event (Non-overlapping): Ok
  perf thread event -&gt; ptrace same thread event (Overlapping): Ok
  perf thread event -&gt; ptrace same thread event (Non-overlapping): Ok
  perf thread event -&gt; ptrace other thread event: Ok
  ptrace thread event -&gt; perf kernel event: Ok
  ptrace thread event -&gt; perf same thread event (Overlapping): Ok
  ptrace thread event -&gt; perf same thread event (Non-overlapping): Ok
  ptrace thread event -&gt; perf other thread event: Ok
  ptrace thread event -&gt; perf cpu event (Overlapping): Ok
  ptrace thread event -&gt; perf cpu event (Non-overlapping): Ok
  ptrace thread event -&gt; perf same thread &amp; cpu event (Overlapping): Ok
  ptrace thread event -&gt; perf same thread &amp; cpu event (Non-overlapping): Ok
  ptrace thread event -&gt; perf other thread &amp; cpu event: Ok
  success: ptrace-perf-hwbreak

Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210412112218.128183-5-ravi.bangoria@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/ptrace: Fix out-of-tree build</title>
<updated>2018-10-31T12:56:19Z</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2018-10-29T11:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c39b79082a38a4f8c801790edecbbb4d62ed2992'/>
<id>urn:sha1:c39b79082a38a4f8c801790edecbbb4d62ed2992</id>
<content type='text'>
We should use TEST_GEN_PROGS, not TEST_PROGS. That tells the selftests
makefile (lib.mk) that those tests are generated (built), and so it
adds the $(OUTPUT) prefix for us, making the out-of-tree build work
correctly.

It also means we don't need our own clean rule, lib.mk does it.

We also have to update the ptrace-pkey and core-pkey rules to use
$(OUTPUT).

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>Revert "selftests/powerpc: Fix out-of-tree build errors"</title>
<updated>2018-10-26T10:58:58Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2018-10-25T17:24:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=58cfbac25b1fd2b76f94566aed28a3662b0ff8c6'/>
<id>urn:sha1:58cfbac25b1fd2b76f94566aed28a3662b0ff8c6</id>
<content type='text'>
This reverts commit d8a2fe29d3c97038c8efcc328d5e7940c5310565.

That commit, by me, fixed the out of tree build errors by causing some
of the tests not to build at all.
</content>
</entry>
<entry>
<title>selftests/powerpc: Fix out-of-tree build errors</title>
<updated>2018-10-20T02:26:47Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2018-10-18T13:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d8a2fe29d3c97038c8efcc328d5e7940c5310565'/>
<id>urn:sha1:d8a2fe29d3c97038c8efcc328d5e7940c5310565</id>
<content type='text'>
Some of our Makefiles don't do the right thing when building the
selftests with O=, fix them up.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fixes' into next</title>
<updated>2018-10-09T05:51:05Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2018-10-09T05:51:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9b7e4d601baac83a7104652042107ce94f245524'/>
<id>urn:sha1:9b7e4d601baac83a7104652042107ce94f245524</id>
<content type='text'>
Merge our fixes branch. It has a few important fixes that are needed for
futher testing and also some commits that will conflict with content in
next.
</content>
</entry>
<entry>
<title>selftests/powerpc: New PTRACE_SYSEMU test</title>
<updated>2018-10-03T05:40:04Z</updated>
<author>
<name>Breno Leitao</name>
<email>leitao@debian.org</email>
</author>
<published>2018-09-20T16:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fc35ef12dc8ba8633a99c9d9df03a5bb53f1dda3'/>
<id>urn:sha1:fc35ef12dc8ba8633a99c9d9df03a5bb53f1dda3</id>
<content type='text'>
This patch adds a new test for the new PTRACE_SYSEMU ptrace request.

This test also relies on PTRACE_GETREGS and PTRACE_SETREGS requests to
run properly, since the trace instruction (gettid() syscall) is being
modified at run-time (by PTRACE_SETREGS) and re-executed three times.
PTRACE_GETREGS is being used to check that the registers are still
sane.

This test basically creates a child process that executes syscalls
and the parent process check if it is being traced appropriately.  The
parent process guarantees that the SYSCALLs are being traced, with
PTRACE_SYSEMU, and ptrace stops the child application before a syscall is
executed. The way the tests validates it, is by guaranteeing that the
system calls arguments, as argv[0] (r3) which is the same register that
will have the syscall return value on powerpc, are not being corrupted on
PTRACE_SYSEMU with a return value, i.e, it continues to have the current
arguments instead, meaning that the registers where not clobbered.

This test is basically the same test for x86 located at
tools/testing/selftests/x86/ptrace_syscall.c, limited to test PTRACE_SYSEMU
request, and ported to PowerPC.

Signed-off-by: Breno Leitao &lt;leitao@debian.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
</feed>
