target/s390x: improve cpu compatibility check error message

some users were confused by this message showing under TCG:

 Selected CPU generation is too new. Maximum supported model
 in the configuration: 'xyz'

Clarify that the maximum can depend on the accel, and add a
hint to try a different one.

Also add a hint for features mismatch to suggest trying
different accel, QEMU and kernel versions.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Message-ID: <20240314213746.27163-1-cfontana@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Claudio Fontana 2024-03-14 22:37:46 +01:00 committed by Thomas Huth
parent b17693453e
commit ff7c98a941

View file

@ -500,6 +500,16 @@ static void error_prepend_missing_feat(const char *name, void *opaque)
error_prepend((Error **) opaque, "%s ", name); error_prepend((Error **) opaque, "%s ", name);
} }
static void check_compat_model_failed(Error **errp,
const S390CPUModel *max_model,
const char *msg)
{
error_setg(errp, "%s. Maximum supported model in the current configuration: \'%s\'",
msg, max_model->def->name);
error_append_hint(errp, "Consider a different accelerator, try \"-accel help\"\n");
return;
}
static void check_compatibility(const S390CPUModel *max_model, static void check_compatibility(const S390CPUModel *max_model,
const S390CPUModel *model, Error **errp) const S390CPUModel *model, Error **errp)
{ {
@ -507,15 +517,11 @@ static void check_compatibility(const S390CPUModel *max_model,
S390FeatBitmap missing; S390FeatBitmap missing;
if (model->def->gen > max_model->def->gen) { if (model->def->gen > max_model->def->gen) {
error_setg(errp, "Selected CPU generation is too new. Maximum " check_compat_model_failed(errp, max_model, "Selected CPU generation is too new");
"supported model in the configuration: \'%s\'",
max_model->def->name);
return; return;
} else if (model->def->gen == max_model->def->gen && } else if (model->def->gen == max_model->def->gen &&
model->def->ec_ga > max_model->def->ec_ga) { model->def->ec_ga > max_model->def->ec_ga) {
error_setg(errp, "Selected CPU GA level is too new. Maximum " check_compat_model_failed(errp, max_model, "Selected CPU GA level is too new");
"supported model in the configuration: \'%s\'",
max_model->def->name);
return; return;
} }
@ -537,7 +543,9 @@ static void check_compatibility(const S390CPUModel *max_model,
error_setg(errp, " "); error_setg(errp, " ");
s390_feat_bitmap_to_ascii(missing, errp, error_prepend_missing_feat); s390_feat_bitmap_to_ascii(missing, errp, error_prepend_missing_feat);
error_prepend(errp, "Some features requested in the CPU model are not " error_prepend(errp, "Some features requested in the CPU model are not "
"available in the configuration: "); "available in the current configuration: ");
error_append_hint(errp,
"Consider a different accelerator, QEMU, or kernel version\n");
} }
S390CPUModel *get_max_cpu_model(Error **errp) S390CPUModel *get_max_cpu_model(Error **errp)