902636
From cf62577aed781b2515ea97b9f42285c2f608a7bf Mon Sep 17 00:00:00 2001
902636
From: "plai@redhat.com" <plai@redhat.com>
902636
Date: Fri, 15 May 2020 18:02:42 +0100
902636
Subject: [PATCH 16/17] i386: Add new CPU model Cooperlake
902636
902636
RH-Author: plai@redhat.com
902636
Message-id: <20200515180243.17488-4-plai@redhat.com>
902636
Patchwork-id: 96608
902636
O-Subject: [RHEL8.2.1 AV qemu-kvm PATCH 3/4] i386: Add new CPU model Cooperlake
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: Cathy Zhang <cathy.zhang@intel.com>
902636
902636
Cooper Lake is intel's successor to Cascade Lake, the new
902636
CPU model inherits features from Cascadelake-Server, while
902636
add one platform associated new feature: AVX512_BF16. Meanwhile,
902636
add STIBP for speculative execution.
902636
902636
Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
902636
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
902636
Reviewed-by: Tao Xu <tao3.xu@intel.com>
902636
Message-Id: <1571729728-23284-4-git-send-email-cathy.zhang@intel.com>
902636
Reviewed-by: Bruce Rogers <brogers@suse.com>
902636
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
902636
(cherry picked from commit 22a866b6166db5caa4abaa6e656c2a431fa60726)
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 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
902636
 1 file changed, 60 insertions(+)
902636
902636
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
902636
index 0f0a2db..996a74f 100644
902636
--- a/target/i386/cpu.c
902636
+++ b/target/i386/cpu.c
902636
@@ -3161,6 +3161,66 @@ static X86CPUDefinition builtin_x86_defs[] = {
902636
         }
902636
     },
902636
     {
902636
+        .name = "Cooperlake",
902636
+        .level = 0xd,
902636
+        .vendor = CPUID_VENDOR_INTEL,
902636
+        .family = 6,
902636
+        .model = 85,
902636
+        .stepping = 10,
902636
+        .features[FEAT_1_EDX] =
902636
+            CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
902636
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
902636
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
902636
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
902636
+            CPUID_DE | CPUID_FP87,
902636
+        .features[FEAT_1_ECX] =
902636
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
902636
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
902636
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
902636
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
902636
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
902636
+            CPUID_EXT_PCID | CPUID_EXT_F16C | CPUID_EXT_RDRAND,
902636
+        .features[FEAT_8000_0001_EDX] =
902636
+            CPUID_EXT2_LM | CPUID_EXT2_PDPE1GB | CPUID_EXT2_RDTSCP |
902636
+            CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
902636
+        .features[FEAT_8000_0001_ECX] =
902636
+            CPUID_EXT3_ABM | CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
902636
+        .features[FEAT_7_0_EBX] =
902636
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
902636
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
902636
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
902636
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
902636
+            CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
902636
+            CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
902636
+            CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
902636
+            CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT,
902636
+        .features[FEAT_7_0_ECX] =
902636
+            CPUID_7_0_ECX_PKU |
902636
+            CPUID_7_0_ECX_AVX512VNNI,
902636
+        .features[FEAT_7_0_EDX] =
902636
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_STIBP |
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
+        .features[FEAT_7_1_EAX] =
902636
+            CPUID_7_1_EAX_AVX512_BF16,
902636
+        /*
902636
+         * Missing: XSAVES (not supported by some Linux versions,
902636
+         * including v4.1 to v4.12).
902636
+         * KVM doesn't yet expose any XSAVES state save component,
902636
+         * and the only one defined in Skylake (processor tracing)
902636
+         * probably will block migration anyway.
902636
+         */
902636
+        .features[FEAT_XSAVE] =
902636
+            CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
902636
+            CPUID_XSAVE_XGETBV1,
902636
+        .features[FEAT_6_EAX] =
902636
+            CPUID_6_EAX_ARAT,
902636
+        .xlevel = 0x80000008,
902636
+        .model_id = "Intel Xeon Processor (Cooperlake)",
902636
+    },
902636
+    {
902636
         .name = "Icelake-Client",
902636
         .level = 0xd,
902636
         .vendor = CPUID_VENDOR_INTEL,
902636
-- 
902636
1.8.3.1
902636