RISC-V: KVM: Add SBI STA info to vcpu_arch
authorAndrew Jones <ajones@ventanamicro.com>
Wed, 20 Dec 2023 16:00:19 +0000 (17:00 +0100)
committerAnup Patel <anup@brainfault.org>
Sat, 30 Dec 2023 05:56:26 +0000 (11:26 +0530)
commit38b3390ee4880140b6245fe3273fe9ce53f65bde
tree66c6a64af72cdecd051cf7b5bb5d17c582ef278c
parent2a1f6bf079700f0f9d8045ab77b302aeb4d12c06
RISC-V: KVM: Add SBI STA info to vcpu_arch

KVM's implementation of SBI STA needs to track the address of each
VCPU's steal-time shared memory region as well as the amount of
stolen time. Add a structure to vcpu_arch to contain this state
and make sure that the address is always set to INVALID_GPA on
vcpu reset. And, of course, ensure KVM won't try to update steal-
time when the shared memory address is invalid.

Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_sbi_sta.c