[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6udca7kfrwy6gzads46r2eczyaapiav6h37y5e4oqxsdpl6j7h@oj5x5qr6d5jw>
Date: Tue, 23 Dec 2025 23:47:37 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 10/16] KVM: selftests: Reuse virt mapping functions
for nested EPTs
On Tue, Dec 23, 2025 at 03:14:28PM -0800, Sean Christopherson wrote:
> On Thu, Nov 27, 2025, Yosry Ahmed wrote:
> > + /*
> > + * EPTs do not have 'present' or 'user' bits, instead bit 0 is the
> > + * 'readable' bit. In some cases, EPTs can be execute-only and an entry
> > + * is present but not readable. However, for the purposes of testing we
> > + * assume 'present' == 'user' == 'readable' for simplicity.
> > + */
> > + pte_masks = (struct pte_masks){
> > + .present = BIT_ULL(0),
> > + .user = BIT_ULL(0),
> > + .writable = BIT_ULL(1),
> > + .x = BIT_ULL(2),
> > + .accessed = BIT_ULL(5),
> > + .dirty = BIT_ULL(6),
>
> Almost forgot, the Accessed and Dirty bits are wrong. They are bits 8 and 9
> respectively, not 5 and 6. Amusingly (well, it's amusing *now*, it wasn't so
> amusing at the time), I found that out when I couldn't get KVM to create a writable
> SPTE on a read fault in the nested dirty log test :-)
Instead of being a reasonable person and own up to my mistake, I will
blame Intel for putting the bits there to begin with :P
(But seriously, sorry for such a dumb mistake)
Powered by blists - more mailing lists