[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOLK0pzTzubAcgv3nd_G6pSbB48Xw-ANbCn7+wX0NE1ssDW2Vg@mail.gmail.com>
Date: Thu, 11 Oct 2018 20:07:36 +0800
From: Tianyu Lan <lantianyu1986@...il.com>
To: vkuznets@...hat.com
Cc: kvm <kvm@...r.kernel.org>, Paolo Bonzini <pbonzini@...hat.com>,
Radim Krcmar <rkrcmar@...hat.com>, kys@...rosoft.com,
haiyangz@...rosoft.com, sthemmin@...rosoft.com,
Michael.H.Kelley@...rosoft.com,
Tianyu Lan <Tianyu.Lan@...rosoft.com>,
"linux-kernel@...r kernel org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: vmx: hyper-v: don't pass EPT configuration info to vmx_hv_remote_flush_tlb()
On Thu, Oct 11, 2018 at 6:32 PM Vitaly Kuznetsov <vkuznets@...hat.com> wrote:
>
> I'm observing random crashes in multi-vCPU L2 guests running on KVM on
> Hyper-V. I bisected the issue to the commit 877ad952be3d ("KVM: vmx: Add
> tlb_remote_flush callback support"). Hyper-V TLFS states:
>
> "AddressSpace specifies an address space ID (an EPT PML4 table pointer)"
>
> So apparently, Hyper-V doesn't expect us to pass naked EPTP, only PML4
> pointer should be used. Strip off EPT configuration information before
> calling into vmx_hv_remote_flush_tlb().
Hi Vitaly:
: Thanks to fix this. Sorry, I didn't meet the issue..
I think we may just store EPT PML4 table pointer without EPT
configuration information
in the ept_pointer field for this case.
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 619307b3e6bb..e316058b41a6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5379,7 +5379,7 @@ static void vmx_set_cr3(struct kvm_vcpu *vcpu,
unsigned long cr3)
if (kvm_x86_ops->tlb_remote_flush) {
spin_lock(&to_kvm_vmx(kvm)->ept_pointer_lock);
- to_vmx(vcpu)->ept_pointer = eptp;
+ to_vmx(vcpu)->ept_pointer = cr3;
to_kvm_vmx(kvm)->ept_pointers_match
= EPT_POINTERS_CHECK;
spin_unlock(&to_kvm_vmx(kvm)->ept_pointer_lock);
>
> Fixes: 877ad952be3d ("KVM: vmx: Add tlb_remote_flush callback support")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> ---
> arch/x86/kvm/vmx.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 612fd17be635..e665aa7167cf 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -1572,8 +1572,12 @@ static int vmx_hv_remote_flush_tlb(struct kvm *kvm)
> goto out;
> }
>
> + /*
> + * FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE hypercall needs the address of the
> + * base of EPT PML4 table, strip off EPT configuration information.
> + */
> ret = hyperv_flush_guest_mapping(
> - to_vmx(kvm_get_vcpu(kvm, 0))->ept_pointer);
> + to_vmx(kvm_get_vcpu(kvm, 0))->ept_pointer & PAGE_MASK);
>
> out:
> spin_unlock(&to_kvm_vmx(kvm)->ept_pointer_lock);
> --
> 2.17.1
>
--
Best regards
Tianyu Lan
Powered by blists - more mailing lists