[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [qemu-s390x] [PATCH] s390x/cpumodel: fix segmentation f
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [qemu-s390x] [PATCH] s390x/cpumodel: fix segmentation fault when baselining models |
Date: |
Wed, 18 Jul 2018 11:06:03 +0200 |
On Wed, 18 Jul 2018 10:50:01 +0200
David Hildenbrand <address@hidden> wrote:
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index cfdbccf46d..604898a882 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -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);
>
>
+1, would queue.