<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/tools/testing/selftests/kvm/include/riscv, branch master</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-04-20T21:54:16+00:00</updated>
<entry>
<title>KVM: selftests: Use u32 instead of uint32_t</title>
<updated>2026-04-20T21:54:16+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-04-20T21:19:51+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0c3a8774692aaf211b6916aaa9ecc5ca1a72c451'/>
<id>urn:sha1:0c3a8774692aaf211b6916aaa9ecc5ca1a72c451</id>
<content type='text'>
Use u32 instead of uint32_t to make the KVM selftests code more concise
and more similar to the kernel (since selftests are primarily developed
by kernel developers).

This commit was generated with the following command:

  git ls-files tools/testing/selftests/kvm | xargs sed -i 's/uint32_t/u32/g'

Then by manually adjusting whitespace to make checkpatch.pl happy.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://patch.msgid.link/20260420212004.3938325-7-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Use u64 instead of uint64_t</title>
<updated>2026-04-20T21:54:16+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-04-20T21:19:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=26f8453288d4c1fb8c96802eae15ddc988f5e068'/>
<id>urn:sha1:26f8453288d4c1fb8c96802eae15ddc988f5e068</id>
<content type='text'>
Use u64 instead of uint64_t to make the KVM selftests code more concise
and more similar to the kernel (since selftests are primarily developed
by kernel developers).

This commit was generated with the following command:

  git ls-files tools/testing/selftests/kvm | xargs sed -i 's/uint64_t/u64/g'

Then by manually adjusting whitespace to make checkpatch.pl happy.

Include &lt;linux/types.h&gt; in include/kvm_util_types.h, iinclude/test_util.h,
and include/x86/pmu.h to pick up the tools-defined u64.  Arguably, all
headers (especially kvm_util_types.h) should have already been including
stdint.h to get uint64_t from the libc headers, but the missing dependency
only rears its head once KVM uses u64 instead of uint64_t.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
[sean: rename pread_uint64() =&gt; pread_u64, expand on types.h include]
Link: https://patch.msgid.link/20260420212004.3938325-5-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Use gpa_t instead of vm_paddr_t</title>
<updated>2026-04-20T21:54:16+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-04-20T21:19:47+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=97dcda3fdce5f4f0d689a097f1ff13e1f76f8f49'/>
<id>urn:sha1:97dcda3fdce5f4f0d689a097f1ff13e1f76f8f49</id>
<content type='text'>
Replace all occurrences of vm_paddr_t with gpa_t to align with KVM code
and with the conversion helpers (e.g. addr_hva2gpa()).

This commit was generated with the following command:

  git ls-files tools/testing/selftests/kvm | xargs sed -i 's/vm_paddr_/gpa_/g'

Then by manually adjusting whitespace to make checkpatch.pl happy.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
[sean: drop bogus changelog blurb about renaming functions]
Link: https://patch.msgid.link/20260420212004.3938325-3-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Use gva_t instead of vm_vaddr_t</title>
<updated>2026-04-20T21:54:16+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-04-20T21:19:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5567fc9dcd7ed46678cd68e6ca0662331d42f0ac'/>
<id>urn:sha1:5567fc9dcd7ed46678cd68e6ca0662331d42f0ac</id>
<content type='text'>
Replace all occurrences of vm_vaddr_t with gva_t to align with KVM code
and with the conversion helpers (e.g. addr_gva2hva()).

This commit was generated with the following command:

  git ls-files tools/testing/selftests/kvm | xargs sed -i 's/vm_vaddr_/gva_/g'

Then by manually adjusting whitespace to make checkpatch.pl happy, and
dropping renames of functions that allocate memory within a given VM.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
[sean: drop renames of allocator APIs]
Link: https://patch.msgid.link/20260420212004.3938325-2-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: KVM: selftests: Fix firmware counter read in sbi_pmu_test</title>
<updated>2026-03-27T14:32:11+00:00</updated>
<author>
<name>Jiakai Xu</name>
<email>xujiakai2025@iscas.ac.cn</email>
</author>
<published>2026-03-16T01:45:33+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=198c7ce9801abd63c44176c3f034577b887c0070'/>
<id>urn:sha1:198c7ce9801abd63c44176c3f034577b887c0070</id>
<content type='text'>
The current sbi_pmu_test attempts to read firmware counters without
configuring them first with SBI_EXT_PMU_COUNTER_CFG_MATCH.

Previously this did not fail because KVM incorrectly allowed the read
and accessed fw_event[] with an out-of-bounds index when the counter
was unconfigured. After fixing that bug, the read now correctly returns
SBI_ERR_INVALID_PARAM, causing the selftest to fail.

Update the test to configure a firmware event before reading the
counter. Also add a negative test to ensure that attempting to read an
unconfigured firmware counter fails gracefully.

Signed-off-by: Jiakai Xu &lt;xujiakai2025@iscas.ac.cn&gt;
Signed-off-by: Jiakai Xu &lt;jiakaiPeanut@gmail.com&gt;
Reviewed-by: Andrew Jones &lt;andrew.jones@oss.qualcomm.com&gt;
Reviewed-by: Nutty Liu &lt;nutty.liu@hotmail.com&gt;
Link: https://lore.kernel.org/r/20260316014533.2312254-3-xujiakai2025@iscas.ac.cn
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-riscv-6.20-1' of https://github.com/kvm-riscv/linux into HEAD</title>
<updated>2026-02-11T17:45:00+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2026-02-09T18:05:42+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=54f15ebfc61ee8499a97f2dbfc18b1b13fdcb524'/>
<id>urn:sha1:54f15ebfc61ee8499a97f2dbfc18b1b13fdcb524</id>
<content type='text'>
KVM/riscv changes for 6.20

- Fixes for issues discoverd by KVM API fuzzing in
  kvm_riscv_aia_imsic_has_attr(), kvm_riscv_aia_imsic_rw_attr(),
  and kvm_riscv_vcpu_aia_imsic_update()
- Allow Zalasr, Zilsd and Zclsd extensions for Guest/VM
- Add riscv vm satp modes in KVM selftests
- Transparent huge page support for G-stage
- Adjust the number of available guest irq files based on
  MMIO register sizes in DeviceTree or ACPI
</content>
</entry>
<entry>
<title>KVM: riscv: selftests: Add riscv vm satp modes</title>
<updated>2026-02-06T13:35:23+00:00</updated>
<author>
<name>Wu Fei</name>
<email>wu.fei9@sanechips.com.cn</email>
</author>
<published>2025-11-05T15:14:26+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=39ad809dd2579d9b7400bbc50a5b95d84527b75e'/>
<id>urn:sha1:39ad809dd2579d9b7400bbc50a5b95d84527b75e</id>
<content type='text'>
Current vm modes cannot represent riscv guest modes precisely, here add
all 9 combinations of P(56,40,41) x V(57,48,39). Also the default vm
mode is detected on runtime instead of hardcoded one, which might not be
supported on specific machine.

Signed-off-by: Wu Fei &lt;wu.fei9@sanechips.com.cn&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Nutty Liu &lt;nutty.liu@hotmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20251105151442.28767-1-wu.fei9@sanechips.com.cn
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Add a "struct kvm_mmu_arch arch" member to kvm_mmu</title>
<updated>2026-01-08T20:02:09+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-12-30T23:01:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3d0e7595e81017558189d2252ae9453c57ab3436'/>
<id>urn:sha1:3d0e7595e81017558189d2252ae9453c57ab3436</id>
<content type='text'>
Add an arch structure+field in "struct kvm_mmu" so that architectures can
track arch-specific information for a given MMU.

No functional change intended.

Reviewed-by: Yosry Ahmed &lt;yosry.ahmed@linux.dev&gt;
Link: https://patch.msgid.link/20251230230150.4150236-9-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: riscv: selftests: Add missing headers for new testcases</title>
<updated>2025-09-16T05:23:55+00:00</updated>
<author>
<name>Dong Yang</name>
<email>dayss1224@gmail.com</email>
</author>
<published>2025-09-01T07:35:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f4103c1171a4e661a61783e16073160be31b956f'/>
<id>urn:sha1:f4103c1171a4e661a61783e16073160be31b956f</id>
<content type='text'>
Add missing headers to fix the build for new RISC-V KVM selftests.

Signed-off-by: Quan Zhou &lt;zhouquan@iscas.ac.cn&gt;
Signed-off-by: Dong Yang &lt;dayss1224@gmail.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Link: https://lore.kernel.org/r/bfb66541918de68cd89b83bc3430af94bdc75a85.1756710918.git.dayss1224@gmail.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>KVM: riscv: selftests: Decode stval to identify exact exception type</title>
<updated>2025-05-21T04:04:37+00:00</updated>
<author>
<name>Atish Patra</name>
<email>atishp@rivosinc.com</email>
</author>
<published>2025-04-30T08:16:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3608b174ece5633dbd1f9afe37a48a2a9a0f0499'/>
<id>urn:sha1:3608b174ece5633dbd1f9afe37a48a2a9a0f0499</id>
<content type='text'>
Currently, the sbi_pmu_test continues if the exception type is illegal
instruction because access to hpmcounter will generate that. However
illegal instruction exception may occur due to the other reasons
which should result in test assertion.

Use the stval to decode the exact type of instructions and which csrs are
being accessed if it is csr access instructions. Assert in all cases
except if it is a csr access instructions that access valid PMU related
registers.

Take this opportunity to remove the CSR_CYCLEH reference as the test is
compiled for RV64 only.

Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Signed-off-by: Atish Patra &lt;atishp@rivosinc.com&gt;
Link: https://lore.kernel.org/r/20250430-kvm_selftest_improve-v3-2-eea270ff080b@rivosinc.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
