Re: [PATCH v8 03/11] KVM: x86/mmu: Factor out spte atomic bit clearing routine
From: James Houghton
Date: Mon Jan 27 2025 - 14:52:33 EST
On Fri, Jan 10, 2025 at 2:34 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Tue, Nov 05, 2024, James Houghton wrote:
> > This new function, tdp_mmu_clear_spte_bits_atomic(), will be used in a
> > follow-up patch to enable lockless Accessed and R/W/X bit clearing.
>
> This is a lie. tdp_mmu_clear_spte_bits_atomic() can only be used to clear the
> Accessed bit, clearing RWX bits for access-tracked SPTEs *must* be done with a
> CMPXCHG so that the original RWX protections are preserved.
I'm not sure why I wrote it like that. I've dropped the "and R/W/X" piece:
This new function, tdp_mmu_clear_spte_bits_atomic(), will be used in a
follow-up patch to enable lockless Accessed bit clearing.