Skip to content

Commit 2e7be16

Browse files
committed
RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs
The SBI specification clearly states that SBI HFENCE calls should return SBI_ERR_NOT_SUPPORTED when one of the target hart doesn’t support hypervisor extension (aka nested virtualization in-case of KVM RISC-V). Fixes: c7fa3c4 ("RISC-V: KVM: Treat SBI HFENCE calls as NOPs") Reviewed-by: Atish Patra <[email protected]> Signed-off-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
1 parent 6aba0cb commit 2e7be16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/kvm/vcpu_sbi_replace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ static int kvm_sbi_ext_rfence_handler(struct kvm_vcpu *vcpu, struct kvm_run *run
127127
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
128128
/*
129129
* Until nested virtualization is implemented, the
130-
* SBI HFENCE calls should be treated as NOPs
130+
* SBI HFENCE calls should return not supported
131+
* hence fallthrough.
131132
*/
132-
break;
133133
default:
134134
retdata->err_val = SBI_ERR_NOT_SUPPORTED;
135135
}

0 commit comments

Comments
 (0)