Page MenuHomeFreeBSD

D61943.1795887992.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61943.1795887992.diff

diff --git a/sys/amd64/vmm/intel/vmx_nested.c b/sys/amd64/vmm/intel/vmx_nested.c
--- a/sys/amd64/vmm/intel/vmx_nested.c
+++ b/sys/amd64/vmm/intel/vmx_nested.c
@@ -190,6 +190,8 @@
/* The secondary controls that turn instructions on for L2. */
#define PROCBASED2_L1_INSNS \
(PROCBASED2_ENABLE_RDTSCP | PROCBASED2_ENABLE_INVPCID)
+/* The secondary controls for VM exits that only L1 asks for. */
+#define PROCBASED2_L1_EXITS PROCBASED2_DESC_TABLE_EXITING
#define VM_EXIT_L1_MUST VM_EXIT_HOST_LMA
#define VM_EXIT_L1_MAY \
(VM_EXIT_SAVE_DEBUG_CONTROLS | VM_EXIT_ACKNOWLEDGE_INTERRUPT | \
@@ -561,7 +563,8 @@
*/
proc_may = PROCBASED_L1_MAY | PROCBASED_SECONDARY_CONTROLS;
proc2 = PROCBASED2_ENABLE_EPT | ((PROCBASED2_UNRESTRICTED_GUEST |
- PROCBASED2_L1_INSNS) & (rdmsr(MSR_VMX_PROCBASED_CTLS2) >> 32));
+ PROCBASED2_L1_INSNS | PROCBASED2_L1_EXITS) &
+ (rdmsr(MSR_VMX_PROCBASED_CTLS2) >> 32));
cap = VMX_EPT_CAP;
if (((rdmsr(MSR_VMX_PROCBASED_CTLS2) >> 32) &
PROCBASED2_ENABLE_VPID) != 0) {
@@ -2158,12 +2161,13 @@
/*
* RDTSCP, RDPID and INVPCID raise #UD in L2 unless L1 has turned
* them on. L1 sees them in CPUID, and a hypervisor shows its guest
- * what it sees. The VM exits that they can cause are L1's.
+ * what it sees. The VM exits that they can cause are L1's, and so
+ * are the ones for the descriptor-table registers.
*/
if ((V12(nested, VMCS_PRI_PROC_BASED_CTLS) &
PROCBASED_SECONDARY_CONTROLS) != 0)
proc2 |= V12(nested, VMCS_SEC_PROC_BASED_CTLS) &
- PROCBASED2_L1_INSNS;
+ (PROCBASED2_L1_INSNS | PROCBASED2_L1_EXITS);
vmcs_write(VMCS_SEC_PROC_BASED_CTLS, proc2);
/* L2 runs on EPT02 if L1 uses EPT for it, and on L1's memory if not. */
vmcs_write(VMCS_EPTP, nested->ept_active ? nested->ept->eptp :

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 28, 5:46 PM (9 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42023602
Default Alt Text
D61943.1795887992.diff (1 KB)

Event Timeline