|
|
9ae3a8 |
From 30c05c032f0af4e959b304f5223dbaf331955488 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 23 Feb 2017 14:29:43 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 13/17] target-i386: Define TCG_*_FEATURES earlier in cpu.c
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20170223142945.17790-13-ehabkost@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 74042
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.4 qemu-kvm PATCH v2 12/14] target-i386: Define TCG_*_FEATURES earlier in cpu.c
|
|
|
9ae3a8 |
Bugzilla: 1382122
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Those macros will be used in the feature_word_info array data, so need
|
|
|
9ae3a8 |
to be defined earlier.
|
|
|
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 621626ce7d44f008298c7e6cfefa9fbb80a33dc2)
|
|
|
9ae3a8 |
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
target-i386/cpu.c | 121 +++++++++++++++++++++++++++---------------------------
|
|
|
9ae3a8 |
1 file changed, 61 insertions(+), 60 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
|
|
|
9ae3a8 |
index e6821b6..d611062 100644
|
|
|
9ae3a8 |
--- a/target-i386/cpu.c
|
|
|
9ae3a8 |
+++ b/target-i386/cpu.c
|
|
|
9ae3a8 |
@@ -187,6 +187,67 @@ static const char *cpuid_xsave_feature_name[] = {
|
|
|
9ae3a8 |
NULL, NULL, NULL, NULL,
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+#define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
|
|
|
9ae3a8 |
+#define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
|
|
|
9ae3a8 |
+ CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC)
|
|
|
9ae3a8 |
+#define PENTIUM2_FEATURES (PENTIUM_FEATURES | CPUID_PAE | CPUID_SEP | \
|
|
|
9ae3a8 |
+ CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
|
|
|
9ae3a8 |
+ CPUID_PSE36 | CPUID_FXSR)
|
|
|
9ae3a8 |
+#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE)
|
|
|
9ae3a8 |
+#define PPRO_FEATURES (CPUID_FP87 | CPUID_DE | CPUID_PSE | CPUID_TSC | \
|
|
|
9ae3a8 |
+ CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \
|
|
|
9ae3a8 |
+ CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
|
|
|
9ae3a8 |
+ CPUID_PAE | CPUID_SEP | CPUID_APIC)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+#define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
|
|
|
9ae3a8 |
+ CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
|
|
|
9ae3a8 |
+ CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
|
|
|
9ae3a8 |
+ CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \
|
|
|
9ae3a8 |
+ CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS)
|
|
|
9ae3a8 |
+ /* partly implemented:
|
|
|
9ae3a8 |
+ CPUID_MTRR, CPUID_MCA, CPUID_CLFLUSH (needed for Win64)
|
|
|
9ae3a8 |
+ CPUID_PSE36 (needed for Solaris) */
|
|
|
9ae3a8 |
+ /* missing:
|
|
|
9ae3a8 |
+ CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
|
|
|
9ae3a8 |
+#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | \
|
|
|
9ae3a8 |
+ CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | \
|
|
|
9ae3a8 |
+ CPUID_EXT_SSE41 | CPUID_EXT_SSE42 | CPUID_EXT_POPCNT | \
|
|
|
9ae3a8 |
+ CPUID_EXT_MOVBE | CPUID_EXT_AES | CPUID_EXT_HYPERVISOR)
|
|
|
9ae3a8 |
+ /* missing:
|
|
|
9ae3a8 |
+ CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_SMX,
|
|
|
9ae3a8 |
+ CPUID_EXT_EST, CPUID_EXT_TM2, CPUID_EXT_CID, CPUID_EXT_FMA,
|
|
|
9ae3a8 |
+ CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_PCID, CPUID_EXT_DCA,
|
|
|
9ae3a8 |
+ CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_XSAVE,
|
|
|
9ae3a8 |
+ CPUID_EXT_OSXSAVE, CPUID_EXT_AVX, CPUID_EXT_F16C,
|
|
|
9ae3a8 |
+ CPUID_EXT_RDRAND */
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+#ifdef TARGET_X86_64
|
|
|
9ae3a8 |
+#define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
|
|
|
9ae3a8 |
+#else
|
|
|
9ae3a8 |
+#define TCG_EXT2_X86_64_FEATURES 0
|
|
|
9ae3a8 |
+#endif
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
|
|
|
9ae3a8 |
+ CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
|
|
|
9ae3a8 |
+ CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | \
|
|
|
9ae3a8 |
+ TCG_EXT2_X86_64_FEATURES)
|
|
|
9ae3a8 |
+ /* missing:
|
|
|
9ae3a8 |
+ CPUID_EXT2_PDPE1GB */
|
|
|
9ae3a8 |
+#define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
|
|
|
9ae3a8 |
+ CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
|
|
|
9ae3a8 |
+#define TCG_EXT4_FEATURES 0
|
|
|
9ae3a8 |
+#define TCG_SVM_FEATURES 0
|
|
|
9ae3a8 |
+#define TCG_KVM_FEATURES 0
|
|
|
9ae3a8 |
+#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
|
|
|
9ae3a8 |
+ CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
|
|
|
9ae3a8 |
+ /* missing:
|
|
|
9ae3a8 |
+ CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
|
|
|
9ae3a8 |
+ CPUID_7_0_EBX_ERMS, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
|
|
|
9ae3a8 |
+ CPUID_7_0_EBX_RDSEED */
|
|
|
9ae3a8 |
+#define TCG_7_0_ECX_FEATURES 0
|
|
|
9ae3a8 |
+#define TCG_7_0_EDX_FEATURES 0
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
typedef struct FeatureWordInfo {
|
|
|
9ae3a8 |
const char **feat_names;
|
|
|
9ae3a8 |
uint32_t cpuid_eax; /* Input EAX for CPUID */
|
|
|
9ae3a8 |
@@ -453,66 +514,6 @@ typedef struct x86_def_t {
|
|
|
9ae3a8 |
char model_id[48];
|
|
|
9ae3a8 |
} x86_def_t;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-#define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
|
|
|
9ae3a8 |
-#define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
|
|
|
9ae3a8 |
- CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC)
|
|
|
9ae3a8 |
-#define PENTIUM2_FEATURES (PENTIUM_FEATURES | CPUID_PAE | CPUID_SEP | \
|
|
|
9ae3a8 |
- CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
|
|
|
9ae3a8 |
- CPUID_PSE36 | CPUID_FXSR)
|
|
|
9ae3a8 |
-#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE)
|
|
|
9ae3a8 |
-#define PPRO_FEATURES (CPUID_FP87 | CPUID_DE | CPUID_PSE | CPUID_TSC | \
|
|
|
9ae3a8 |
- CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \
|
|
|
9ae3a8 |
- CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
|
|
|
9ae3a8 |
- CPUID_PAE | CPUID_SEP | CPUID_APIC)
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-#define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
|
|
|
9ae3a8 |
- CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
|
|
|
9ae3a8 |
- CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
|
|
|
9ae3a8 |
- CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \
|
|
|
9ae3a8 |
- CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS)
|
|
|
9ae3a8 |
- /* partly implemented:
|
|
|
9ae3a8 |
- CPUID_MTRR, CPUID_MCA, CPUID_CLFLUSH (needed for Win64)
|
|
|
9ae3a8 |
- CPUID_PSE36 (needed for Solaris) */
|
|
|
9ae3a8 |
- /* missing:
|
|
|
9ae3a8 |
- CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
|
|
|
9ae3a8 |
-#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | \
|
|
|
9ae3a8 |
- CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | \
|
|
|
9ae3a8 |
- CPUID_EXT_SSE41 | CPUID_EXT_SSE42 | CPUID_EXT_POPCNT | \
|
|
|
9ae3a8 |
- CPUID_EXT_MOVBE | CPUID_EXT_AES | CPUID_EXT_HYPERVISOR)
|
|
|
9ae3a8 |
- /* missing:
|
|
|
9ae3a8 |
- CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_SMX,
|
|
|
9ae3a8 |
- CPUID_EXT_EST, CPUID_EXT_TM2, CPUID_EXT_CID, CPUID_EXT_FMA,
|
|
|
9ae3a8 |
- CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_PCID, CPUID_EXT_DCA,
|
|
|
9ae3a8 |
- CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_XSAVE,
|
|
|
9ae3a8 |
- CPUID_EXT_OSXSAVE, CPUID_EXT_AVX, CPUID_EXT_F16C,
|
|
|
9ae3a8 |
- CPUID_EXT_RDRAND */
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-#ifdef TARGET_X86_64
|
|
|
9ae3a8 |
-#define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
|
|
|
9ae3a8 |
-#else
|
|
|
9ae3a8 |
-#define TCG_EXT2_X86_64_FEATURES 0
|
|
|
9ae3a8 |
-#endif
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
|
|
|
9ae3a8 |
- CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
|
|
|
9ae3a8 |
- CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | \
|
|
|
9ae3a8 |
- TCG_EXT2_X86_64_FEATURES)
|
|
|
9ae3a8 |
- /* missing:
|
|
|
9ae3a8 |
- CPUID_EXT2_PDPE1GB */
|
|
|
9ae3a8 |
-#define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
|
|
|
9ae3a8 |
- CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
|
|
|
9ae3a8 |
-#define TCG_EXT4_FEATURES 0
|
|
|
9ae3a8 |
-#define TCG_SVM_FEATURES 0
|
|
|
9ae3a8 |
-#define TCG_KVM_FEATURES 0
|
|
|
9ae3a8 |
-#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
|
|
|
9ae3a8 |
- CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
|
|
|
9ae3a8 |
- /* missing:
|
|
|
9ae3a8 |
- CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
|
|
|
9ae3a8 |
- CPUID_7_0_EBX_ERMS, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
|
|
|
9ae3a8 |
- CPUID_7_0_EBX_RDSEED */
|
|
|
9ae3a8 |
-#define TCG_7_0_ECX_FEATURES 0
|
|
|
9ae3a8 |
-#define TCG_7_0_EDX_FEATURES 0
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
/* built-in CPU model definitions
|
|
|
9ae3a8 |
*/
|
|
|
9ae3a8 |
static x86_def_t builtin_x86_defs[] = {
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|