thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-target-i386-add-VMX-features-to-named-CPU-models.patch

Pablo Greco e6a3ae
From a958a54a1072e201d209fd54e3fd0b55a331c5da Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
Date: Fri, 22 Nov 2019 11:53:47 +0000
Pablo Greco e6a3ae
Subject: [PATCH 14/16] target/i386: add VMX features to named CPU models
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
Message-id: <20191122115348.25000-15-pbonzini@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 92613
Pablo Greco e6a3ae
O-Subject: [RHEL8.2/rhel qemu-kvm PATCH 14/15] target/i386: add VMX features to named CPU models
Pablo Greco e6a3ae
Bugzilla: 1689270
Pablo Greco e6a3ae
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
This allows using "-cpu Haswell,+vmx", which we did not really want to
Pablo Greco e6a3ae
support in QEMU but was produced by Libvirt when using the "host-model"
Pablo Greco e6a3ae
CPU model.  Without this patch, no VMX feature is _actually_ supported
Pablo Greco e6a3ae
(only the basic instruction set extensions are) and KVM fails to load
Pablo Greco e6a3ae
in the guest.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
This was produced from the output of scripts/kvm/vmxcap using the following
Pablo Greco e6a3ae
very ugly Python script:
Pablo Greco e6a3ae
Pablo Greco e6a3ae
    bits = {
Pablo Greco e6a3ae
            'INS/OUTS instruction information': ['FEAT_VMX_BASIC', 'MSR_VMX_BASIC_INS_OUTS'],
Pablo Greco e6a3ae
            'IA32_VMX_TRUE_*_CTLS support': ['FEAT_VMX_BASIC', 'MSR_VMX_BASIC_TRUE_CTLS'],
Pablo Greco e6a3ae
            'External interrupt exiting': ['FEAT_VMX_PINBASED_CTLS', 'VMX_PIN_BASED_EXT_INTR_MASK'],
Pablo Greco e6a3ae
            'NMI exiting': ['FEAT_VMX_PINBASED_CTLS', 'VMX_PIN_BASED_NMI_EXITING'],
Pablo Greco e6a3ae
            'Virtual NMIs': ['FEAT_VMX_PINBASED_CTLS', 'VMX_PIN_BASED_VIRTUAL_NMIS'],
Pablo Greco e6a3ae
            'Activate VMX-preemption timer': ['FEAT_VMX_PINBASED_CTLS', 'VMX_PIN_BASED_VMX_PREEMPTION_TIMER'],
Pablo Greco e6a3ae
            'Process posted interrupts': ['FEAT_VMX_PINBASED_CTLS', 'VMX_PIN_BASED_POSTED_INTR'],
Pablo Greco e6a3ae
            'Interrupt window exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_VIRTUAL_INTR_PENDING'],
Pablo Greco e6a3ae
            'Use TSC offsetting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_USE_TSC_OFFSETING'],
Pablo Greco e6a3ae
            'HLT exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_HLT_EXITING'],
Pablo Greco e6a3ae
            'INVLPG exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_INVLPG_EXITING'],
Pablo Greco e6a3ae
            'MWAIT exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_MWAIT_EXITING'],
Pablo Greco e6a3ae
            'RDPMC exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_RDPMC_EXITING'],
Pablo Greco e6a3ae
            'RDTSC exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_RDTSC_EXITING'],
Pablo Greco e6a3ae
            'CR3-load exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_CR3_LOAD_EXITING'],
Pablo Greco e6a3ae
            'CR3-store exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_CR3_STORE_EXITING'],
Pablo Greco e6a3ae
            'CR8-load exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_CR8_LOAD_EXITING'],
Pablo Greco e6a3ae
            'CR8-store exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_CR8_STORE_EXITING'],
Pablo Greco e6a3ae
            'Use TPR shadow': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_TPR_SHADOW'],
Pablo Greco e6a3ae
            'NMI-window exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_VIRTUAL_NMI_PENDING'],
Pablo Greco e6a3ae
            'MOV-DR exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_MOV_DR_EXITING'],
Pablo Greco e6a3ae
            'Unconditional I/O exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_UNCOND_IO_EXITING'],
Pablo Greco e6a3ae
            'Use I/O bitmaps': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_USE_IO_BITMAPS'],
Pablo Greco e6a3ae
            'Monitor trap flag': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_MONITOR_TRAP_FLAG'],
Pablo Greco e6a3ae
            'Use MSR bitmaps': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_USE_MSR_BITMAPS'],
Pablo Greco e6a3ae
            'MONITOR exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_MONITOR_EXITING'],
Pablo Greco e6a3ae
            'PAUSE exiting': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_PAUSE_EXITING'],
Pablo Greco e6a3ae
            'Activate secondary control': ['FEAT_VMX_PROCBASED_CTLS', 'VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS'],
Pablo Greco e6a3ae
            'Virtualize APIC accesses': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES'],
Pablo Greco e6a3ae
            'Enable EPT': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_ENABLE_EPT'],
Pablo Greco e6a3ae
            'Descriptor-table exiting': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_DESC'],
Pablo Greco e6a3ae
            'Enable RDTSCP': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_RDTSCP'],
Pablo Greco e6a3ae
            'Virtualize x2APIC mode': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE'],
Pablo Greco e6a3ae
            'Enable VPID': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_ENABLE_VPID'],
Pablo Greco e6a3ae
            'WBINVD exiting': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_WBINVD_EXITING'],
Pablo Greco e6a3ae
            'Unrestricted guest': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST'],
Pablo Greco e6a3ae
            'APIC register emulation': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT'],
Pablo Greco e6a3ae
            'Virtual interrupt delivery': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY'],
Pablo Greco e6a3ae
            'PAUSE-loop exiting': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_PAUSE_LOOP_EXITING'],
Pablo Greco e6a3ae
            'RDRAND exiting': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_RDRAND_EXITING'],
Pablo Greco e6a3ae
            'Enable INVPCID': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_ENABLE_INVPCID'],
Pablo Greco e6a3ae
            'Enable VM functions': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_ENABLE_VMFUNC'],
Pablo Greco e6a3ae
            'VMCS shadowing': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_SHADOW_VMCS'],
Pablo Greco e6a3ae
            'RDSEED exiting': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_RDSEED_EXITING'],
Pablo Greco e6a3ae
            'Enable PML': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_ENABLE_PML'],
Pablo Greco e6a3ae
            'Enable XSAVES/XRSTORS': ['FEAT_VMX_SECONDARY_CTLS', 'VMX_SECONDARY_EXEC_XSAVES'],
Pablo Greco e6a3ae
            'Save debug controls': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_SAVE_DEBUG_CONTROLS'],
Pablo Greco e6a3ae
            'Load IA32_PERF_GLOBAL_CTRL': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL'],
Pablo Greco e6a3ae
            'Acknowledge interrupt on exit': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_ACK_INTR_ON_EXIT'],
Pablo Greco e6a3ae
            'Save IA32_PAT': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_SAVE_IA32_PAT'],
Pablo Greco e6a3ae
            'Load IA32_PAT': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_LOAD_IA32_PAT'],
Pablo Greco e6a3ae
            'Save IA32_EFER': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_SAVE_IA32_EFER'],
Pablo Greco e6a3ae
            'Load IA32_EFER': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_LOAD_IA32_EFER'],
Pablo Greco e6a3ae
            'Save VMX-preemption timer value': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER'],
Pablo Greco e6a3ae
            'Clear IA32_BNDCFGS': ['FEAT_VMX_EXIT_CTLS', 'VMX_VM_EXIT_CLEAR_BNDCFGS'],
Pablo Greco e6a3ae
            'Load debug controls': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS'],
Pablo Greco e6a3ae
            'IA-32e mode guest': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_IA32E_MODE'],
Pablo Greco e6a3ae
            'Load IA32_PERF_GLOBAL_CTRL': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL'],
Pablo Greco e6a3ae
            'Load IA32_PAT': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_LOAD_IA32_PAT'],
Pablo Greco e6a3ae
            'Load IA32_EFER': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_LOAD_IA32_EFER'],
Pablo Greco e6a3ae
            'Load IA32_BNDCFGS': ['FEAT_VMX_ENTRY_CTLS', 'VMX_VM_ENTRY_LOAD_BNDCFGS'],
Pablo Greco e6a3ae
            'Store EFER.LMA into IA-32e mode guest control': ['FEAT_VMX_MISC', 'MSR_VMX_MISC_STORE_LMA'],
Pablo Greco e6a3ae
            'HLT activity state': ['FEAT_VMX_MISC', 'MSR_VMX_MISC_ACTIVITY_HLT'],
Pablo Greco e6a3ae
            'VMWRITE to VM-exit information fields': ['FEAT_VMX_MISC', 'MSR_VMX_MISC_VMWRITE_VMEXIT'],
Pablo Greco e6a3ae
            'Inject event with insn length=0': ['FEAT_VMX_MISC', 'MSR_VMX_MISC_ZERO_LEN_INJECT'],
Pablo Greco e6a3ae
            'Execute-only EPT translations': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_EXECONLY'],
Pablo Greco e6a3ae
            'Page-walk length 4': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_PAGE_WALK_LENGTH_4'],
Pablo Greco e6a3ae
            'Paging-structure memory type WB': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_WB'],
Pablo Greco e6a3ae
            '2MB EPT pages': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_2MB | MSR_VMX_EPT_1GB'],
Pablo Greco e6a3ae
            'INVEPT supported': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVEPT'],
Pablo Greco e6a3ae
            'EPT accessed and dirty flags': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_AD_BITS'],
Pablo Greco e6a3ae
            'Single-context INVEPT': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT'],
Pablo Greco e6a3ae
            'All-context INVEPT': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVEPT_ALL_CONTEXT'],
Pablo Greco e6a3ae
            'INVVPID supported': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVVPID'],
Pablo Greco e6a3ae
            'Individual-address INVVPID': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVVPID_SINGLE_ADDR'],
Pablo Greco e6a3ae
            'Single-context INVVPID': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT'],
Pablo Greco e6a3ae
            'All-context INVVPID': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVVPID_ALL_CONTEXT'],
Pablo Greco e6a3ae
            'Single-context-retaining-globals INVVPID': ['FEAT_VMX_EPT_VPID_CAPS', 'MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS'],
Pablo Greco e6a3ae
            'EPTP Switching': ['FEAT_VMX_VMFUNC', 'MSR_VMX_VMFUNC_EPT_SWITCHING']
Pablo Greco e6a3ae
    }
Pablo Greco e6a3ae
Pablo Greco e6a3ae
    import sys
Pablo Greco e6a3ae
    import textwrap
Pablo Greco e6a3ae
Pablo Greco e6a3ae
    out = {}
Pablo Greco e6a3ae
    for l in sys.stdin.readlines():
Pablo Greco e6a3ae
        l = l.rstrip()
Pablo Greco e6a3ae
        if l.endswith('!!'):
Pablo Greco e6a3ae
            l = l[:-2].rstrip()
Pablo Greco e6a3ae
        if l.startswith('    ') and (l.endswith('default') or l.endswith('yes')):
Pablo Greco e6a3ae
            l = l[4:]
Pablo Greco e6a3ae
            for key, value in bits.items():
Pablo Greco e6a3ae
                if l.startswith(key):
Pablo Greco e6a3ae
                    ctl, bit = value
Pablo Greco e6a3ae
                    if ctl in out:
Pablo Greco e6a3ae
                        out[ctl] = out[ctl] + ' | '
Pablo Greco e6a3ae
                    else:
Pablo Greco e6a3ae
                        out[ctl] = '    [%s] = ' % ctl
Pablo Greco e6a3ae
                    out[ctl] = out[ctl] + bit
Pablo Greco e6a3ae
Pablo Greco e6a3ae
    for x in sorted(out.keys()):
Pablo Greco e6a3ae
        print("\n         ".join(textwrap.wrap(out[x] + ",")))
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Note that the script has a bug in that some keys apply to both VM entry
Pablo Greco e6a3ae
and VM exit controls ("load IA32_PERF_GLOBAL_CTRL", "load IA32_EFER",
Pablo Greco e6a3ae
"load IA32_PAT".  Those have to be fixed by hand.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 0723cc8a5558c94388db75ae1f4991314914edd3)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RHEL: no Denverton and Snowridge
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 target/i386/cpu.c | 617 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Pablo Greco e6a3ae
 1 file changed, 617 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
Pablo Greco e6a3ae
index 9074a2e..36c9252 100644
Pablo Greco e6a3ae
--- a/target/i386/cpu.c
Pablo Greco e6a3ae
+++ b/target/i386/cpu.c
Pablo Greco e6a3ae
@@ -1689,6 +1689,34 @@ static CPUCaches epyc_cache_info = {
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
 };
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+/* The following VMX features are not supported by KVM and are left out in the
Pablo Greco e6a3ae
+ * CPU definitions:
Pablo Greco e6a3ae
+ *
Pablo Greco e6a3ae
+ *  Dual-monitor support (all processors)
Pablo Greco e6a3ae
+ *  Entry to SMM
Pablo Greco e6a3ae
+ *  Deactivate dual-monitor treatment
Pablo Greco e6a3ae
+ *  Number of CR3-target values
Pablo Greco e6a3ae
+ *  Shutdown activity state
Pablo Greco e6a3ae
+ *  Wait-for-SIPI activity state
Pablo Greco e6a3ae
+ *  PAUSE-loop exiting (Westmere and newer)
Pablo Greco e6a3ae
+ *  EPT-violation #VE (Broadwell and newer)
Pablo Greco e6a3ae
+ *  Inject event with insn length=0 (Skylake and newer)
Pablo Greco e6a3ae
+ *  Conceal non-root operation from PT
Pablo Greco e6a3ae
+ *  Conceal VM exits from PT
Pablo Greco e6a3ae
+ *  Conceal VM entries from PT
Pablo Greco e6a3ae
+ *  Enable ENCLS exiting
Pablo Greco e6a3ae
+ *  Mode-based execute control (XS/XU)
Pablo Greco e6a3ae
+ s  TSC scaling (Skylake Server and newer)
Pablo Greco e6a3ae
+ *  GPA translation for PT (IceLake and newer)
Pablo Greco e6a3ae
+ *  User wait and pause
Pablo Greco e6a3ae
+ *  ENCLV exiting
Pablo Greco e6a3ae
+ *  Load IA32_RTIT_CTL
Pablo Greco e6a3ae
+ *  Clear IA32_RTIT_CTL
Pablo Greco e6a3ae
+ *  Advanced VM-exit information for EPT violations
Pablo Greco e6a3ae
+ *  Sub-page write permissions
Pablo Greco e6a3ae
+ *  PT in VMX operation
Pablo Greco e6a3ae
+ */
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
 static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
     {
Pablo Greco e6a3ae
         /* qemu64 is the default CPU model for all *-rhel7.* machine-types.
Pablo Greco e6a3ae
@@ -1769,6 +1797,24 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             CPUID_EXT3_LAHF_LM,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -1796,6 +1842,20 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
                     CPUID_EXT3_OSVW, CPUID_EXT3_IBS, CPUID_EXT3_SVM */
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             0,
Pablo Greco e6a3ae
+        /* VMX features from Cedar Mill/Prescott */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Common KVM processor"
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -1827,6 +1887,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT_SSE3,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             0,
Pablo Greco e6a3ae
+        /* VMX features from Yonah */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MOV_DR_EXITING | VMX_CPU_BASED_UNCOND_IO_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_IO_BITMAPS | VMX_CPU_BASED_MONITOR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_PAUSE_EXITING | VMX_CPU_BASED_USE_MSR_BITMAPS,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Common 32-bit KVM processor"
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -1848,6 +1921,18 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT_SSE3 | CPUID_EXT_MONITOR,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_EDX] =
Pablo Greco e6a3ae
             CPUID_EXT2_NX,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MOV_DR_EXITING | VMX_CPU_BASED_UNCOND_IO_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_IO_BITMAPS | VMX_CPU_BASED_MONITOR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_PAUSE_EXITING | VMX_CPU_BASED_USE_MSR_BITMAPS,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Genuine Intel(R) CPU           T2600  @ 2.16GHz",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -1977,6 +2062,24 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             CPUID_EXT3_LAHF_LM,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2000,6 +2103,27 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             CPUID_EXT3_LAHF_LM,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] = VMX_VM_EXIT_ACK_INTR_ON_EXIT |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2023,6 +2147,46 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
Pablo Greco e6a3ae
         .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
             CPUID_EXT3_LAHF_LM,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core i7 9xx (Nehalem Class Core i7)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2074,6 +2238,47 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_EXT3_LAHF_LM,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2133,6 +2338,47 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XSAVEOPT,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Xeon E312xx (Sandy Bridge)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2200,6 +2446,50 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XSAVEOPT,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Xeon E3-12xx v2 (Ivy Bridge)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2347,6 +2637,52 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XSAVEOPT,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core Processor (Haswell)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2502,6 +2838,53 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XSAVEOPT,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core Processor (Broadwell)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2587,6 +2970,51 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core Processor (Skylake)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2682,6 +3110,54 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Xeon Processor (Skylake)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2785,6 +3261,54 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Xeon Processor (Cascadelake)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2840,6 +3364,51 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Core Processor (Icelake)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
@@ -2898,6 +3467,54 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
             CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
         .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
             CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
Pablo Greco e6a3ae
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
Pablo Greco e6a3ae
+             MSR_VMX_BASIC_TRUE_CTLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
Pablo Greco e6a3ae
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
Pablo Greco e6a3ae
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_EXIT_CTLS] =
Pablo Greco e6a3ae
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Pablo Greco e6a3ae
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
Pablo Greco e6a3ae
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
Pablo Greco e6a3ae
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
Pablo Greco e6a3ae
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_SECONDARY_CTLS] =
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
Pablo Greco e6a3ae
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
Pablo Greco e6a3ae
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
Pablo Greco e6a3ae
         .xlevel = 0x80000008,
Pablo Greco e6a3ae
         .model_id = "Intel Xeon Processor (Icelake)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae