thebeanogamer / rpms / qemu-kvm

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