cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
34b321
From ce561d78c7199821beae26112f41da5733fab5bb Mon Sep 17 00:00:00 2001
34b321
From: Eduardo Habkost <ehabkost@redhat.com>
34b321
Date: Wed, 6 Jul 2016 20:47:53 +0200
34b321
Subject: [PATCH 2/2] target-i386: add Skylake-Client cpu model
34b321
34b321
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
34b321
Message-id: <1467838073-23873-3-git-send-email-ehabkost@redhat.com>
34b321
Patchwork-id: 71052
34b321
O-Subject: [RHEL-7.3 qemu-kvm PATCH 2/2] target-i386: add Skylake-Client cpu model
34b321
Bugzilla: 1327599
34b321
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
34b321
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
34b321
RH-Acked-by: Bandan Das <bsd@redhat.com>
34b321
34b321
Introduce Skylake-Client cpu mode which inherits the features from
34b321
Broadwell and supports some additional features that are: MPX,
34b321
XSAVEC, and XGETBV1.
34b321
34b321
Backport notes:
34b321
* ARAT feature not included, as it is not available in the
34b321
  qemu-kvm-1.5.3 tree (and disabled by compat code in
34b321
  pc-i440fx-rhel7.2.0 and older on qemu-kvm-rhev)
34b321
34b321
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
34b321
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
34b321
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
34b321
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
34b321
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
34b321
(cherry picked from commit f6f949e9295889fb272698aea763dcea77d616ce)
34b321
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
34b321
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
34b321
---
34b321
 target-i386/cpu.c | 43 +++++++++++++++++++++++++++++++++++++++++++
34b321
 1 file changed, 43 insertions(+)
34b321
34b321
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
34b321
index 6650c72..80106ba 100644
34b321
--- a/target-i386/cpu.c
34b321
+++ b/target-i386/cpu.c
34b321
@@ -927,6 +927,49 @@ static x86_def_t builtin_x86_defs[] = {
34b321
         .model_id = "Intel Core Processor (Broadwell)",
34b321
     },
34b321
     {
34b321
+        .name = "Skylake-Client",
34b321
+        .level = 0xd,
34b321
+        .vendor = CPUID_VENDOR_INTEL,
34b321
+        .family = 6,
34b321
+        .model = 94,
34b321
+        .stepping = 3,
34b321
+        .features[FEAT_1_EDX] =
34b321
+            CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
34b321
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
34b321
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
34b321
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
34b321
+            CPUID_DE | CPUID_FP87,
34b321
+        .features[FEAT_1_ECX] =
34b321
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
34b321
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
34b321
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
34b321
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
34b321
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
34b321
+            CPUID_EXT_PCID | CPUID_EXT_F16C | CPUID_EXT_RDRAND,
34b321
+        .features[FEAT_8000_0001_EDX] =
34b321
+            CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
34b321
+            CPUID_EXT2_SYSCALL,
34b321
+        .features[FEAT_8000_0001_ECX] =
34b321
+            CPUID_EXT3_ABM | CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
34b321
+        .features[FEAT_7_0_EBX] =
34b321
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
34b321
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
34b321
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
34b321
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
34b321
+            CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX,
34b321
+        /* Missing: XSAVES (not supported by some Linux versions,
34b321
+         * including v4.1 to v4.6).
34b321
+         * KVM doesn't yet expose any XSAVES state save component,
34b321
+         * and the only one defined in Skylake (processor tracing)
34b321
+         * probably will block migration anyway.
34b321
+         */
34b321
+        .features[FEAT_XSAVE] =
34b321
+            CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
34b321
+            CPUID_XSAVE_XGETBV1,
34b321
+        .xlevel = 0x80000008,
34b321
+        .model_id = "Intel Core Processor (Skylake)",
34b321
+    },
34b321
+    {
34b321
         .name = "Opteron_G1",
34b321
         .level = 5,
34b321
         .vendor = CPUID_VENDOR_AMD,
34b321
-- 
34b321
1.8.3.1
34b321