Blame SOURCES/kvm-i386-Add-new-model-of-Cascadelake-Server.patch

c461a1
From 4f73c145a24ba196d904234a1ea437af22c33240 Mon Sep 17 00:00:00 2001
c461a1
From: Eduardo Habkost <ehabkost@redhat.com>
c461a1
Date: Thu, 3 Oct 2019 22:12:15 +0200
c461a1
Subject: [PATCH 1/4] i386: Add new model of Cascadelake-Server
c461a1
c461a1
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
c461a1
Message-id: <20191003221217.8527-2-ehabkost@redhat.com>
c461a1
Patchwork-id: 90952
c461a1
O-Subject: [RHEL-7.8 qemu-kvm PATCH 1/3] i386: Add new model of Cascadelake-Server
c461a1
Bugzilla: 1638471
c461a1
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
c461a1
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
c461a1
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
c461a1
c461a1
From: Tao Xu <tao3.xu@intel.com>
c461a1
c461a1
New CPU models mostly inherit features from ancestor Skylake-Server,
c461a1
while addin new features: AVX512_VNNI, Intel PT.
c461a1
SSBD support for speculative execution
c461a1
side channel mitigations.
c461a1
c461a1
Note:
c461a1
c461a1
On Cascadelake, some capabilities (RDCL_NO, IBRS_ALL, RSBA,
c461a1
SKIP_L1DFL_VMENTRY and SSB_NO) are enumerated by MSR.
c461a1
These features rely on MSR based feature support patch.
c461a1
Will be added later after that patch's in.
c461a1
http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg00074.html
c461a1
c461a1
Backport notes:
c461a1
* Like we already did in Skylake-Server and EPYC, ARAT is
c461a1
  not present in the CPU model (RHEL7-3+ and RHEL-8 already have
c461a1
  arat=off in PC_COMPAT_RHEL7_2)
c461a1
c461a1
Signed-off-by: Tao Xu <tao3.xu@intel.com>
c461a1
Message-Id: <20180919031122.28487-2-tao3.xu@intel.com>
c461a1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
c461a1
(cherry picked from commit c7a88b52f62b30c04158eeb07f73e3f72221b6a8)
c461a1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
c461a1
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
c461a1
---
c461a1
 target-i386/cpu.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
c461a1
 1 file changed, 60 insertions(+)
c461a1
c461a1
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
c461a1
index f92cb62..5b988c9 100644
c461a1
--- a/target-i386/cpu.c
c461a1
+++ b/target-i386/cpu.c
c461a1
@@ -1496,6 +1496,66 @@ static x86_def_t builtin_x86_defs[] = {
c461a1
         .model_id = "Intel Xeon Processor (Skylake, IBRS)",
c461a1
     },
c461a1
     {
c461a1
+        .name = "Cascadelake-Server",
c461a1
+        .level = 0xd,
c461a1
+        .vendor = CPUID_VENDOR_INTEL,
c461a1
+        .family = 6,
c461a1
+        .model = 85,
c461a1
+        .stepping = 5,
c461a1
+        .features[FEAT_1_EDX] =
c461a1
+            CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
c461a1
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
c461a1
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
c461a1
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
c461a1
+            CPUID_DE | CPUID_FP87,
c461a1
+        .features[FEAT_1_ECX] =
c461a1
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
c461a1
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
c461a1
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
c461a1
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
c461a1
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
c461a1
+            CPUID_EXT_PCID | CPUID_EXT_F16C | CPUID_EXT_RDRAND,
c461a1
+        .features[FEAT_8000_0001_EDX] =
c461a1
+            CPUID_EXT2_LM | CPUID_EXT2_PDPE1GB | CPUID_EXT2_RDTSCP |
c461a1
+            CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
c461a1
+        .features[FEAT_8000_0001_ECX] =
c461a1
+            CPUID_EXT3_ABM | CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
c461a1
+        .features[FEAT_7_0_EBX] =
c461a1
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
c461a1
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
c461a1
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
c461a1
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
c461a1
+            CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
c461a1
+            CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
c461a1
+            CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
c461a1
+            CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
c461a1
+            CPUID_7_0_EBX_INTEL_PT,
c461a1
+        .features[FEAT_7_0_ECX] =
c461a1
+            CPUID_7_0_ECX_PKU | CPUID_7_0_ECX_OSPKE |
c461a1
+            CPUID_7_0_ECX_AVX512VNNI,
c461a1
+        .features[FEAT_7_0_EDX] =
c461a1
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
c461a1
+        /* Missing: XSAVES (not supported by some Linux versions,
c461a1
+                * including v4.1 to v4.12).
c461a1
+                * KVM doesn't yet expose any XSAVES state save component,
c461a1
+                * and the only one defined in Skylake (processor tracing)
c461a1
+                * probably will block migration anyway.
c461a1
+                */
c461a1
+        .features[FEAT_XSAVE] =
c461a1
+            CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
c461a1
+            CPUID_XSAVE_XGETBV1,
c461a1
+        /* Missing: ARAT. not available in the qemu-kvm-1.5.3 tree (and
c461a1
+         * disabled by compat code in pc-i440fx-rhel7.2.0 and older on
c461a1
+         * qemu-kvm-rhev)
c461a1
+         */
c461a1
+#if 0
c461a1
+        .features[FEAT_6_EAX] =
c461a1
+            CPUID_6_EAX_ARAT,
c461a1
+#endif
c461a1
+        .xlevel = 0x80000008,
c461a1
+        .model_id = "Intel Xeon Processor (Cascadelake)",
c461a1
+    },
c461a1
+    {
c461a1
         .name = "Opteron_G1",
c461a1
         .level = 5,
c461a1
         .vendor = CPUID_VENDOR_AMD,
c461a1
-- 
c461a1
1.8.3.1
c461a1