<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/tools/testing/selftests/riscv, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-09-02T01:20:23+00:00</updated>
<entry>
<title>kselftest/riscv: Replace __ASSEMBLY__ with __ASSEMBLER__</title>
<updated>2026-09-02T01:20:23+00:00</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-08-13T07:53:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2464ac8a6ff8d8a18b50088eb1d1d638f9cee2f1'/>
<id>urn:sha1:2464ac8a6ff8d8a18b50088eb1d1d638f9cee2f1</id>
<content type='text'>
While the GCC and Clang compilers already define __ASSEMBLER__
automatically when compiling assembly code, __ASSEMBLY__ is a
macro that only gets defined by the Makefiles in the kernel.
This can be very confusing when switching between userspace
and kernelspace coding, or when dealing with uapi headers that
rather should use __ASSEMBLER__ instead. So let's standardize now
on the __ASSEMBLER__ macro that is provided by the compilers.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Link: https://patch.msgid.link/20260813075304.75988-1-thuth@redhat.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>riscv: report Zfhmin/Zvfhmin when Zfh/Zvfh are present</title>
<updated>2026-09-02T01:19:44+00:00</updated>
<author>
<name>JinRui</name>
<email>jinrui@haiwei.tech</email>
</author>
<published>2026-08-11T08:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=248dbaf7770c0843702355a9fb724a882c669062'/>
<id>urn:sha1:248dbaf7770c0843702355a9fb724a882c669062</id>
<content type='text'>
The RISC-V ISA manual specifies that Zfh implies Zfhmin, a normative
rule clarified in
https://github.com/riscv/riscv-isa-manual/pull/3070. Zvfh likewise
implies Zvfhmin, as stated by the vector extension specification.

The kernel currently reports ZFH and ZFHMIN (and ZVFH and ZVFHMIN) as
independent hwprobe bits derived only from what the device tree
declares. Platforms that declare just "zfh" (Zfh being a superset that
already contains all Zfhmin instructions) therefore report
RISCV_HWPROBE_EXT_ZFHMIN=0, which breaks userspace RVA23 conformance
checks (e.g. snapd installing core26 on riscv64).

Use the existing superset mechanism to set the implied subset bits:
  - zfh implies zfhmin
  - zvfh implies zvfhmin

Add a hwprobe selftest asserting the implication holds and update the
hwprobe documentation accordingly.

This is complementary to the rva23u64 base behavior discussion: the
RVA23 conformance query proposed there is derived from the
per-extension bits fixed here, so correct EXT_0 reporting is a
prerequisite for it to work on harts whose device tree declares only
"zfh".

Tested on a RISC-V QEMU VM whose device tree only declares "zfh" and
"zvfh": with this change both /proc/cpuinfo and the hwprobe
RISCV_HWPROBE_KEY_IMA_EXT_0 bitmap report ZFHMIN and ZVFHMIN, and the
hwprobe selftest (including the new implication check) passes.

Link: https://lore.kernel.org/kvm-riscv/20260206002349.96740-1-andrew.jones@oss.qualcomm.com/
Signed-off-by: JinRui &lt;jinrui@haiwei.tech&gt;
Link: https://patch.msgid.link/7190E4DB338251C3+20260811081513.2849980-1-jinrui@haiwei.tech
[pjw@kernel.org: trimmed superfluous blank line in tags]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<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='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.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='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.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='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.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>riscv: cfi: reject unknown flags in PR_SET_CFI</title>
<updated>2026-06-07T02:17:05+00:00</updated>
<author>
<name>Richard Patel</name>
<email>ripatel@wii.dev</email>
</author>
<published>2026-05-18T18:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=15b4155138505669d3d43d7692459ee8ea2a86e7'/>
<id>urn:sha1:15b4155138505669d3d43d7692459ee8ea2a86e7</id>
<content type='text'>
prctl(PR_SET_CFI,PR_CFI_BRANCH_LANDING_PADS) silently ignored
unknown control values. Only PR_CFI_{ENABLE,DISABLE,LOCK} should
be permitted.

This changes the behavior of the uABI (fails previously accepted bits
with EINVAL).

Fixes: 08ee1559052b ("prctl: cfi: change the branch landing pad prctl()s to be more descriptive")
Signed-off-by: Richard Patel &lt;ripatel@wii.dev&gt;
Link: https://patch.msgid.link/20260518183918.322545-1-ripatel@wii.dev
[pjw@kernel.org: change the patch description to note that although this is a uABI change, it does not break the uABI]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests: riscv: Add license to cfi selftest</title>
<updated>2026-04-05T00:42:41+00:00</updated>
<author>
<name>Charlie Jenkins</name>
<email>thecharlesjenkins@gmail.com</email>
</author>
<published>2026-04-05T00:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7eb2e2954687bae09ca1b813df5d338744e7e538'/>
<id>urn:sha1:7eb2e2954687bae09ca1b813df5d338744e7e538</id>
<content type='text'>
The cfi selftest was missing a license so add it.

Signed-off-by: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Reviewed-by: Deepak Gupta &lt;debug@rivosinc.com&gt;
Link: https://patch.msgid.link/20260309-fix_selftests-v2-4-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>prctl: cfi: change the branch landing pad prctl()s to be more descriptive</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=08ee1559052be302f1d3752f48360b89517d9f8d'/>
<id>urn:sha1:08ee1559052be302f1d3752f48360b89517d9f8d</id>
<content type='text'>
Per Linus' comments requesting the replacement of "INDIR_BR_LP" in the
indirect branch tracking prctl()s with something more readable, and
suggesting the use of the speculation control prctl()s as an exemplar,
reimplement the prctl()s and related constants that control per-task
forward-edge control flow integrity.

This primarily involves two changes.  First, the prctls are
restructured to resemble the style of the speculative execution
workaround control prctls PR_{GET,SET}_SPECULATION_CTRL, to make them
easier to extend in the future.  Second, the "indir_br_lp" abbrevation
is expanded to "branch_landing_pads" to be less telegraphic.  The
kselftest and documentation is adjusted accordingly.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e5342fe2c1bb5b4fab6ed531a0122c6417e57ecf'/>
<id>urn:sha1:e5342fe2c1bb5b4fab6ed531a0122c6417e57ecf</id>
<content type='text'>
Similar to the recent change to expand "LP" to "branch landing pad",
let's expand "SS" in the ptrace uapi macros to "shadow stack" as well.
This aligns with the existing prctl() arguments, which use the
expanded "shadow stack" names, rather than just the abbreviation.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ac4e61c730d778f8d8b8455da052952dbf8e0317'/>
<id>urn:sha1:ac4e61c730d778f8d8b8455da052952dbf8e0317</id>
<content type='text'>
Per Linus' comments about the unreadability of abbreviations such as
"LP", rename the RISC-V ptrace landing pad CFI macro names to be more
explicit.  This primarily involves expanding "LP" in the names to some
variant of "branch landing pad."

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
</feed>
