]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch
bump version to 2.9.1-9
[pve-qemu.git] / debian / patches / extra / 0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch
CommitLineData
507c6de3
WB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Brijesh Singh <brijesh.singh@amd.com>
3Date: Tue, 15 Aug 2017 12:00:51 -0500
4Subject: [PATCH] target-i386/cpu: Add new EPYC CPU model
5
6Add a new base CPU model called 'EPYC' to model processors from AMD EPYC
7family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx).
8
9The following features bits have been added/removed compare to Opteron_G5
10
11Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw,
12 fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha
13 xsaveopt, xsavec, xgetbv1, arat
14
15Removed: xop, fma4, tbm
16
17Cc: Paolo Bonzini <pbonzini@redhat.com>
18Cc: Richard Henderson <rth@twiddle.net>
19Cc: Eduardo Habkost <ehabkost@redhat.com>
20Cc: Tom Lendacky <Thomas.Lendacky@amd.com>
21Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
22Message-Id: <20170815170051.127257-1-brijesh.singh@amd.com>
23Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
24Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
25---
26 target/i386/cpu.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
27 1 file changed, 44 insertions(+)
28
29diff --git a/target/i386/cpu.c b/target/i386/cpu.c
30index e4a2d5a012..e977c6c616 100644
31--- a/target/i386/cpu.c
32+++ b/target/i386/cpu.c
33@@ -1923,6 +1923,50 @@ static X86CPUDefinition builtin_x86_defs[] = {
34 .xlevel = 0x8000001A,
35 .model_id = "AMD Opteron 63xx class CPU",
36 },
37+ {
38+ .name = "EPYC",
39+ .level = 0xd,
40+ .vendor = CPUID_VENDOR_AMD,
41+ .family = 23,
42+ .model = 1,
43+ .stepping = 2,
44+ .features[FEAT_1_EDX] =
45+ CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH |
46+ CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE |
47+ CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE |
48+ CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE |
49+ CPUID_VME | CPUID_FP87,
50+ .features[FEAT_1_ECX] =
51+ CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX |
52+ CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT |
53+ CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
54+ CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 |
55+ CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3,
56+ .features[FEAT_8000_0001_EDX] =
57+ CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB |
58+ CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX |
59+ CPUID_EXT2_SYSCALL,
60+ .features[FEAT_8000_0001_ECX] =
61+ CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH |
62+ CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM |
63+ CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
64+ .features[FEAT_7_0_EBX] =
65+ CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 |
66+ CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED |
67+ CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT |
68+ CPUID_7_0_EBX_SHA_NI,
69+ /* Missing: XSAVES (not supported by some Linux versions,
70+ * including v4.1 to v4.12).
71+ * KVM doesn't yet expose any XSAVES state save component.
72+ */
73+ .features[FEAT_XSAVE] =
74+ CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
75+ CPUID_XSAVE_XGETBV1,
76+ .features[FEAT_6_EAX] =
77+ CPUID_6_EAX_ARAT,
78+ .xlevel = 0x8000000A,
79+ .model_id = "AMD EPYC Processor",
80+ },
81 };
82
83 typedef struct PropValue {
84--
852.11.0
86