From nobody Tue Oct 28 20:55:28 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513171526360584.7346555162502; Wed, 13 Dec 2017 05:25:26 -0800 (PST) Received: from localhost ([::1]:35525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP72E-000368-A0 for importer@patchew.org; Wed, 13 Dec 2017 08:25:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP71D-0002m9-95 for qemu-devel@nongnu.org; Wed, 13 Dec 2017 08:24:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eP71A-0000KX-21 for qemu-devel@nongnu.org; Wed, 13 Dec 2017 08:24:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eP719-0000GS-Pz; Wed, 13 Dec 2017 08:24:11 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7ABC8765E; Wed, 13 Dec 2017 13:24:10 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-206.ams2.redhat.com [10.36.117.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBDF75D720; Wed, 13 Dec 2017 13:24:08 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org Date: Wed, 13 Dec 2017 14:24:07 +0100 Message-Id: <20171213132407.5227-1-david@redhat.com> In-Reply-To: <20171208165529.14124-1-david@redhat.com> References: <20171208165529.14124-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 13 Dec 2017 13:24:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1] s390x/cpumodel: make qemu cpu model play with "none" machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Cornelia Huck , David Hildenbrand , Alexander Graf , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make sure "-cpu qemu" works with "-M none". Signed-off-by: David Hildenbrand --- Conny, if this is okay, can you squash with the original patch? hw/s390x/s390-virtio-ccw.c | 4 ---- target/s390x/cpu_models.c | 7 +++++-- target/s390x/gen-features.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c1f96418fa..466e45343c 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -725,10 +725,6 @@ bool css_migration_enabled(void) =20 static void ccw_machine_2_12_instance_options(MachineState *machine) { - static const S390FeatInit qemu_cpu_feat =3D { S390_FEAT_LIST_QEMU_V2_1= 2 }; - - /* with 2.12 we emulated a stripped down zEC12 (GA 2) */ - s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat); } =20 static void ccw_machine_2_12_class_options(MachineClass *mc) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7404ef52c6..212a5f0697 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -1122,8 +1122,6 @@ static void s390_qemu_cpu_model_initfn(Object *obj) S390CPU *cpu =3D S390_CPU(obj); =20 cpu->model =3D g_malloc0(sizeof(*cpu->model)); - /* has to be initialized by now via s390_set_qemu_cpu_model() */ - g_assert(s390_qemu_cpu_model.def); /* copy the CPU model so we can modify it */ memcpy(cpu->model, &s390_qemu_cpu_model, sizeof(*cpu->model)); } @@ -1266,6 +1264,7 @@ static void init_ignored_base_feat(void) =20 static void register_types(void) { + static const S390FeatInit qemu_latest_init =3D { S390_FEAT_LIST_QEMU_L= ATEST }; int i; =20 init_ignored_base_feat(); @@ -1281,6 +1280,10 @@ static void register_types(void) s390_cpu_defs[i].full_feat); } =20 + /* initialize the qemu model with latest definition */ + s390_set_qemu_cpu_model(QEMU_MAX_CPU_TYPE, QEMU_MAX_CPU_GEN, + QEMU_MAX_CPU_EC_GA, qemu_latest_init); + for (i =3D 0; i < ARRAY_SIZE(s390_cpu_defs); i++) { char *base_name =3D s390_base_cpu_type_name(s390_cpu_defs[i].name); TypeInfo ti_base =3D { diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 983f2dcd52..deace660e1 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -544,7 +544,7 @@ static uint16_t qemu_V2_11[] =3D { S390_FEAT_ZARCH, }; =20 -static uint16_t qemu_V2_12[] =3D { +static uint16_t qemu_LATEST[] =3D { S390_FEAT_DAT_ENH, S390_FEAT_IDTE_SEGMENT, S390_FEAT_STFLE, @@ -685,7 +685,7 @@ static FeatGroupDefSpec FeatGroupDef[] =3D { *******************************/ static FeatGroupDefSpec QemuFeatDef[] =3D { QEMU_FEAT_INITIALIZER(V2_11), - QEMU_FEAT_INITIALIZER(V2_12), + QEMU_FEAT_INITIALIZER(LATEST), QEMU_FEAT_INITIALIZER(MAX), }; =20 --=20 2.14.3