[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 23/54] i386: Add FEAT_8000_0008_EBX CPUID feature w
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 23/54] i386: Add FEAT_8000_0008_EBX CPUID feature word |
Date: |
Tue, 6 Feb 2018 13:14:44 -0600 |
From: Eduardo Habkost <address@hidden>
Add the new feature word and the "ibpb" feature flag.
Based on a patch by Paolo Bonzini.
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
(cherry picked from commit 1b3420e1c4d523c49866cca4e7544753201cd43d)
Signed-off-by: Michael Roth <address@hidden>
---
target/i386/cpu.c | 19 ++++++++++++++++++-
target/i386/cpu.h | 3 +++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index dddd62207c..36edc875fc 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -482,6 +482,22 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
.tcg_features = TCG_APM_FEATURES,
.unmigratable_flags = CPUID_APM_INVTSC,
},
+ [FEAT_8000_0008_EBX] = {
+ .feat_names = {
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ "ibpb", NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ },
+ .cpuid_eax = 0x80000008,
+ .cpuid_reg = R_EBX,
+ .tcg_features = 0,
+ .unmigratable_flags = 0,
+ },
[FEAT_XSAVE] = {
.feat_names = {
"xsaveopt", "xsavec", "xgetbv1", "xsaves",
@@ -3097,7 +3113,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
} else {
*eax = cpu->phys_bits;
}
- *ebx = 0;
+ *ebx = env->features[FEAT_8000_0008_EBX];
*ecx = 0;
*edx = 0;
if (cs->nr_cores * cs->nr_threads > 1) {
@@ -3553,6 +3569,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error
**errp)
x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX);
x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX);
x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX);
+ x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX);
x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8bf9879f3e..f3d0ebb673 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -454,6 +454,7 @@ typedef enum FeatureWord {
FEAT_8000_0001_EDX, /* CPUID[8000_0001].EDX */
FEAT_8000_0001_ECX, /* CPUID[8000_0001].ECX */
FEAT_8000_0007_EDX, /* CPUID[8000_0007].EDX */
+ FEAT_8000_0008_EBX, /* CPUID[8000_0008].EBX */
FEAT_C000_0001_EDX, /* CPUID[C000_0001].EDX */
FEAT_KVM, /* CPUID[4000_0001].EAX (KVM_CPUID_FEATURES) */
FEAT_HYPERV_EAX, /* CPUID[4000_0003].EAX */
@@ -644,6 +645,8 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
#define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation
Single Precision */
#define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */
+#define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Prediction
Barrier */
+
#define CPUID_XSAVE_XSAVEOPT (1U << 0)
#define CPUID_XSAVE_XSAVEC (1U << 1)
#define CPUID_XSAVE_XGETBV1 (1U << 2)
--
2.11.0
- [Qemu-stable] [PATCH 12/54] hw/intc/arm_gic: reserved register addresses are RAZ/WI, (continued)
- [Qemu-stable] [PATCH 12/54] hw/intc/arm_gic: reserved register addresses are RAZ/WI, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 13/54] virtio_error: don't invoke status callbacks, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 14/54] vhost: remove assertion to prevent crash, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 18/54] scsi-disk: release AioContext in unaligned WRITE SAME case, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 15/54] hw/sd/pl181: Reset SD card on controller reset, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 17/54] hw/sd/ssi-sd: Reset SD card on controller reset, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 16/54] hw/sd/milkymist-memcard: Reset SD card on controller reset, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 20/54] i386: Change X86CPUDefinition::model_id to const char*, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 01/54] target/i386: Fix handling of VEX prefixes, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 21/54] i386: Add support for SPEC_CTRL MSR, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 23/54] i386: Add FEAT_8000_0008_EBX CPUID feature word,
Michael Roth <=
- [Qemu-stable] [PATCH 19/54] hw/pci-bridge: fix QEMU crash because of pcie-root-port, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 27/54] s390x: fix storage attributes migration for non-small guests, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 22/54] i386: Add spec-ctrl CPUID bit, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 26/54] linux-user: Fix locking order in fork_start(), Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 28/54] linux-headers: update to 4.15-rc1, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 37/54] spapr: Add pseries-2.12 machine type, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 35/54] linux-user/signal.c: Rename MC_* defines, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 29/54] linux-headers: update, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 33/54] usb-storage: Fix share-rw option parsing, Michael Roth, 2018/02/06
- [Qemu-stable] [PATCH 31/54] s390x/kvm: provide stfle.81, Michael Roth, 2018/02/06