Skip to content

Commit

Permalink
KVM: MMU: Avoid heavy ASSERT at non debug mode.
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Yaozu Dong authored and Avi Kivity committed May 3, 2007
1 parent 4d56c8a commit d6c69ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit d6c69ee

Please sign in to comment.