RISC-V: KVM: Pass VMID as parameter to kvm_riscv_hfence_xyz() APIs
authorAnup Patel <apatel@ventanamicro.com>
Wed, 18 Jun 2025 11:35:32 +0000 (17:05 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 28 Jul 2025 16:57:32 +0000 (22:27 +0530)
commit1f6d0eee54f7ed498a5e4ab3e12ea81bdac86b89
tree6a1f1d8057bcae35ee7a206e1fd001ef6a8feaec
parentdd82e35638d67f4f459eb5324b722295c0ae3da7
RISC-V: KVM: Pass VMID as parameter to kvm_riscv_hfence_xyz() APIs

Currently, all kvm_riscv_hfence_xyz() APIs assume VMID to be the
host VMID of the Guest/VM which resticts use of these APIs only
for host TLB maintenance. Let's allow passing VMID as a parameter
to all kvm_riscv_hfence_xyz() APIs so that they can be re-used
for nested virtualization related TLB maintenance.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Link: https://lore.kernel.org/r/20250618113532.471448-13-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_tlb.h
arch/riscv/kvm/gstage.c
arch/riscv/kvm/tlb.c
arch/riscv/kvm/vcpu_sbi_replace.c
arch/riscv/kvm/vcpu_sbi_v01.c