Skip to content

Commit 151f76c

Browse files
committed
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
x86 fixes for -rc1 Fixes for x86 that missed hard freeze: * Don't trigger warnings for features set by CPU model versions (Xiaoyao Li) * Missing features in Icelake-Server, Skylake-Server, Cascadelake-Server CPU models (Chenyi Qiang) * Fix hvf x86_64 guest boot crash (Roman Bolshakov) # gpg: Signature made Thu 16 Jul 2020 19:17:18 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "[email protected]" # gpg: Good signature from "Eduardo Habkost <[email protected]>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/x86-next-pull-request: i386: hvf: Explicitly set CR4 guest/host mask target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models target/i386: fix model number and add missing features for Icelake-Server CPU model target/i386: add fast short REP MOV support i386/cpu: Don't add unavailable_features to env->user_features i368/cpu: Clear env->user_features after loading versioned CPU model Signed-off-by: Peter Maydell <[email protected]>
2 parents 95d1fba + 818b9f1 commit 151f76c

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

target/i386/cpu.c

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
984984
.type = CPUID_FEATURE_WORD,
985985
.feat_names = {
986986
NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
987-
NULL, NULL, NULL, NULL,
987+
"fsrm", NULL, NULL, NULL,
988988
"avx512-vp2intersect", NULL, "md-clear", NULL,
989989
NULL, NULL, "serialize", NULL,
990990
"tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
@@ -3034,6 +3034,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
30343034
{ /* end of list */ }
30353035
}
30363036
},
3037+
{
3038+
.version = 4,
3039+
.props = (PropValue[]) {
3040+
{ "vmx-eptp-switching", "on" },
3041+
{ /* end of list */ }
3042+
}
3043+
},
30373044
{ /* end of list */ }
30383045
}
30393046
},
@@ -3158,6 +3165,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
31583165
{ /* end of list */ }
31593166
},
31603167
},
3168+
{ .version = 4,
3169+
.note = "ARCH_CAPABILITIES, no TSX",
3170+
.props = (PropValue[]) {
3171+
{ "vmx-eptp-switching", "on" },
3172+
{ /* end of list */ }
3173+
},
3174+
},
31613175
{ /* end of list */ }
31623176
}
31633177
},
@@ -3512,6 +3526,20 @@ static X86CPUDefinition builtin_x86_defs[] = {
35123526
{ /* end of list */ }
35133527
},
35143528
},
3529+
{
3530+
.version = 4,
3531+
.props = (PropValue[]) {
3532+
{ "sha-ni", "on" },
3533+
{ "avx512ifma", "on" },
3534+
{ "rdpid", "on" },
3535+
{ "fsrm", "on" },
3536+
{ "vmx-rdseed-exit", "on" },
3537+
{ "vmx-pml", "on" },
3538+
{ "vmx-eptp-switching", "on" },
3539+
{ "model", "106" },
3540+
{ /* end of list */ }
3541+
},
3542+
},
35153543
{ /* end of list */ }
35163544
}
35173545
},
@@ -5159,6 +5187,13 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model)
51595187
object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort);
51605188

51615189
x86_cpu_apply_version_props(cpu, model);
5190+
5191+
/*
5192+
* Properties in versioned CPU model are not user specified features.
5193+
* We can simply clear env->user_features here since it will be filled later
5194+
* in x86_cpu_expand_features() based on plus_features and minus_features.
5195+
*/
5196+
memset(&env->user_features, 0, sizeof(env->user_features));
51625197
}
51635198

51645199
#ifndef CONFIG_USER_ONLY
@@ -6364,7 +6399,6 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
63646399
unavailable_features & env->user_features[d->to.index],
63656400
"This feature depends on other features that were not requested");
63666401

6367-
env->user_features[d->to.index] |= unavailable_features;
63686402
env->features[d->to.index] &= ~unavailable_features;
63696403
}
63706404
}

target/i386/cpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
775775
#define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2)
776776
/* AVX512 Multiply Accumulation Single Precision */
777777
#define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3)
778+
/* Fast Short Rep Mov */
779+
#define CPUID_7_0_EDX_FSRM (1U << 4)
778780
/* AVX512 Vector Pair Intersection to a Pair of Mask Registers */
779781
#define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
780782
/* SERIALIZE instruction */

target/i386/hvf/vmx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
166166

167167
wvmcs(vcpu, VMCS_GUEST_CR4, guest_cr4);
168168
wvmcs(vcpu, VMCS_CR4_SHADOW, cr4);
169+
wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE);
169170

170171
hv_vcpu_invalidate_tlb(vcpu);
171172
hv_vcpu_flush(vcpu);

0 commit comments

Comments
 (0)