diff options
| author | Anup Patel <apatel@ventanamicro.com> | 2025-06-05 11:44:47 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-27 11:11:45 +0100 |
| commit | ca1f9cc89ca9421dbd724512a5e5521d3a501140 (patch) | |
| tree | fc46b84846115c01d84a13fc32f87f3d606e66d8 | |
| parent | ee85e957f6d748ff4d2dd63401e81a94d1503671 (diff) | |
| download | linux-ca1f9cc89ca9421dbd724512a5e5521d3a501140.tar.gz linux-ca1f9cc89ca9421dbd724512a5e5521d3a501140.tar.bz2 linux-ca1f9cc89ca9421dbd724512a5e5521d3a501140.zip | |
RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs
[ Upstream commit 2e7be162996640bbe3b6da694cc064c511b8a5d9 ]
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: c7fa3c48de86 ("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>
| -rw-r--r-- | arch/riscv/kvm/vcpu_sbi_replace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/kvm/vcpu_sbi_replace.c b/arch/riscv/kvm/vcpu_sbi_replace.c index 9752d2ffff68..b17fad091bab 100644 --- a/arch/riscv/kvm/vcpu_sbi_replace.c +++ b/arch/riscv/kvm/vcpu_sbi_replace.c @@ -127,9 +127,9 @@ static int kvm_sbi_ext_rfence_handler(struct kvm_vcpu *vcpu, struct kvm_run *run case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID: /* * Until nested virtualization is implemented, the - * SBI HFENCE calls should be treated as NOPs + * SBI HFENCE calls should return not supported + * hence fallthrough. */ - break; default: retdata->err_val = SBI_ERR_NOT_SUPPORTED; } |
