mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180719' into staging
don't segfault when trying to baseline an odd cpu model # gpg: Signature made Thu 19 Jul 2018 12:39:05 BST # gpg: using RSA key DECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # gpg: aka "Cornelia Huck <cohuck@kernel.org>" # gpg: aka "Cornelia Huck <cohuck@redhat.com>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20180719: s390x/cpumodel: fix segmentation fault when baselining models Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -716,6 +716,14 @@ CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa,
|
||||
|
||||
model.def = s390_find_cpu_def(cpu_type, max_gen, max_gen_ga,
|
||||
model.features);
|
||||
|
||||
/* models without early base features (esan3) are bad */
|
||||
if (!model.def) {
|
||||
error_setg(errp, "No compatible CPU model could be created as"
|
||||
" important base features are disabled");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* strip off features not part of the max model */
|
||||
bitmap_and(model.features, model.features, model.def->full_feat,
|
||||
S390_FEAT_MAX);
|
||||
|
||||
Reference in New Issue
Block a user