]> err.no Git - linux-2.6/commitdiff
x86: don't print a warning when MTRR are blank and running in KVM
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 21 Feb 2008 14:50:14 +0000 (15:50 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 26 Feb 2008 11:55:57 +0000 (12:55 +0100)
Inside a KVM virtual machine the MTRRs are usually blank. This confuses Linux
and causes a warning message at boot. This patch removes that warning message
when running Linux as a KVM guest.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/mtrr/main.c

index c8fda3eb3d7e38a7ca36d1e685aa97f36ece3ef0..be83336fddba9c6c3629bbe1748aa42480a6e707 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/kvm_para.h>
 #include "mtrr.h"
 
 u32 num_var_ranges = 0;
@@ -689,8 +690,11 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 
        /* kvm/qemu doesn't have mtrr set right, don't trim them all */
        if (!highest_pfn) {
-               printk(KERN_WARNING "WARNING: strange, CPU MTRRs all blank?\n");
-               WARN_ON(1);
+               if (!kvm_para_available()) {
+                       printk(KERN_WARNING
+                               "WARNING: strange, CPU MTRRs all blank?\n");
+                       WARN_ON(1);
+               }
                return 0;
        }