On Fri, Feb 10, 2023, Vipin Sharma wrote: > @@ -1677,8 +1670,13 @@ bool kvm_tdp_mmu_clear_dirty_slot(struct kvm *kvm, > static void clear_dirty_pt_masked(struct kvm *kvm, struct kvm_mmu_page *root, > gfn_t gfn, unsigned long mask, bool wrprot) > { > + /* > + * Either all SPTEs in TDP MMU will need write protection or none. This > + * contract will not be modified for TDP MMU pages. > + */ > + u64 clear_bit = (wrprot || !kvm_ad_enabled()) ? PT_WRITABLE_MASK : > + shadow_dirty_mask; Switching from spte_ad_need_write_protect() to kvm_ad_enabled() belongs in a separate. In the unlikely event that the above assertion/contracts is invalid, then any issues should bisect to the switch, not to a much more complex patch. I'll make that happen when applying.