KVM: riscv: selftests: Add guest helper to get vcpu id
authorHaibo Xu <haibo1.xu@intel.com>
Mon, 22 Jan 2024 09:58:40 +0000 (17:58 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 6 Mar 2024 15:23:23 +0000 (20:53 +0530)
commit1e979288c9b50a1eef1c5fa2fa93936012a0ed6f
tree5aa3b1ac094b086a1b069f06441ab1a5d37382af
parent38f680c25ece49c1f8ff55ee78dca0ee4e1793a6
KVM: riscv: selftests: Add guest helper to get vcpu id

Add guest_get_vcpuid() helper to simplify accessing to per-cpu
private data. The sscratch CSR was used to store the vcpu id.

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/aarch64/processor.h
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/riscv/processor.c