[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALzav=ft-kUHrKGPrc8C73=pYf7Na9iaAxtfaeV=PCmHJNimzQ@mail.gmail.com>
Date: Thu, 4 Aug 2022 16:43:48 -0700
From: David Matlack <dmatlack@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Isaku Yamahata <isaku.yamahata@...el.com>,
kvm list <kvm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Isaku Yamahata <isaku.yamahata@...il.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Erdem Aktas <erdemaktas@...gle.com>,
Sagi Shahar <sagis@...gle.com>
Subject: Re: [RFC PATCH v6 037/104] KVM: x86/mmu: Allow non-zero value for
non-present SPTE
On Thu, Aug 4, 2022 at 4:23 PM Sean Christopherson <seanjc@...gle.com> wrote:
> On Thu, Aug 04, 2022, David Matlack wrote:
> > On Thu, May 05, 2022 at 11:14:31AM -0700, isaku.yamahata@...el.com wrote:
> > > +#ifdef CONFIG_X86_64
> > > +#define SHADOW_NONPRESENT_VALUE BIT_ULL(63)
> > > +static_assert(!(SHADOW_NONPRESENT_VALUE & SPTE_MMU_PRESENT_MASK));
> > > +#else
> > > +#define SHADOW_NONPRESENT_VALUE 0ULL
> > > +#endif
> >
> > The terminology "shadow_nonpresent" implies it would be the opposite of
> > e.g. is_shadow_present_pte(), when in fact they are completely
> > different concepts.
>
> You can fight Paolo over that one :-) I agree it looks a bit odd when juxtaposed
> with is_shadow_present_pte(), but at the same time I agree with Paolo that
> SHADOW_INIT_VALUE is also funky.
>
> https://lore.kernel.org/all/9dfc44d6-6b20-e864-8d4f-09ab7d489b97@redhat.com
Ah ok, thanks for the context.
>
> > Also, this is a good opportunity to follow the same naming terminology
> > as REMOVED_SPTE in the TDP MMU.
> >
> > How about EMPTY_SPTE?
>
> No, because "empty" implies there's nothing there, and it very much matters that
> the SUPPRESS_VE bit is set for TDX.
Fair point. My other idea was INITIAL_SPTE but that's already covered
by Paolo's objection above :)
I'll change my vote to NONPRESENT_SPTE.
Powered by blists - more mailing lists