aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/viridian.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-07-17 08:49:08 +0200
committerJan Beulich <jbeulich@suse.com>2013-07-17 08:49:08 +0200
commit551b3c1227318a442c1c8fc121e63d7d36d5dd12 (patch)
tree778fc70ca27ea3c2a6933647de05d15afc1415b9 /xen/arch/x86/hvm/viridian.c
parent27815a123ad898bc4f6dd82c62b16188d6f8eef1 (diff)
downloadxen-551b3c1227318a442c1c8fc121e63d7d36d5dd12.tar.gz
xen-551b3c1227318a442c1c8fc121e63d7d36d5dd12.tar.bz2
xen-551b3c1227318a442c1c8fc121e63d7d36d5dd12.zip
Viridian: populate CPUID leaf 6
Properly reporting hardware features we use can only help Windows in making decisions towards its own performance tuning. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Yang Zhang <yang.z.zhang@intel.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/viridian.c')
-rw-r--r--xen/arch/x86/hvm/viridian.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index 46492cbb32..a20ed59e45 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -41,6 +41,11 @@
#define CPUID4A_MSR_BASED_APIC (1 << 3)
#define CPUID4A_RELAX_TIMER_INT (1 << 5)
+/* Viridian CPUID 4000006, Implementation HW features detected and in use. */
+#define CPUID6A_APIC_OVERLAY (1 << 0)
+#define CPUID6A_MSR_BITMAPS (1 << 1)
+#define CPUID6A_NESTED_PAGING (1 << 3)
+
int cpuid_viridian_leaves(unsigned int leaf, unsigned int *eax,
unsigned int *ebx, unsigned int *ecx,
unsigned int *edx)
@@ -92,6 +97,15 @@ int cpuid_viridian_leaves(unsigned int leaf, unsigned int *eax,
*eax |= CPUID4A_MSR_BASED_APIC;
*ebx = 2047; /* long spin count */
break;
+ case 6:
+ /* Detected and in use hardware features. */
+ if ( cpu_has_vmx_virtualize_apic_accesses )
+ *eax |= CPUID6A_APIC_OVERLAY;
+ if ( cpu_has_vmx_msr_bitmap || (read_efer() & EFER_SVME) )
+ *eax |= CPUID6A_MSR_BITMAPS;
+ if ( hap_enabled(d) )
+ *eax |= CPUID6A_NESTED_PAGING;
+ break;
}
return 1;