diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-06 11:42:59 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-06 11:42:59 +0100 |
commit | b11365867568ba954de667a0bfe0945b8f78d6bd (patch) | |
tree | 4699b4f24ef3d432566e07e2e11d036e28633150 /target | |
parent | 67b9c5d4f37ea373ebf9aad251883886e34bf2e1 (diff) | |
parent | 1045e3cdafaf1218d9f771080ba5c9d4f64346e4 (diff) |
Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20170706' into staging
s390x/kvm/migration: fixes, enhancements and cleanups
- new email address for Cornelia
- Fixes: 3270, flic, virtio-scsi-ccw, ipl
- Enhancements, cpumodel, migration
# gpg: Signature made Thu 06 Jul 2017 08:18:19 BST
# gpg: using RSA key 0x117BBC80B5A61C7C
# gpg: Good signature from "Christian Borntraeger (IBM) <borntraeger@de.ibm.com>"
# Primary key fingerprint: F922 9381 A334 08F9 DBAB FBCA 117B BC80 B5A6 1C7C
* remotes/borntraeger/tags/s390x-20170706:
hw/s390x/ipl: Fix endianness problem with netboot_start_addr
virtio-scsi-ccw: use ioeventfd even when KVM is disabled
s390x: return unavailable features via query-cpu-definitions
s390x/MAINTAINERS: Update my email address
s390x: fix realize inheritance for kvm-flic
s390x: fix error propagation in kvm-flic's realize
s390x/3270: fix instruction interception handler
s390x: vmstatify config migration for virtio-ccw
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/cpu.h | 6 | ||||
-rw-r--r-- | target/s390x/cpu_models.c | 62 |
2 files changed, 62 insertions, 6 deletions
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 9faca04b52..bdb9bdbc9d 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -1264,7 +1264,11 @@ static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id, int vq, bool assign) { - return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); + if (kvm_enabled()) { + return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); + } else { + return 0; + } } static inline void s390_crypto_reset(void) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 63903c2d6f..7cb55dc7e3 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -283,10 +283,41 @@ void s390_cpu_list(FILE *f, fprintf_function print) } } +static S390CPUModel *get_max_cpu_model(Error **errp); + #ifndef CONFIG_USER_ONLY +static void list_add_feat(const char *name, void *opaque); + +static void check_unavailable_features(const S390CPUModel *max_model, + const S390CPUModel *model, + strList **unavailable) +{ + S390FeatBitmap missing; + + /* check general model compatibility */ + if (max_model->def->gen < model->def->gen || + (max_model->def->gen == model->def->gen && + max_model->def->ec_ga < model->def->ec_ga)) { + list_add_feat("type", unavailable); + } + + /* detect missing features if any to properly report them */ + bitmap_andnot(missing, model->features, max_model->features, + S390_FEAT_MAX); + if (!bitmap_empty(missing, S390_FEAT_MAX)) { + s390_feat_bitmap_to_ascii(missing, unavailable, list_add_feat); + } +} + +struct CpuDefinitionInfoListData { + CpuDefinitionInfoList *list; + S390CPUModel *model; +}; + static void create_cpu_model_list(ObjectClass *klass, void *opaque) { - CpuDefinitionInfoList **cpu_list = opaque; + struct CpuDefinitionInfoListData *cpu_list_data = opaque; + CpuDefinitionInfoList **cpu_list = &cpu_list_data->list; CpuDefinitionInfoList *entry; CpuDefinitionInfo *info; char *name = g_strdup(object_class_get_name(klass)); @@ -300,7 +331,19 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) info->migration_safe = scc->is_migration_safe; info->q_static = scc->is_static; info->q_typename = g_strdup(object_class_get_name(klass)); - + /* check for unavailable features */ + if (cpu_list_data->model) { + Object *obj; + S390CPU *sc; + obj = object_new(object_class_get_name(klass)); + sc = S390_CPU(obj); + if (sc->model) { + info->has_unavailable_features = true; + check_unavailable_features(cpu_list_data->model, sc->model, + &info->unavailable_features); + } + object_unref(obj); + } entry = g_malloc0(sizeof(*entry)); entry->value = info; @@ -310,11 +353,20 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) { - CpuDefinitionInfoList *list = NULL; + struct CpuDefinitionInfoListData list_data = { + .list = NULL, + }; + + list_data.model = get_max_cpu_model(errp); + if (*errp) { + error_free(*errp); + *errp = NULL; + } - object_class_foreach(create_cpu_model_list, TYPE_S390_CPU, false, &list); + object_class_foreach(create_cpu_model_list, TYPE_S390_CPU, false, + &list_data); - return list; + return list_data.list; } static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info, |