]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: KVM: Fix the size parameter check in SBI SFENCE calls
authorAnup Patel <apatel@ventanamicro.com>
Thu, 5 Jun 2025 06:14:46 +0000 (11:44 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:41 +0000 (11:07 +0100)
commit8a8b342332e27280e48d0f7013d70b4e688947af
tree17d0ef3b87813b79bcba7fcca77eeb1994ba3b96
parentfe399aa5a4f4df229979283aa3494be4fce41ed2
RISC-V: KVM: Fix the size parameter check in SBI SFENCE calls

[ Upstream commit 6aba0cb5bba6141158d5449f2cf53187b7f755f9 ]

As-per the SBI specification, an SBI remote fence operation applies
to the entire address space if either:
1) start_addr and size are both 0
2) size is equal to 2^XLEN-1

>From the above, only #1 is checked by SBI SFENCE calls so fix the
size parameter check in SBI SFENCE calls to cover #2 as well.

Fixes: 13acfec2dbcc ("RISC-V: KVM: Add remote HFENCE functions based on VCPU requests")
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20250605061458.196003-2-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kvm/vcpu_sbi_replace.c