aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorYaozu Dong <eddie.dong@intel.com>2007-04-25 02:17:25 -0400
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:30 -0400
commitd6c69ee9a24b307ce94e55ebfba6208a830c9ecb (patch)
tree6e3d10f96412932e4e8d3b7cbbc1c0c85189ad6f /drivers/kvm
parent4d56c8a787aefb2e3fc4ac4be966db96c14d1ad8 (diff)
KVM: MMU: Avoid heavy ASSERT at non debug mode.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/mmu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index c814394a966d..8ccf84e3fda8 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -52,11 +52,15 @@ static void kvm_mmu_audit(struct kvm_vcpu *vcpu, const char *msg) {}
52static int dbg = 1; 52static int dbg = 1;
53#endif 53#endif
54 54
55#ifndef MMU_DEBUG
56#define ASSERT(x) do { } while (0)
57#else
55#define ASSERT(x) \ 58#define ASSERT(x) \
56 if (!(x)) { \ 59 if (!(x)) { \
57 printk(KERN_WARNING "assertion failed %s:%d: %s\n", \ 60 printk(KERN_WARNING "assertion failed %s:%d: %s\n", \
58 __FILE__, __LINE__, #x); \ 61 __FILE__, __LINE__, #x); \
59 } 62 }
63#endif
60 64
61#define PT64_PT_BITS 9 65#define PT64_PT_BITS 9
62#define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS) 66#define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS)
@@ -434,6 +438,7 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
434 } 438 }
435} 439}
436 440
441#ifdef MMU_DEBUG
437static int is_empty_shadow_page(hpa_t page_hpa) 442static int is_empty_shadow_page(hpa_t page_hpa)
438{ 443{
439 u64 *pos; 444 u64 *pos;
@@ -448,6 +453,7 @@ static int is_empty_shadow_page(hpa_t page_hpa)
448 } 453 }
449 return 1; 454 return 1;
450} 455}
456#endif
451 457
452static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa) 458static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa)
453{ 459{