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

Yan Li
2008-09-08T00:21:34Z

This patch depends on VMware detection.

Signed-off-by: Yan Li <elliot.li.tech@gmail.com>
---
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)