yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-i386-Add-new-CPU-model-Icelake-Server-Client.patch

Pablo Greco e6a3ae
From 0a8e2990b83c805fc6cc2421950a938caa9ba8a5 Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: "plai@redhat.com" <plai@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 3 Apr 2019 15:54:29 +0100
Pablo Greco e6a3ae
Subject: [PATCH 05/10] i386: Add new CPU model Icelake-{Server, Client}
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: plai@redhat.com
Pablo Greco e6a3ae
Message-id: <1554306874-28796-6-git-send-email-plai@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85383
Pablo Greco e6a3ae
O-Subject: [RHEL8.1 qemu-kvm PATCH resend 05/10] i386: Add new CPU model Icelake-{Server, Client}
Pablo Greco e6a3ae
Bugzilla: 1561761
Pablo Greco e6a3ae
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Robert Hoo <robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
New CPU models mostly inherit features from ancestor Skylake, while addin new
Pablo Greco e6a3ae
features: UMIP, New Instructions ( PCONIFIG (server only), WBNOINVD,
Pablo Greco e6a3ae
AVX512_VBMI2, GFNI, AVX512_VNNI, VPCLMULQDQ, VAES, AVX512_BITALG),
Pablo Greco e6a3ae
Intel PT and 5-level paging (Server only). As well as
Pablo Greco e6a3ae
IA32_PRED_CMD, SSBD support for speculative execution
Pablo Greco e6a3ae
side channel mitigations.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Note:
Pablo Greco e6a3ae
For 5-level paging, Guest physical address width can be configured, with
Pablo Greco e6a3ae
parameter "phys-bits". Unless explicitly specified, we still use its default
Pablo Greco e6a3ae
value, even for Icelake-Server cpu model.
Pablo Greco e6a3ae
At present, hold on expose IA32_ARCH_CAPABILITIES to guest, as 1) This MSR
Pablo Greco e6a3ae
actually presents more than 1 'feature', maintainers are considering expanding current
Pablo Greco e6a3ae
features presentation of only CPUIDs to MSR bits; 2) a reasonable default value
Pablo Greco e6a3ae
for MSR_IA32_ARCH_CAPABILITIES needs to settled first. These 2 are actully
Pablo Greco e6a3ae
beyond Icelake CPU model itself but fundamental. So split these work apart
Pablo Greco e6a3ae
and do it later.
Pablo Greco e6a3ae
https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg00774.html
Pablo Greco e6a3ae
https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg00796.html
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Message-Id: <1530781798-183214-6-git-send-email-robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 8a11c62da9146dd89aee98947e6bd831e65a970d)
Pablo Greco e6a3ae
Signed-off-by: Paul Lai <plai@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Resovled Conflicts:
Pablo Greco e6a3ae
	target/i386/cpu.c
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 target/i386/cpu.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Pablo Greco e6a3ae
 1 file changed, 115 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
Pablo Greco e6a3ae
index 8b9a9f6..d86b744 100644
Pablo Greco e6a3ae
--- a/target/i386/cpu.c
Pablo Greco e6a3ae
+++ b/target/i386/cpu.c
Pablo Greco e6a3ae
@@ -2414,6 +2414,121 @@ static X86CPUDefinition builtin_x86_defs[] = {
Pablo Greco e6a3ae
         .model_id = "Intel Xeon Processor (Skylake, IBRS)",
Pablo Greco e6a3ae
     },
Pablo Greco e6a3ae
     {
Pablo Greco e6a3ae
+        .name = "Icelake-Client",
Pablo Greco e6a3ae
+        .level = 0xd,
Pablo Greco e6a3ae
+        .vendor = CPUID_VENDOR_INTEL,
Pablo Greco e6a3ae
+        .family = 6,
Pablo Greco e6a3ae
+        .model = 126,
Pablo Greco e6a3ae
+        .stepping = 0,
Pablo Greco e6a3ae
+        .features[FEAT_1_EDX] =
Pablo Greco e6a3ae
+            CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
Pablo Greco e6a3ae
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
Pablo Greco e6a3ae
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
Pablo Greco e6a3ae
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
Pablo Greco e6a3ae
+            CPUID_DE | CPUID_FP87,
Pablo Greco e6a3ae
+        .features[FEAT_1_ECX] =
Pablo Greco e6a3ae
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
Pablo Greco e6a3ae
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
Pablo Greco e6a3ae
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
Pablo Greco e6a3ae
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
Pablo Greco e6a3ae
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
Pablo Greco e6a3ae
+            CPUID_EXT_PCID | CPUID_EXT_F16C | CPUID_EXT_RDRAND,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0001_EDX] =
Pablo Greco e6a3ae
+            CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
Pablo Greco e6a3ae
+            CPUID_EXT2_SYSCALL,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
+            CPUID_EXT3_ABM | CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0008_EBX] =
Pablo Greco e6a3ae
+            CPUID_8000_0008_EBX_WBNOINVD,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_EBX] =
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_INTEL_PT,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_ECX] =
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_VBMI | CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_OSPKE | CPUID_7_0_ECX_VBMI2 | CPUID_7_0_ECX_GFNI |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_VAES | CPUID_7_0_ECX_VPCLMULQDQ |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_AVX512_VPOPCNTDQ,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_EDX] =
Pablo Greco e6a3ae
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
Pablo Greco e6a3ae
+        /* Missing: XSAVES (not supported by some Linux versions,
Pablo Greco e6a3ae
+                * including v4.1 to v4.12).
Pablo Greco e6a3ae
+                * KVM doesn't yet expose any XSAVES state save component,
Pablo Greco e6a3ae
+                * and the only one defined in Skylake (processor tracing)
Pablo Greco e6a3ae
+                * probably will block migration anyway.
Pablo Greco e6a3ae
+                */
Pablo Greco e6a3ae
+        .features[FEAT_XSAVE] =
Pablo Greco e6a3ae
+            CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
Pablo Greco e6a3ae
+            CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
+        .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
+            CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .xlevel = 0x80000008,
Pablo Greco e6a3ae
+        .model_id = "Intel Core Processor (Icelake)",
Pablo Greco e6a3ae
+    },
Pablo Greco e6a3ae
+    {
Pablo Greco e6a3ae
+        .name = "Icelake-Server",
Pablo Greco e6a3ae
+        .level = 0xd,
Pablo Greco e6a3ae
+        .vendor = CPUID_VENDOR_INTEL,
Pablo Greco e6a3ae
+        .family = 6,
Pablo Greco e6a3ae
+        .model = 134,
Pablo Greco e6a3ae
+        .stepping = 0,
Pablo Greco e6a3ae
+        .features[FEAT_1_EDX] =
Pablo Greco e6a3ae
+            CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
Pablo Greco e6a3ae
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
Pablo Greco e6a3ae
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
Pablo Greco e6a3ae
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
Pablo Greco e6a3ae
+            CPUID_DE | CPUID_FP87,
Pablo Greco e6a3ae
+        .features[FEAT_1_ECX] =
Pablo Greco e6a3ae
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
Pablo Greco e6a3ae
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
Pablo Greco e6a3ae
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
Pablo Greco e6a3ae
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
Pablo Greco e6a3ae
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
Pablo Greco e6a3ae
+            CPUID_EXT_PCID | CPUID_EXT_F16C | CPUID_EXT_RDRAND,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0001_EDX] =
Pablo Greco e6a3ae
+            CPUID_EXT2_LM | CPUID_EXT2_PDPE1GB | CPUID_EXT2_RDTSCP |
Pablo Greco e6a3ae
+            CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0001_ECX] =
Pablo Greco e6a3ae
+            CPUID_EXT3_ABM | CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
Pablo Greco e6a3ae
+        .features[FEAT_8000_0008_EBX] =
Pablo Greco e6a3ae
+            CPUID_8000_0008_EBX_WBNOINVD,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_EBX] =
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
Pablo Greco e6a3ae
+            CPUID_7_0_EBX_INTEL_PT,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_ECX] =
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_VBMI | CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_OSPKE | CPUID_7_0_ECX_VBMI2 | CPUID_7_0_ECX_GFNI |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_VAES | CPUID_7_0_ECX_VPCLMULQDQ |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
Pablo Greco e6a3ae
+            CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57,
Pablo Greco e6a3ae
+        .features[FEAT_7_0_EDX] =
Pablo Greco e6a3ae
+            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL |
Pablo Greco e6a3ae
+            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
Pablo Greco e6a3ae
+        /* Missing: XSAVES (not supported by some Linux versions,
Pablo Greco e6a3ae
+                * including v4.1 to v4.12).
Pablo Greco e6a3ae
+                * KVM doesn't yet expose any XSAVES state save component,
Pablo Greco e6a3ae
+                * and the only one defined in Skylake (processor tracing)
Pablo Greco e6a3ae
+                * probably will block migration anyway.
Pablo Greco e6a3ae
+                */
Pablo Greco e6a3ae
+        .features[FEAT_XSAVE] =
Pablo Greco e6a3ae
+            CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
Pablo Greco e6a3ae
+            CPUID_XSAVE_XGETBV1,
Pablo Greco e6a3ae
+        .features[FEAT_6_EAX] =
Pablo Greco e6a3ae
+            CPUID_6_EAX_ARAT,
Pablo Greco e6a3ae
+        .xlevel = 0x80000008,
Pablo Greco e6a3ae
+        .model_id = "Intel Xeon Processor (Icelake)",
Pablo Greco e6a3ae
+    },
Pablo Greco e6a3ae
+    {
Pablo Greco e6a3ae
         .name = "Opteron_G1",
Pablo Greco e6a3ae
         .level = 5,
Pablo Greco e6a3ae
         .vendor = CPUID_VENDOR_AMD,
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae