[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJhGHyAOyR6yGdyxsKydt_+HboGjxc-psbbSCqsrBo4WgUgQsQ@mail.gmail.com>
Date: Wed, 5 Jan 2022 11:11:33 +0800
From: Lai Jiangshan <jiangshanlai@...il.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Lai Jiangshan <laijs@...ux.alibaba.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC PATCH 5/6] KVM: X86: Alloc pae_root shadow page
On Wed, Jan 5, 2022 at 5:54 AM Sean Christopherson <seanjc@...gle.com> wrote:
> >
> > default_pae_pdpte is needed because the cpu expect PAE pdptes are
> > present when VMenter.
>
> That's incorrect. Neither Intel nor AMD require PDPTEs to be present. Not present
> is perfectly ok, present with reserved bits is what's not allowed.
>
> Intel SDM:
> A VM entry that checks the validity of the PDPTEs uses the same checks that are
> used when CR3 is loaded with MOV to CR3 when PAE paging is in use[7]. If MOV to CR3
> would cause a general-protection exception due to the PDPTEs that would be loaded
> (e.g., because a reserved bit is set), the VM entry fails.
>
> 7. This implies that (1) bits 11:9 in each PDPTE are ignored; and (2) if bit 0
> (present) is clear in one of the PDPTEs, bits 63:1 of that PDPTE are ignored.
But in practice, the VM entry fails if the present bit is not set in
the PDPTE for
the linear address being accessed (when EPT enabled at least). The host kvm
complains and dumps the vmcs state.
Setting a default pdpte is the simplest way to solve it.
Powered by blists - more mailing lists