public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 0/3] RISC-V: KVM: Validate SBI STA shmem alignment
@ 2026-03-03  1:08 Jiakai Xu
  2026-03-03  1:08 ` [PATCH v10 1/3] RISC-V: KVM: Validate SBI STA shmem alignment in kvm_sbi_ext_sta_set_reg() Jiakai Xu
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jiakai Xu @ 2026-03-03  1:08 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, kvm-riscv, linux-kselftest, kvm
  Cc: Alexandre Ghiti, Paolo Bonzini, Shuah Khan, Paul Walmsley,
	Palmer Dabbelt, Andrew Jones, Anup Patel, Atish Patra, Albert Ou,
	Jiakai Xu

This series fixes a missing validation in the RISC-V KVM SBI
steal-time accounting (STA) register handling.

Patch 1 validates the configured SBI STA shared memory GPA at
KVM_SET_ONE_REG, enforcing the 64-byte alignment requirement
defined by the SBI specification or allowing INVALID_GPA to explicitly
disable steal-time accounting. This prevents invalid userspace state
from reaching runtime code paths and avoids WARN_ON() triggers during
KVM_RUN.

Patch 2 refactors existing UAPI tests from steal_time_init() into
a dedicated check_steal_time_uapi() function for better code organization,
and adds an empty stub for RISC-V.

Patch 3 fills in the RISC-V stub with tests that verify KVM correctly
enforces the STA alignment requirements.

Jiakai Xu (3):
  RISC-V: KVM: Validate SBI STA shmem alignment in 
    kvm_sbi_ext_sta_set_reg()
  KVM: selftests: Refactor UAPI tests into dedicated function
  RISC-V: KVM: selftests: Add RISC-V SBI STA shmem alignment tests

 arch/riscv/kvm/vcpu_sbi_sta.c                 | 16 ++-
 .../selftests/kvm/include/kvm_util_types.h    |  2 +
 tools/testing/selftests/kvm/steal_time.c      | 98 ++++++++++++++++---
 3 files changed, 95 insertions(+), 21 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-05-01  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03  1:08 [PATCH v10 0/3] RISC-V: KVM: Validate SBI STA shmem alignment Jiakai Xu
2026-03-03  1:08 ` [PATCH v10 1/3] RISC-V: KVM: Validate SBI STA shmem alignment in kvm_sbi_ext_sta_set_reg() Jiakai Xu
2026-03-03  1:08 ` [PATCH v10 2/3] KVM: selftests: Refactor UAPI tests into dedicated function Jiakai Xu
2026-04-30 11:26   ` Mark Brown
2026-05-01  0:36     ` Jiakai Xu
2026-03-03  1:08 ` [PATCH v10 3/3] RISC-V: KVM: selftests: Add RISC-V SBI STA shmem alignment tests Jiakai Xu
2026-03-16  2:03 ` [PATCH v10 0/3] RISC-V: KVM: Validate SBI STA shmem alignment Jiakai Xu
2026-03-27 12:59 ` Anup Patel
2026-04-30  3:25 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox