Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @@ -17,6 +17,7 @@
- */
- #include <linux/kvm_host.h>
- +#include <linux/printk.h>
- #include <asm/mtrr.h>
- #include "cpuid.h"
- @@ -647,8 +648,10 @@
- * If two or more variable memory ranges match and one of
- * the memory types is UC, the UC memory type used.
- */
- - if (curr_type == MTRR_TYPE_UNCACHABLE)
- + if (curr_type == MTRR_TYPE_UNCACHABLE) {
- + printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, MTRR_TYPE_UNCACHABLE);
- return MTRR_TYPE_UNCACHABLE;
- + }
- /*
- * If two or more variable memory ranges match and the
- @@ -666,15 +669,22 @@
- */
- /* We use WB for this undefined behavior. :( */
- + printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, MTRR_TYPE_WRBACK);
- return MTRR_TYPE_WRBACK;
- }
- - if (iter.mtrr_disabled)
- - return mtrr_disabled_type();
- + if (iter.mtrr_disabled) {
- + int dbg_ret_val = mtrr_disabled_type();
- + printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, dbg_ret_val);
- + return dbg_ret_val;
- + }
- /* not contained in any MTRRs. */
- - if (type == -1)
- - return mtrr_default_type(mtrr_state);
- + if (type == -1) {
- + int dbg_ret_val = mtrr_default_type(mtrr_state);
- + printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, dbg_ret_val);
- + return dbg_ret_val;
- + }
- /*
- * We just check one page, partially covered by MTRRs is
- @@ -682,6 +692,7 @@
- */
- WARN_ON(iter.partial_map);
- + printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, type);
- return type;
- }
- EXPORT_SYMBOL_GPL(kvm_mtrr_get_guest_memory_type);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement