]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: KVM: Fix guest page fault within HLV* instructions
authorFangyu Yu <fangyu.yu@linux.alibaba.com>
Fri, 21 Nov 2025 13:35:43 +0000 (21:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:12 +0000 (14:03 +0100)
commit1fa7e6e78bd6ce61c00d749532639b9b4e20795b
tree20a0e34cedf3240349a659fa4f70412e320404a9
parent469b0b8ce08818f3e4f01d2fa8d0dadeab501e1f
RISC-V: KVM: Fix guest page fault within HLV* instructions

[ Upstream commit 974555d6e417974e63444266e495a06d06c23af5 ]

When executing HLV* instructions at the HS mode, a guest page fault
may occur when a g-stage page table migration between triggering the
virtual instruction exception and executing the HLV* instruction.

This may be a corner case, and one simpler way to handle this is to
re-execute the instruction where the virtual  instruction exception
occurred, and the guest page fault will be automatically handled.

Fixes: b91f0e4cb8a3 ("RISC-V: KVM: Factor-out instruction emulation into separate sources")
Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20251121133543.46822-1-fangyu.yu@linux.alibaba.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kvm/vcpu_insn.c