[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57e68a47-42fb-4029-a46a-c81d1522f7ff@intel.com>
Date: Thu, 7 Mar 2024 13:50:00 +1300
From: "Huang, Kai" <kai.huang@...el.com>
To: Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini
<pbonzini@...hat.com>
CC: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Yan Zhao
<yan.y.zhao@...el.com>, Isaku Yamahata <isaku.yamahata@...el.com>, "Michael
Roth" <michael.roth@....com>, Yu Zhang <yu.c.zhang@...ux.intel.com>, Chao
Peng <chao.p.peng@...ux.intel.com>, Fuad Tabba <tabba@...gle.com>, David
Matlack <dmatlack@...gle.com>
Subject: Re: [PATCH 14/16] KVM: x86/mmu: Set kvm_page_fault.hva to
KVM_HVA_ERR_BAD for "no slot" faults
On 28/02/2024 3:41 pm, Sean Christopherson wrote:
> Explicitly set fault->hva to KVM_HVA_ERR_BAD when handling a "no slot"
> fault to ensure that KVM doesn't use a bogus virtual address, e.g. if
> there *was* a slot but it's unusable (APIC access page), or if there
> really was no slot, in which case fault->hva will be '0' (which is a
> legal address for x86).
>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
> arch/x86/kvm/mmu/mmu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index 4dee0999a66e..43f24a74571a 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -3325,6 +3325,7 @@ static int kvm_handle_noslot_fault(struct kvm_vcpu *vcpu,
> fault->slot = NULL;
> fault->pfn = KVM_PFN_NOSLOT;
> fault->map_writable = false;
> + fault->hva = KVM_HVA_ERR_BAD;
>
> /*
> * If MMIO caching is disabled, emulate immediately without
Not sure why this cannot be merged to the previous one?
Anyway,
Reviewed-by: Kai Huang <kai.huang@...el.com>
Powered by blists - more mailing lists