]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: emulate accessed bit for EPT
authorRik van Riel <riel@redhat.com>
Wed, 3 Feb 2010 21:11:03 +0000 (16:11 -0500)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:08 +0000 (12:36 -0300)
commitac9fd46e4c9982c4a2986e3e7ede1f7704c20b56
treeeda5c9c5be2f2f11d820899515a4923d22467e8c
parentfacaae1e7db3cd9d093f111c370ff189049dcd71
KVM: VMX: emulate accessed bit for EPT

Currently KVM pretends that pages with EPT mappings never got
accessed.  This has some side effects in the VM, like swapping
out actively used guest pages and needlessly breaking up actively
used hugepages.

We can avoid those very costly side effects by emulating the
accessed bit for EPT PTEs, which should only be slightly costly
because pages pass through page_referenced infrequently.

TLB flushing is taken care of by kvm_mmu_notifier_clear_flush_young().

This seems to help prevent KVM guests from being swapped out when
they should not on my system.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c