[PATCH 2/2] avoid mtrr warning message when running as VMware guest

From: Yan Li
Date: Sun Sep 07 2008 - 20:21:35 EST


This patch depends on VMware detection.

Signed-off-by: Yan Li <elliot.li.tech@xxxxxxxxx>
---
arch/x86/kernel/cpu/mtrr/main.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index b117d7f..7e2bd23 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -45,6 +45,7 @@
#include <asm/processor.h>
#include <asm/msr.h>
#include <asm/kvm_para.h>
+#include <asm/vmware.h>
#include "mtrr.h"

u32 num_var_ranges = 0;
@@ -1496,8 +1497,8 @@ 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) {
- WARN(!kvm_para_available(), KERN_WARNING
- "WARNING: strange, CPU MTRRs all blank?\n");
+ WARN(!(kvm_para_available() || (is_vmware_guest())),
+ KERN_WARNING "WARNING: strange, CPU MTRRs all blank?\n");
return 0;
}

--
1.5.6.3


--
Li, Yan

"Everything that is really great and inspiring is created by the
individual who can labor in freedom."
- Albert Einstein, in Out of My Later Years (1950)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/