Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
qemu.8405
0444-i386-Add-FEAT_8000_0008_EBX-CPUID-f.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0444-i386-Add-FEAT_8000_0008_EBX-CPUID-f.patch of Package qemu.8405
From 5e14e06caf28f9c7abfdfe335acfe7854f254388 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost <ehabkost@redhat.com> Date: Tue, 9 Jan 2018 13:45:16 -0200 Subject: [PATCH] i386: Add FEAT_8000_0008_EBX CPUID feature word Add the new feature word and the "ibpb" feature flag. Based on a patch by Paolo Bonzini. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20180109154519.25634-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> (cherry picked from commit 1b3420e1c4d523c49866cca4e7544753201cd43d) [BR: BSC#1068032 CVE-2017-5715 change to match current code's feat_name type] Signed-off-by: Bruce Rogers <brogers@suse.com> --- 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 7a738e79e8..f61e60b066 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -273,6 +273,17 @@ static const char *cpuid_7_0_edx_feature_name[] = { NULL, NULL, NULL, NULL, }; +static const char *cpuid_ibpb_ebx_feature_name[] = { + 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, +}; + typedef struct FeatureWordInfo { const char **feat_names; uint32_t cpuid_eax; /* Input EAX for CPUID */ @@ -322,6 +333,11 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { .cpuid_needs_ecx = true, .cpuid_ecx = 0, .cpuid_reg = R_EDX, }, + [FEAT_8000_0008_EBX] = { + .feat_names = cpuid_ibpb_ebx_feature_name, + .cpuid_eax = 0x80000008, + .cpuid_reg = R_EBX, + }, }; typedef struct X86RegisterInfo32 { @@ -2380,7 +2396,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *eax = 0x00000020; /* 32 bits physical */ } } - *ebx = 0; + *ebx = env->features[FEAT_8000_0008_EBX]; *ecx = 0; *edx = 0; if (cs->nr_cores * cs->nr_threads > 1) { @@ -2637,6 +2653,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) env->features[FEAT_7_0_EDX] &= TCG_7_0_EDX_FEATURES; env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES; env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES; + env->features[FEAT_8000_0008_EBX] &= 0; env->features[FEAT_SVM] &= TCG_SVM_FEATURES; } else { KVMState *s = kvm_state; diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 936fbf6c1d..f6c6ea07f7 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -402,6 +402,7 @@ typedef enum FeatureWord { FEAT_7_0_EDX, /* CPUID[EAX=7,ECX=0].EDX */ FEAT_8000_0001_EDX, /* CPUID[8000_0001].EDX */ FEAT_8000_0001_ECX, /* CPUID[8000_0001].ECX */ + 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_SVM, /* CPUID[8000_000A].EDX */ @@ -562,6 +563,8 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_EBX_SMAP (1U << 20) #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_VENDOR_SZ 12 #define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor