aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/kvm_host.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-05-15 06:51:35 -0400
committerAvi Kivity <avi@qumranet.com>2008-07-20 05:40:50 -0400
commit1b7fcd3263e5f12dba43d27b64e1578bec070c28 (patch)
tree7f8d9679404f0b46803c6b1cf926235d170606ee /include/asm-x86/kvm_host.h
parent7682f2d0dd3ff5bd2756eac018a5b4e7e30ef16c (diff)
KVM: MMU: Fix false flooding when a pte points to page table
The KVM MMU tries to detect when a speculative pte update is not actually used by demand fault, by checking the accessed bit of the shadow pte. If the shadow pte has not been accessed, we deem that page table flooded and remove the shadow page table, allowing further pte updates to proceed without emulation. However, if the pte itself points at a page table and only used for write operations, the accessed bit will never be set since all access will happen through the emulator. This is exactly what happens with kscand on old (2.4.x) HIGHMEM kernels. The kernel points a kmap_atomic() pte at a page table, and then proceeds with read-modify-write operations to look at the dirty and accessed bits. We get a false flood trigger on the kmap ptes, which results in the mmu spending all its time setting up and tearing down shadows. Fix by setting the shadow accessed bit on emulated accesses. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/asm-x86/kvm_host.h')
-rw-r--r--include/asm-x86/kvm_host.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 844f2a89afbc..c2d066e185f4 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -243,6 +243,7 @@ struct kvm_vcpu_arch {
243 gfn_t last_pt_write_gfn; 243 gfn_t last_pt_write_gfn;
244 int last_pt_write_count; 244 int last_pt_write_count;
245 u64 *last_pte_updated; 245 u64 *last_pte_updated;
246 gfn_t last_pte_gfn;
246 247
247 struct { 248 struct {
248 gfn_t gfn; /* presumed gfn during guest pte update */ 249 gfn_t gfn; /* presumed gfn during guest pte update */