Permalink
Browse files

or this instead

  • Loading branch information...
1 parent 31263da commit 69860a1ab149e33632b2c58f9e35ad0cbee9ee88 @cheat-engine committed Sep 1, 2016
Showing with 20 additions and 3 deletions.
  1. +19 −3 dbvm/vmm/vmmhelper.c
  2. +1 −0 dbvm/vmm/vmxcontrolstructures.h
View
@@ -2679,17 +2679,33 @@ void setupVMX(pcpuinfo currentcpuinfo)
{
//it has a secondary entry
//enable rdtscp
- sendstringf("Enabling rdtscp\n");
+ QWORD secondarycpu=0;
+
+
if ((IA32_VMX_SECONDARY_PROCBASED_CTLS >> 32) & SPBEF_ENABLE_RDTSCP) //can it enable rdtscp ?
- vmwrite(vm_execution_controls_cpu_secondary, SPBEF_ENABLE_RDTSCP); //enable rdtscp
+ {
+ sendstringf("Enabling rdtscp\n");
+ secondarycpu|=SPBEF_ENABLE_RDTSCP;
+ }
+
if ((IA32_VMX_SECONDARY_PROCBASED_CTLS >> 32) & SPBEF_ENABLE_XSAVES) //can it enable XSAVES ?
{
sendstringf("Enabling xsaves\n");
- vmwrite(vm_execution_controls_cpu_secondary, SPBEF_ENABLE_XSAVES); //enable XSAVES/XRSTORS
+ secondarycpu|=SPBEF_ENABLE_XSAVES;
}
+ if ((IA32_VMX_SECONDARY_PROCBASED_CTLS >> 32) & SPBEF_ENABLE_INVPCID) //can it enable INVPCID ?
+ {
+ sendstringf("Enabling INVPCID\n");
+ secondarycpu|=SPBEF_ENABLE_INVPCID;
+ }
+
+ vmwrite(vm_execution_controls_cpu_secondary, secondarycpu);
+
+
+
}
@@ -42,6 +42,7 @@
//secondary processor based vm-execution flags
#define SPBEF_ENABLE_RDTSCP (1<<3)
+#define SPBEF_ENABLE_INVPCID (1<<12)
#define SPBEF_ENABLE_XSAVES (1<<20)
//vm-exit controls

0 comments on commit 69860a1

Please sign in to comment.