RISC-V: KVM: Treat SBI HFENCE calls as NOPs
authorAnup Patel <apatel@ventanamicro.com>
Mon, 9 May 2022 05:13:46 +0000 (10:43 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 20 May 2022 03:39:06 +0000 (09:09 +0530)
We should treat SBI HFENCE calls as NOPs until nested virtualization
is supported by KVM RISC-V. This will help us test booting a hypervisor
under KVM RISC-V.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu_sbi_replace.c

index 0f217365c2875114ee98841aac4eb4440baddd3b..3c1dcd38358e34f7bca51a2fb90b9231e672f7f2 100644 (file)
@@ -117,7 +117,11 @@ static int kvm_sbi_ext_rfence_handler(struct kvm_vcpu *vcpu, struct kvm_run *run
        case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
        case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
        case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
-       /* TODO: implement for nested hypervisor case */
+               /*
+                * Until nested virtualization is implemented, the
+                * SBI HFENCE calls should be treated as NOPs
+                */
+               break;
        default:
                ret = -EOPNOTSUPP;
        }