Advertisement
Guest User

Untitled

a guest
Nov 21st, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.74 KB | None | 0 0
  1. @@ -17,6 +17,7 @@
  2.   */
  3.  
  4.  #include <linux/kvm_host.h>
  5. +#include <linux/printk.h>
  6.  #include <asm/mtrr.h>
  7.  
  8.  #include "cpuid.h"
  9. @@ -647,8 +648,10 @@
  10.          * If two or more variable memory ranges match and one of
  11.          * the memory types is UC, the UC memory type used.
  12.          */
  13. -       if (curr_type == MTRR_TYPE_UNCACHABLE)
  14. +       if (curr_type == MTRR_TYPE_UNCACHABLE) {
  15. +           printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, MTRR_TYPE_UNCACHABLE);
  16.             return MTRR_TYPE_UNCACHABLE;
  17. +       }
  18.  
  19.         /*
  20.          * If two or more variable memory ranges match and the
  21. @@ -666,15 +669,22 @@
  22.          */
  23.  
  24.         /* We use WB for this undefined behavior. :( */
  25. +       printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, MTRR_TYPE_WRBACK);
  26.         return MTRR_TYPE_WRBACK;
  27.     }
  28.  
  29. -   if (iter.mtrr_disabled)
  30. -       return mtrr_disabled_type();
  31. +   if (iter.mtrr_disabled) {
  32. +       int dbg_ret_val = mtrr_disabled_type();
  33. +       printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, dbg_ret_val);
  34. +       return dbg_ret_val;
  35. +   }
  36.  
  37.     /* not contained in any MTRRs. */
  38. -   if (type == -1)
  39. -       return mtrr_default_type(mtrr_state);
  40. +   if (type == -1) {
  41. +       int dbg_ret_val = mtrr_default_type(mtrr_state);
  42. +       printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, dbg_ret_val);
  43. +       return dbg_ret_val;
  44. +   }
  45.  
  46.     /*
  47.      * We just check one page, partially covered by MTRRs is
  48. @@ -682,6 +692,7 @@
  49.      */
  50.     WARN_ON(iter.partial_map);
  51.  
  52. +   printk(KERN_INFO "kvm_mtrr_get_guest_memory_type: cpu=%d, vcpu=%d, ret=%x", vcpu->cpu, vcpu->vcpu_id, type);
  53.     return type;
  54.  }
  55.  EXPORT_SYMBOL_GPL(kvm_mtrr_get_guest_memory_type);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement