Blame SOURCES/kvm-target-i386-Add-missed-features-to-Cooperlake-CPU-mo.patch

902636
From 1ffeb321151b3878bcbb2229639456c0677305f5 Mon Sep 17 00:00:00 2001
902636
From: "plai@redhat.com" <plai@redhat.com>
902636
Date: Fri, 15 May 2020 18:02:43 +0100
902636
Subject: [PATCH 17/17] target/i386: Add missed features to Cooperlake CPU
902636
 model
902636
902636
RH-Author: plai@redhat.com
902636
Message-id: <20200515180243.17488-5-plai@redhat.com>
902636
Patchwork-id: 96611
902636
O-Subject: [RHEL8.2.1 AV qemu-kvm PATCH 4/4] target/i386: Add missed features to Cooperlake CPU model
902636
Bugzilla: 1769912
902636
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
902636
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
902636
902636
From: Xiaoyao Li <xiaoyao.li@intel.com>
902636
902636
It lacks VMX features and two security feature bits (disclosed recently) in
902636
MSR_IA32_ARCH_CAPABILITIES in current Cooperlake CPU model, so add them.
902636
902636
Fixes: 22a866b6166d ("i386: Add new CPU model Cooperlake")
902636
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
902636
Message-Id: <20191225063018.20038-3-xiaoyao.li@intel.com>
902636
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
902636
(cherry picked from commit 2dea9d9ca4ea7e9afe83d0b4153b21a16987e866)
902636
Signed-off-by: Paul Lai <plai@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 target/i386/cpu.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
902636
 1 file changed, 50 insertions(+), 1 deletion(-)
902636
902636
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
902636
index 996a74f..b763adc 100644
902636
--- a/target/i386/cpu.c
902636
+++ b/target/i386/cpu.c
902636
@@ -3202,7 +3202,8 @@ static X86CPUDefinition builtin_x86_defs[] = {
902636
             CPUID_7_0_EDX_SPEC_CTRL_SSBD | CPUID_7_0_EDX_ARCH_CAPABILITIES,
902636
         .features[FEAT_ARCH_CAPABILITIES] =
902636
             MSR_ARCH_CAP_RDCL_NO | MSR_ARCH_CAP_IBRS_ALL |
902636
-            MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY | MSR_ARCH_CAP_MDS_NO,
902636
+            MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY | MSR_ARCH_CAP_MDS_NO |
902636
+            MSR_ARCH_CAP_PSCHANGE_MC_NO | MSR_ARCH_CAP_TAA_NO,
902636
         .features[FEAT_7_1_EAX] =
902636
             CPUID_7_1_EAX_AVX512_BF16,
902636
         /*
902636
@@ -3217,6 +3218,54 @@ static X86CPUDefinition builtin_x86_defs[] = {
902636
             CPUID_XSAVE_XGETBV1,
902636
         .features[FEAT_6_EAX] =
902636
             CPUID_6_EAX_ARAT,
902636
+        /* Missing: Mode-based execute control (XS/XU), processor tracing, TSC scaling */
902636
+        .features[FEAT_VMX_BASIC] = MSR_VMX_BASIC_INS_OUTS |
902636
+             MSR_VMX_BASIC_TRUE_CTLS,
902636
+        .features[FEAT_VMX_ENTRY_CTLS] = VMX_VM_ENTRY_IA32E_MODE |
902636
+             VMX_VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VMX_VM_ENTRY_LOAD_IA32_PAT |
902636
+             VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS | VMX_VM_ENTRY_LOAD_IA32_EFER,
902636
+        .features[FEAT_VMX_EPT_VPID_CAPS] = MSR_VMX_EPT_EXECONLY |
902636
+             MSR_VMX_EPT_PAGE_WALK_LENGTH_4 | MSR_VMX_EPT_WB | MSR_VMX_EPT_2MB |
902636
+             MSR_VMX_EPT_1GB | MSR_VMX_EPT_INVEPT |
902636
+             MSR_VMX_EPT_INVEPT_SINGLE_CONTEXT | MSR_VMX_EPT_INVEPT_ALL_CONTEXT |
902636
+             MSR_VMX_EPT_INVVPID | MSR_VMX_EPT_INVVPID_SINGLE_ADDR |
902636
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT | MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
902636
+             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS | MSR_VMX_EPT_AD_BITS,
902636
+        .features[FEAT_VMX_EXIT_CTLS] =
902636
+             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_DEBUG_CONTROLS |
902636
+             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
902636
+             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_LOAD_IA32_EFER |
902636
+             VMX_VM_EXIT_SAVE_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
902636
+             VMX_VM_EXIT_SAVE_VMX_PREEMPTION_TIMER,
902636
+        .features[FEAT_VMX_MISC] = MSR_VMX_MISC_ACTIVITY_HLT |
902636
+             MSR_VMX_MISC_STORE_LMA | MSR_VMX_MISC_VMWRITE_VMEXIT,
902636
+        .features[FEAT_VMX_PINBASED_CTLS] = VMX_PIN_BASED_EXT_INTR_MASK |
902636
+             VMX_PIN_BASED_NMI_EXITING | VMX_PIN_BASED_VIRTUAL_NMIS |
902636
+             VMX_PIN_BASED_VMX_PREEMPTION_TIMER | VMX_PIN_BASED_POSTED_INTR,
902636
+        .features[FEAT_VMX_PROCBASED_CTLS] = VMX_CPU_BASED_VIRTUAL_INTR_PENDING |
902636
+             VMX_CPU_BASED_USE_TSC_OFFSETING | VMX_CPU_BASED_HLT_EXITING |
902636
+             VMX_CPU_BASED_INVLPG_EXITING | VMX_CPU_BASED_MWAIT_EXITING |
902636
+             VMX_CPU_BASED_RDPMC_EXITING | VMX_CPU_BASED_RDTSC_EXITING |
902636
+             VMX_CPU_BASED_CR8_LOAD_EXITING | VMX_CPU_BASED_CR8_STORE_EXITING |
902636
+             VMX_CPU_BASED_TPR_SHADOW | VMX_CPU_BASED_MOV_DR_EXITING |
902636
+             VMX_CPU_BASED_UNCOND_IO_EXITING | VMX_CPU_BASED_USE_IO_BITMAPS |
902636
+             VMX_CPU_BASED_MONITOR_EXITING | VMX_CPU_BASED_PAUSE_EXITING |
902636
+             VMX_CPU_BASED_VIRTUAL_NMI_PENDING | VMX_CPU_BASED_USE_MSR_BITMAPS |
902636
+             VMX_CPU_BASED_CR3_LOAD_EXITING | VMX_CPU_BASED_CR3_STORE_EXITING |
902636
+             VMX_CPU_BASED_MONITOR_TRAP_FLAG |
902636
+             VMX_CPU_BASED_ACTIVATE_SECONDARY_CONTROLS,
902636
+        .features[FEAT_VMX_SECONDARY_CTLS] =
902636
+             VMX_SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
902636
+             VMX_SECONDARY_EXEC_WBINVD_EXITING | VMX_SECONDARY_EXEC_ENABLE_EPT |
902636
+             VMX_SECONDARY_EXEC_DESC | VMX_SECONDARY_EXEC_RDTSCP |
902636
+             VMX_SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
902636
+             VMX_SECONDARY_EXEC_ENABLE_VPID | VMX_SECONDARY_EXEC_UNRESTRICTED_GUEST |
902636
+             VMX_SECONDARY_EXEC_APIC_REGISTER_VIRT |
902636
+             VMX_SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
902636
+             VMX_SECONDARY_EXEC_RDRAND_EXITING | VMX_SECONDARY_EXEC_ENABLE_INVPCID |
902636
+             VMX_SECONDARY_EXEC_ENABLE_VMFUNC | VMX_SECONDARY_EXEC_SHADOW_VMCS |
902636
+             VMX_SECONDARY_EXEC_RDSEED_EXITING | VMX_SECONDARY_EXEC_ENABLE_PML,
902636
+        .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
902636
         .xlevel = 0x80000008,
902636
         .model_id = "Intel Xeon Processor (Cooperlake)",
902636
     },
902636
-- 
902636
1.8.3.1
902636