The kvm mmu synchronizes shadow ptes using the mmu lock, however the cpu
will happily ignore the lock when setting the accessed bit. This can cause
the accessed bit to be lost. Luckily this only results in incorrect page
selection for swap.
This patchset fixes the problem by atomically updating the spte when
needed while taking care of the accessed bit.
v2: fix incorrect code transformations in first patch
Avi Kivity (4):
KVM: MMU: Introduce drop_spte()
KVM: MMU: Move accessed/dirty bit checks from rmap_remove() to
drop_spte()
KVM: MMU: Atomically check for accessed bit when dropping an spte
KVM: MMU: Don't drop accessed bit while updating an spte
arch/x86/kvm/mmu.c | 87 ++++++++++++++++++++++++++++++++------------
arch/x86/kvm/paging_tmpl.h | 13 +++----
2 files changed, 69 insertions(+), 31 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html