KVM: MMU: Avoid heavy ASSERT at non debug mode.
authorYaozu Dong <eddie.dong@intel.com>
Wed, 25 Apr 2007 06:17:25 +0000 (14:17 +0800)
committerAvi Kivity <avi@qumranet.com>
Thu, 3 May 2007 07:52:30 +0000 (10:52 +0300)
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/mmu.c

index c814394a966d20cbb365dbf76d54de5c01afb484..8ccf84e3fda87486bf30c749c26d9edc8eaa093a 100644 (file)
@@ -52,11 +52,15 @@ static void kvm_mmu_audit(struct kvm_vcpu *vcpu, const char *msg) {}
 static int dbg = 1;
 #endif
 
+#ifndef MMU_DEBUG
+#define ASSERT(x) do { } while (0)
+#else
 #define ASSERT(x)                                                      \
        if (!(x)) {                                                     \
                printk(KERN_WARNING "assertion failed %s:%d: %s\n",     \
                       __FILE__, __LINE__, #x);                         \
        }
+#endif
 
 #define PT64_PT_BITS 9
 #define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS)
@@ -434,6 +438,7 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
        }
 }
 
+#ifdef MMU_DEBUG
 static int is_empty_shadow_page(hpa_t page_hpa)
 {
        u64 *pos;
@@ -448,6 +453,7 @@ static int is_empty_shadow_page(hpa_t page_hpa)
                }
        return 1;
 }
+#endif
 
 static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa)
 {