cryptospore / rpms / qemu-kvm

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