9ae3a8
From 9593b95415b6da77211860e76987c988c08e19d4 Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Thu, 21 Aug 2014 19:58:16 +0200
9ae3a8
Subject: [PATCH 1/3] target-i386: Broadwell CPU model
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
Message-id: <1408651097-24190-2-git-send-email-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 60670
9ae3a8
O-Subject: [RHEL7.1 qemu-kvm PATCH 1/2] target-i386: Broadwell CPU model
9ae3a8
Bugzilla: 1116117
9ae3a8
RH-Acked-by: Bandan Das <bsd@redhat.com>
9ae3a8
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
This adds a new CPU model named "Broadwell". It has all the features
9ae3a8
from Haswell, plus PREFETCHW, RDSEED, ADX, SMAP.
9ae3a8
9ae3a8
PREFETCHW was already supported as "3dnowprefetch".
9ae3a8
[Already supported by RHEL-7 kernel, too]
9ae3a8
9ae3a8
RDSEED, ADX was added on Linux v3.15-rc1.
9ae3a8
[RDSEED: RHEL-7 kernel commit c4311bc8c9167a3d7011aff8728fd8067404246f]
9ae3a8
[ADX: RHEL-7 kernel commit fe5f6cdf4428dcd01f5b060b31eabe44c2f5e468]
9ae3a8
9ae3a8
SMAP was added on Linux v3.15-rc2.
9ae3a8
[RHEL-7 kernel commit 890edaefc84a2596a3f17d1e9967935a1984e302]
9ae3a8
9ae3a8
About migration support:
9ae3a8
* SMAP state is a single bit on CR4 which is already migrated;
9ae3a8
* PREFETCHW, RDSEED, ADX have no new state.
9ae3a8
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Signed-off-by: Andreas Färber <afaerber@suse.de>
9ae3a8
(cherry picked from commit ece01354073f8e02db0205ea7522f3dbf589c9aa)
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 target-i386/cpu.c | 34 ++++++++++++++++++++++++++++++++++
9ae3a8
 1 file changed, 34 insertions(+)
9ae3a8
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index e65318e..1507530 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -860,6 +860,40 @@ static x86_def_t builtin_x86_defs[] = {
9ae3a8
         .model_id = "Intel Core Processor (Haswell)",
9ae3a8
     },
9ae3a8
     {
9ae3a8
+        .name = "Broadwell",
9ae3a8
+        .level = 0xd,
9ae3a8
+        .vendor = CPUID_VENDOR_INTEL,
9ae3a8
+        .family = 6,
9ae3a8
+        .model = 61,
9ae3a8
+        .stepping = 2,
9ae3a8
+        .features[FEAT_1_EDX] =
9ae3a8
+            CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
9ae3a8
+            CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
9ae3a8
+            CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
9ae3a8
+            CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
9ae3a8
+            CPUID_DE | CPUID_FP87,
9ae3a8
+        .features[FEAT_1_ECX] =
9ae3a8
+            CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
9ae3a8
+            CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
9ae3a8
+            CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
9ae3a8
+            CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
9ae3a8
+            CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
9ae3a8
+            CPUID_EXT_PCID,
9ae3a8
+        .features[FEAT_8000_0001_EDX] =
9ae3a8
+            CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
9ae3a8
+            CPUID_EXT2_SYSCALL,
9ae3a8
+        .features[FEAT_8000_0001_ECX] =
9ae3a8
+            CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH,
9ae3a8
+        .features[FEAT_7_0_EBX] =
9ae3a8
+            CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
9ae3a8
+            CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
9ae3a8
+            CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
9ae3a8
+            CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
9ae3a8
+            CPUID_7_0_EBX_SMAP,
9ae3a8
+        .xlevel = 0x8000000A,
9ae3a8
+        .model_id = "Intel Core Processor (Broadwell)",
9ae3a8
+    },
9ae3a8
+    {
9ae3a8
         .name = "Opteron_G1",
9ae3a8
         .level = 5,
9ae3a8
         .vendor = CPUID_VENDOR_AMD,
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8