KVM: MMU: Fix is_empty_shadow_page() check
authorAvi Kivity <avi@qumranet.com>
Tue, 20 May 2008 13:21:13 +0000 (16:21 +0300)
committerAvi Kivity <avi@qumranet.com>
Fri, 6 Jun 2008 18:36:33 +0000 (21:36 +0300)
The check is only looking at one of two possible empty ptes.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/mmu.c

index c2fd6a4a58c38815e97d1d15c66dbb4b51f30122..ee3f53098f0c738e59bc1eb3fefe890d3e528eeb 100644 (file)
@@ -658,7 +658,7 @@ static int is_empty_shadow_page(u64 *spt)
        u64 *end;
 
        for (pos = spt, end = pos + PAGE_SIZE / sizeof(u64); pos != end; pos++)
-               if (*pos != shadow_trap_nonpresent_pte) {
+               if (is_shadow_present_pte(*pos)) {
                        printk(KERN_ERR "%s: %p %llx\n", __func__,
                               pos, *pos);
                        return 0;