Re: [PATCH 10/54] KVM: x86/mmu: Replace EPT shadow page shenanigans with simpler check

From: Sean Christopherson
Date: Wed Jun 23 2021 - 12:54:42 EST


On Wed, Jun 23, 2021, Paolo Bonzini wrote:
> On 23/06/21 18:17, Sean Christopherson wrote:
> > > What the commit message doesn't say is, did we miss this
> > > opportunity all along, or has there been a change since commit
> > > 47c42e6b4192 ("KVM: x86: fix handling of role.cr4_pae and rename it
> > > to 'gpte_size'", 2019-03-28) that allows this?
> >
> > The code was wrong from the initial "unsync" commit. The 4-byte vs.
> > 8-byte check papered over the real bug, which was that the roles were
> > not checked for compabitility. I suspect that the bug only
> > manisfested as an observable problem when the GPTE sizes mismatched,
> > thus the PAE check was added.
>
> I meant that we really never needed is_ept_sp, and you could have used the
> simpler check already at the time you introduced gpte_is_8_bytes. But anyway
> I think we're in agreement.

Ah, yes, I was too clever :-/