* [PATCH] x86info: mtrr.c return if MTRR registers are not accessible
@ 2009-05-30 13:08 Jaswinder Singh Rajput
2009-05-30 14:18 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-30 13:08 UTC (permalink / raw)
To: Dave Jones, Avi Kivity, KVM list
In some virtualization systems like KVM where MTRR registers
are not accessible output looks like :
MTRR registers:
MTRRcap (0xfe): MTRRphysBase0 (0x200): MTRRphysMask0 (0x201): MTRRphysBase1 (0x202): MTRRphysMask1 (0x203): MTRRphysBase2 (0x204): MTRRphysMask2 (0x205): MTRRphysBase3 (0x206): MTRRphysMask3 (0x207): MTRRphysBase4 (0x208): MTRRphysMask4 (0x209): MTRRphysBase5 (0x20a): MTRRphysMask5 (0x20b): MTRRphysBase6 (0x20c): MTRRphysMask6 (0x20d): MTRRphysBase7 (0x20e): MTRRphysMask7 (0x20f): MTRRfix64K_00000 (0x250): MTRRfix16K_80000 (0x258): MTRRfix16K_A0000 (0x259): MTRRfix4K_C8000 (0x269): MTRRfix4K_D0000 0x26a: MTRRfix4K_D8000 0x26b: MTRRfix4K_E0000 0x26c: MTRRfix4K_E8000 0x26d: MTRRfix4K_F0000 0x26e: MTRRfix4K_F8000 0x26f: MTRRdefType (0x2ff):
So better return for those cases.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
mtrr.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/mtrr.c b/mtrr.c
index 32b5959..b948f67 100644
--- a/mtrr.c
+++ b/mtrr.c
@@ -20,11 +20,19 @@ static void dump_mtrr(int cpu, int msr)
void dump_mtrrs(struct cpudata *cpu)
{
+ unsigned long long val = 0;
unsigned int i;
if (!(cpu->flags_edx & (X86_FEATURE_MTRR)))
return;
+ /*
+ * If MTRR registers are not accessible like in some
+ * virtualization systems then return
+ */
+ if (!read_msr(cpu->number, 0xfe, &val))
+ return;
+
printf("MTRR registers:\n");
printf("MTRRcap (0xfe): ");
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] x86info: mtrr.c return if MTRR registers are not accessible
2009-05-30 13:08 [PATCH] x86info: mtrr.c return if MTRR registers are not accessible Jaswinder Singh Rajput
@ 2009-05-30 14:18 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2009-05-30 14:18 UTC (permalink / raw)
To: Jaswinder Singh Rajput; +Cc: Avi Kivity, KVM list
On Sat, May 30, 2009 at 06:38:38PM +0530, Jaswinder Singh Rajput wrote:
>
> In some virtualization systems like KVM where MTRR registers
> are not accessible output looks like :
>
> MTRR registers:
> MTRRcap (0xfe): MTRRphysBase0 (0x200): MTRRphysMask0 (0x201): MTRRphysBase1 (0x202): MTRRphysMask1 (0x203): MTRRphysBase2 (0x204): MTRRphysMask2 (0x205): MTRRphysBase3 (0x206): MTRRphysMask3 (0x207): MTRRphysBase4 (0x208): MTRRphysMask4 (0x209): MTRRphysBase5 (0x20a): MTRRphysMask5 (0x20b): MTRRphysBase6 (0x20c): MTRRphysMask6 (0x20d): MTRRphysBase7 (0x20e): MTRRphysMask7 (0x20f): MTRRfix64K_00000 (0x250): MTRRfix16K_80000 (0x258): MTRRfix16K_A0000 (0x259): MTRRfix4K_C8000 (0x269): MTRRfix4K_D0000 0x26a: MTRRfix4K_D8000 0x26b: MTRRfix4K_E0000 0x26c: MTRRfix4K_E8000 0x26d: MTRRfix4K_F0000 0x26e: MTRRfix4K_F8000 0x26f: MTRRdefType (0x2ff):
>
> So better return for those cases.
>
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Thanks, applied.
Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-30 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-30 13:08 [PATCH] x86info: mtrr.c return if MTRR registers are not accessible Jaswinder Singh Rajput
2009-05-30 14:18 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox