Skip to contentSkip to conversation

pv/pvh: disable MTRR feature on cpuid for Dom0

PATCH Superseded Roger Pau Monne 2 participants 3 messages Dec 12, 2013 – Dec 13, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pv/pvh: disable MTRR feature on cpuid for Dom0

MTRR is not available for PV/PVH Dom0, so prevent cpuid from reporting it as an available feature.

Cc George Dunlap <[email protected]>
Cc Mukesh Rathor <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Keir Fraser <[email protected]>
---
 xen/arch/x86/traps.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
xen/arch/x86/traps.c +1 -0
index 940bc33..73b58dc 100644
@@ -796,6 +796,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
+        __clear_bit(X86_FEATURE_MTRR, &d);
 
         __clear_bit(X86_FEATURE_DTES64 % 32, &c);
         __clear_bit(X86_FEATURE_MWAIT % 32, &c);
Signature · 7 lines
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

MTRR is not available for PV/PVH Dom0, so prevent cpuid from reporting it as an available feature.

Some misunderstanding perhaps? PV certainly has MTRR support for Dom0 - see XENPF_*_memtype.

xen/arch/x86/traps.c void pv_cpuid(struct cpu_user_regs *regs) · line 799

Quoted 7 lines
xen/arch/x86/traps.c +1 -0
@@ -796,6 +796,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
+        __clear_bit(X86_FEATURE_MTRR, &d);

Thus clearing this flag should be limited to PVH.

Jan

#2 lore raw
Quoted 6 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

MTRR is not available for PV/PVH Dom0, so prevent cpuid from reporting it as an available feature.

Some misunderstanding perhaps? PV certainly has MTRR support for Dom0 - see XENPF_*_memtype.

OK, my bad, I was looking for a PV implementation of struct mtrr_ops in the pvops kernel, but Linux pvops doesn't use MTRR at all, also none of the XENPF_*_memtype ops seem to be used.

Quoted 10 lines

xen/arch/x86/traps.c void pv_cpuid(struct cpu_user_regs *regs) · line 799

Quoted 8 lines
xen/arch/x86/traps.c +1 -0
@@ -796,6 +796,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
+        __clear_bit(X86_FEATURE_MTRR, &d);

Thus clearing this flag should be limited to PVH.

Will resend now with this fixed, thanks.

Roger.