From de78abe927de4ba98e16dad9669ee34696648c5f Mon Sep 17 00:00:00 2001 From: Hou Wenlong Date: Tue, 26 Mar 2024 16:03:48 +0800 Subject: [PATCH] KVM: x86/PVM: Fix wrong judgement in pvm_guest_allowed_va() Even though address 0 is typically not mapped by the guest, it should be allowed for the guest since it falls within the lower half address space. Signed-off-by: Hou Wenlong --- arch/x86/kvm/pvm/pvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/pvm/pvm.c b/arch/x86/kvm/pvm/pvm.c index e4b8f0108c3165..d76f731d0b0d2e 100644 --- a/arch/x86/kvm/pvm/pvm.c +++ b/arch/x86/kvm/pvm/pvm.c @@ -154,7 +154,7 @@ static __always_inline bool pvm_guest_allowed_va(struct kvm_vcpu *vcpu, u64 va) { struct vcpu_pvm *pvm = to_pvm(vcpu); - if ((s64)va > 0) + if ((s64)va >= 0) return true; if (pvm->l4_range_start <= va && va < pvm->l4_range_end) return true;