vmx: Add and use constants for PML and TSC Scaling
authorFergus Simpson <afergs@google.com>
Tue, 29 Nov 2016 01:35:39 +0000 (17:35 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 29 Nov 2016 16:08:48 +0000 (11:08 -0500)
This adds definitions for secondary processor-based VM-Execution
controls "Enable PML" and "TSC Scaling".

The need for attempting to unset Enable PML was discovered on a
Broadwell-DE system and TSC Scaling was previously an undocumented
constant.

Change-Id: If4eec1f43da084d6f1c3764c31f7075a9f5605d3
Signed-off-by: Fergus Simpson <afergs@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/ros/vmx.h
kern/arch/x86/vmm/intel/vmx.c

index e93a63e..c1650d1 100644 (file)
 #define SECONDARY_EXEC_ENABLE_VMFUNC           0x00002000
 #define SECONDARY_EXEC_SHADOW_VMCS              0x00004000
 #define SECONDARY_EXEC_RDSEED_EXITING           0x00010000
+#define SECONDARY_EXEC_ENABLE_PML               0x00020000
 #define SECONDARY_EPT_VE                        0x00040000
 #define SECONDARY_ENABLE_XSAV_RESTORE           0x00100000
+#define SECONDARY_EXEC_TSC_SCALING              0x02000000
 
 #define PIN_BASED_EXT_INTR_MASK                 0x00000001
 #define PIN_BASED_NMI_EXITING                   0x00000008
index 2608e82..6ba7212 100644 (file)
@@ -569,8 +569,7 @@ static const struct vmxec cb2ec = {
 
        .try_set_1 = SECONDARY_EXEC_RDTSCP,
 
-       // mystery bit.
-       .try_set_0 = 0x2000000
+       .try_set_0 = SECONDARY_EXEC_TSC_SCALING | SECONDARY_EXEC_ENABLE_PML
 
 };