Skip to content

Commit 2a673ac

Browse files
avpatelgregkh
authored andcommitted
RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs
[ Upstream commit 2e7be16 ] 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 <atishp@rivosinc.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Link: https://lore.kernel.org/r/20250605061458.196003-3-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e20f0f4 commit 2a673ac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)