]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RISC-V: KVM: selftests: Add RISC-V SBI STA shmem alignment tests
authorJiakai Xu <xujiakai2025@iscas.ac.cn>
Tue, 3 Mar 2026 01:08:59 +0000 (01:08 +0000)
committerAnup Patel <anup@brainfault.org>
Thu, 26 Mar 2026 15:51:03 +0000 (21:21 +0530)
commit7c61e7433b49ca948dc8cc2b70a20b3dbc36363d
tree9adc48ec74a0cdb930823004d0b16d2c6c7d0d5b
parent40351ed924dd30ded1b43c7333ce695a4a835f7b
RISC-V: KVM: selftests: Add RISC-V SBI STA shmem alignment tests

Add RISC-V KVM selftests to verify the SBI Steal-Time Accounting (STA)
shared memory alignment requirements.

The SBI specification requires the STA shared memory GPA to be 64-byte
aligned, or set to all-ones to explicitly disable steal-time accounting.
This test verifies that KVM enforces the expected behavior when
configuring the SBI STA shared memory via KVM_SET_ONE_REG.

Specifically, the test checks that:
- misaligned GPAs are rejected with -EINVAL
- 64-byte aligned GPAs are accepted
- all-ones GPA is accepted

Signed-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Signed-off-by: Jiakai Xu <jiakaiPeanut@gmail.com>
Reviewed-by: Andrew Jones <andrew.jones@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260303010859.1763177-4-xujiakai2025@iscas.ac.cn
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/kvm_util_types.h
tools/testing/selftests/kvm/steal_time.c