Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180719' int…
Browse files Browse the repository at this point in the history
…o 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>
  • Loading branch information
pm215 committed Jul 19, 2018
2 parents ea6abff + 677ff32 commit 771eab9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions target/s390x/cpu_models.c
Expand Up @@ -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);
Expand Down

0 comments on commit 771eab9

Please sign in to comment.