cryptospore / rpms / qemu-kvm

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