Re: [PATCH 0/2] KVM: x86/mmu: Use LOCK CMPXCHG to clear Accessed bits

From: Sean Christopherson

Date: Wed Jul 29 2026 - 09:56:33 EST


On Wed, Jul 29, 2026, Kai Huang wrote:
> On Mon, 2026-07-27 at 17:22 -0700, Sean Christopherson wrote:
> > I initially was planning on tweaking the FROZEN_SPTE value to make it ok to
> > use LOCK AND on Accessed bits, but AFAICT there's no meaningful downside to
> > using CMPXCHG.
>
> Maybe do both, e.g., still remove the A-bit from FROZEN_SPTE? AFAICT there's no
> good reason to keep the A-bit in FROZEN_SPTE.

Hmm, I'm leaning "no".

Once aging uses CMPXCHG, the A-bit isn't any more or less likely to be corrupted
than any other bits. And arguably, using the A-bit is "safer", because (a) it's
got the same bit position on EPT and everything else, and (b) spuriously setting
or clearing the bit is more likely to be benign.