<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-next.git/tools/testing/selftests/riscv/vector, branch master</title>
<subtitle>Linux kernel latest source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/'/>
<updated>2026-07-10T15:32:35+00:00</updated>
<entry>
<title>selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests</title>
<updated>2026-07-10T15:32:35+00:00</updated>
<author>
<name>Wang Yan</name>
<email>wangyan01@kylinos.cn</email>
</author>
<published>2026-07-10T08:34:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=58a37e7317b06665e21609a2f867a9962e9e2919'/>
<id>urn:sha1:58a37e7317b06665e21609a2f867a9962e9e2919</id>
<content type='text'>
The regset_data buffer allocated with calloc() in the parent process
of several vector ptrace tests is never freed before returning,
causing memory leaks in:

- ptrace_v_not_enabled
- ptrace_v_early_debug
- ptrace_v_syscall_clobbering
- v_csr_invalid/ptrace_v_invalid_values
- v_csr_valid/ptrace_v_valid_values

Add free(regset_data) before kill(pid, SIGKILL) to release the
allocated buffer.

Signed-off-by: Wang Yan &lt;wangyan01@kylinos.cn&gt;
Reviewed-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Link: https://patch.msgid.link/20260710083437.489648-1-wangyan01@kylinos.cn
[pjw@kernel.org: Fixed Sergey's E-mail address]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests: riscv: Bypass libc in inactive vector ptrace test</title>
<updated>2026-07-08T02:30:31+00:00</updated>
<author>
<name>Andrew Jones</name>
<email>andrew.jones@oss.qualcomm.com</email>
</author>
<published>2026-07-07T15:38:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=70b439e46effd782097f640c0b64f5f8b0e79913'/>
<id>urn:sha1:70b439e46effd782097f640c0b64f5f8b0e79913</id>
<content type='text'>
The ptrace_v_not_enabled test expects the child to reach its ebreak
before it has used the vector extension. That is not guaranteed when
using fork(), because libc may run child atfork handlers before
returning to the test code. In those cases PTRACE_GETREGSET for
NT_RISCV_VECTOR then succeeds instead of returning ENODATA for
inactive vector state.

Use the raw clone syscall with SIGCHLD to keep fork-like semantics
while bypassing libc's fork wrapper and atfork handler chain.

Cc: Andy Chiu &lt;tchiu@tenstorrent.com&gt;
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Andrew Jones &lt;andrew.jones@oss.qualcomm.com&gt;
Link: https://patch.msgid.link/20260707153827.175245-1-andrew.jones@oss.qualcomm.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests/riscv: fix compiler output flag spacing in all Makefiles</title>
<updated>2026-06-07T02:17:52+00:00</updated>
<author>
<name>Zong Li</name>
<email>zong.li@sifive.com</email>
</author>
<published>2026-06-07T02:17:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=c0db0690f7fae7bd8cf1493e2f6b2a672e0c0de8'/>
<id>urn:sha1:c0db0690f7fae7bd8cf1493e2f6b2a672e0c0de8</id>
<content type='text'>
Standardize the compiler output flag format across all RISC-V
selftests by adding a space between '-o' and '$@'.

Although '-o$@' is perfectly valid for GCC/Clang to parse,
changing it to '-o $@' with a space aligns with the GNU
official documentation conventions, improves readability by
visually separating the flag from the target variable, and
ensures consistency with other architectures.

Currently, RISC-V selftests use '-o$@' (without space) in 13
instances across 6 Makefiles, while all other architectures
consistently use '-o $@' (with space). This inconsistency makes
RISC-V an outlier in the kernel's selftest infrastructure.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Link: https://patch.msgid.link/20260511032917.3542802-1-zong.li@sifive.com
[pjw@kernel.org: cleaned up patch description]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: Add braces around EXPECT_EQ()</title>
<updated>2026-04-05T00:37:57+00:00</updated>
<author>
<name>Charlie Jenkins</name>
<email>thecharlesjenkins@gmail.com</email>
</author>
<published>2026-03-10T01:52:11+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=511361fe7a8856e2f415010942808c237a1b8061'/>
<id>urn:sha1:511361fe7a8856e2f415010942808c237a1b8061</id>
<content type='text'>
EXPECT_EQ() expands to multiple lines, breaking up one-line if
statements. This issue was not present in the patch on the mailing list
but was instead introduced by the maintainer when attempting to fix up
checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
even though checkpatch suggests them to be removed:

validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

Fixes: 3789d5eecd5a ("selftests: riscv: verify syscalls discard vector context")
Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 849f05ae1ea6 ("selftests: riscv: verify ptrace accepts valid vector csr values")
Signed-off-by: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Reviewed-and-tested-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Link: https://patch.msgid.link/20260309-fix_selftests-v2-2-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>riscv: use _BITUL macro rather than BIT() in ptrace uapi and kselftests</title>
<updated>2026-04-05T00:37:54+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-02T23:18:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=87ad7cc9aa7f0a202189640c5015aa985e7e8f3b'/>
<id>urn:sha1:87ad7cc9aa7f0a202189640c5015aa985e7e8f3b</id>
<content type='text'>
Fix the build of non-kernel code that includes the RISC-V ptrace uapi
header, and the RISC-V validate_v_ptrace.c kselftest, by using the
_BITUL() macro rather than BIT().  BIT() is not available outside
the kernel.

Based on patches and comments from Charlie Jenkins, Michael Neuling,
and Andreas Schwab.

Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
Cc: Andreas Schwab &lt;schwab@suse.de&gt;
Cc: Michael Neuling &lt;mikey@neuling.org&gt;
Cc: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Link: https://patch.msgid.link/20260330024248.449292-1-mikey@neuling.org
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-1-9d5a553a531e@gmail.com/
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-3-9d5a553a531e@gmail.com/
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests: riscv: vstate_exec_nolibc: Use the regular prctl() function</title>
<updated>2026-02-09T22:27:33+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2026-01-26T04:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=098921ec6818291d98bd3a4002c9dfbe2e75aac2'/>
<id>urn:sha1:098921ec6818291d98bd3a4002c9dfbe2e75aac2</id>
<content type='text'>
The my_syscall*() macros are internal implementation details of nolibc.

Now that nolibc has a normal prctl() function, use that.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://patch.msgid.link/20260117-nolibc-mysyscall-riscv-v1-1-0ae1ae3513e9@weissschuh.net
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: verify ptrace accepts valid vector csr values</title>
<updated>2026-02-09T22:27:33+00:00</updated>
<author>
<name>Sergey Matyukevich</name>
<email>geomatsi@gmail.com</email>
</author>
<published>2026-01-26T04:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=849f05ae1ea6e1ff621243dce27fe455fdc9d0ff'/>
<id>urn:sha1:849f05ae1ea6e1ff621243dce27fe455fdc9d0ff</id>
<content type='text'>
Add a test to v_ptrace test suite to verify that ptrace accepts the
valid input combinations of vector csr registers. Use kselftest
fixture variants to create multiple inputs for the test.

The test simulates a debug scenario with three breakpoints:
0. init: let the tracee set up its initial vector configuration
1. 1st bp:  modify the tracee's vector csr registers from the debugger
  - resume the tracee to execute a block without vector instructions
2. 2nd bp: read back the tracees's vector csr registers from the debugger
  - compare with values set by the debugger
  - resume the tracee to execute a block with vector instructions
3. 3rd bp: read back the tracess's vector csr registers again
  - compare with values set by the debugger

The last check helps to confirm that ptrace validation check for vector
csr registers input values works properly and maintains an accurate view
of the tracee's vector context in debugger.

Signed-off-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Tested-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Link: https://patch.msgid.link/20251214163537.1054292-10-geomatsi@gmail.com
[pjw@kernel.org: cleaned up a checkpatch issue]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: verify ptrace rejects invalid vector csr inputs</title>
<updated>2026-02-09T22:27:33+00:00</updated>
<author>
<name>Sergey Matyukevich</name>
<email>geomatsi@gmail.com</email>
</author>
<published>2026-01-26T04:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=30eb191c895b086c21fc04c5c1482cb1bb0f3caf'/>
<id>urn:sha1:30eb191c895b086c21fc04c5c1482cb1bb0f3caf</id>
<content type='text'>
Add a test to v_ptrace test suite to verify that ptrace rejects the
invalid input combinations of vector csr registers. Use kselftest
fixture variants to create multiple invalid inputs for the test.

Signed-off-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Tested-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Link: https://patch.msgid.link/20251214163537.1054292-9-geomatsi@gmail.com
[pjw@kernel.org: cleaned up some checkpatch issues]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: verify syscalls discard vector context</title>
<updated>2026-02-09T22:27:33+00:00</updated>
<author>
<name>Sergey Matyukevich</name>
<email>geomatsi@gmail.com</email>
</author>
<published>2026-01-26T04:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=3789d5eecd5ae01149d0ef5ba70e8120da2f55db'/>
<id>urn:sha1:3789d5eecd5ae01149d0ef5ba70e8120da2f55db</id>
<content type='text'>
Add a test to v_ptrace test suite to verify that vector csr registers
are clobbered on syscalls.

Signed-off-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Reviewed-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Tested-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Link: https://patch.msgid.link/20251214163537.1054292-8-geomatsi@gmail.com
[pjw@kernel.org: cleaned up a checkpatch issue]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: verify initial vector state with ptrace</title>
<updated>2026-02-09T22:27:33+00:00</updated>
<author>
<name>Sergey Matyukevich</name>
<email>geomatsi@gmail.com</email>
</author>
<published>2026-01-26T04:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=66d03044891df63c82b18ae1da07bc4bc077ae48'/>
<id>urn:sha1:66d03044891df63c82b18ae1da07bc4bc077ae48</id>
<content type='text'>
Add a test case that attaches to a traced process immediately after its
first executed vector instructions to verify the initial vector context.

Signed-off-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Reviewed-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Tested-by: Andy Chiu &lt;andybnac@gmail.com&gt;
Link: https://patch.msgid.link/20251214163537.1054292-7-geomatsi@gmail.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
</feed>
