From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323268; cv=none; d=zohomail.com; s=zohoarc; b=iOiswffAcba8lBtwA+al2z7Ot4IJ1xOJRaQslvbovGu0HSKdPP8NOroDoP/5I8vrFOD7Pxq2R6IfQB+uE4LfY6XjghG+dzl6W0sOF5qyYAY0jhTzTmd8+TU74/6NYjhz5FYHeayHtmRlp8MTRH0C/nMrYklSHJGxVtTZz+n1sNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323268; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=86wRfkA3hBKLpNjKdLNE24fLjC5pAZ7BRrZdE2lPbj4=; b=LGzeukkKxth/iZ4lCTqTyvzvWc3VXky4aALGXyrttKmkDkEVwsEFg9nDDhr7Xbx92+fyN/9QKD7OyTn8DDLFvkyotJ0JxkvTHdLgTa5rGlCxwao3AoBU1xmXovaT7SqxY6PRUsb+0yYtB/wH6Xc/mNCoqkqATHMPPNwn7WWebjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323268254766.7486157964788; Thu, 9 May 2024 23:41:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Jw5-0001JN-LP; Fri, 10 May 2024 02:40:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvT-00015r-RJ for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvR-0001Y0-Be for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:14 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-556-gjc_RWWzNMqPamttv_igVQ-1; Fri, 10 May 2024 02:40:05 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 639B7185A78E; Fri, 10 May 2024 06:40:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C3512079267; Fri, 10 May 2024 06:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=86wRfkA3hBKLpNjKdLNE24fLjC5pAZ7BRrZdE2lPbj4=; b=I4iwNoetvsFHx+CcVztKRMmQ2OzUxGnBvc2aE9ppihyWF3+M/oYA22PJelC4rMIPlP3GBq pxUr0STq/XlCOpoz4Rsci643GdVN8SrZECnNk13FV7y3yArcgJlfUuyneq6ZRpcjVZR8/d 0A8MJqIeN4eiEJDM21dDou8xh/OwK3M= X-MC-Unique: gjc_RWWzNMqPamttv_igVQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Eric Farman , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/8] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Date: Fri, 10 May 2024 08:39:54 +0200 Message-ID: <20240510064001.26002-2-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323269472100001 The sclpconsole currently does not have a proper parent in the QOM tree, so it shows up under /machine/unattached - which is somewhat ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility where the other devices of type TYPE_SCLP_EVENT already reside. Message-ID: <20240430190843.453903-1-thuth@redhat.com> Reviewed-by: Eric Farman Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4dcc213820..726c2ab436 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -239,11 +239,13 @@ static void s390_create_virtio_net(BusState *bus, con= st char *name) =20 static void s390_create_sclpconsole(const char *type, Chardev *chardev) { + BusState *ev_fac_bus =3D sclp_get_event_facility_bus(); DeviceState *dev; =20 dev =3D qdev_new(type); + object_property_add_child(OBJECT(ev_fac_bus->parent), type, OBJECT(dev= )); qdev_prop_set_chr(dev, "chardev", chardev); - qdev_realize_and_unref(dev, sclp_get_event_facility_bus(), &error_fata= l); + qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal); } =20 static void ccw_init(MachineState *machine) --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323268; cv=none; d=zohomail.com; s=zohoarc; b=hqPT8ed5XeuiXS4mtbyPSDkwap/tCa6AjIctmodS/q5IevVKZDvf9/A54UO5Rae0A+L7PU4KHyAtBZUgcxVPRib4cKTlFh4tTNKpW2GWVQHadTZqRBCWGRtd8MfSBamUNEIoBaoeIe3O9AslBnsGBLK5r0wIhYlkEdAomd0iqFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323268; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9IMt1Iki+bGdU0k9hfLiLzd7efUNV5kkdo6ol/E5A5Y=; b=GgCVsiGwOaZ+zTSnkARHRSZgu9TzuFPrt3gR/QZAGo5+PmEzqAbOcDJV/bEo6XwTEw3tEICQDuABztUPWlV/B+d7zZDSdmQogWeRZLVXpzEzBP+S2E1F/jxTcdDhrLZEjO7aEWZ3Np1mQsyoAGVzGCmTocUxNajBgLRSsstpLng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323268221782.1474526944917; Thu, 9 May 2024 23:41:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Jvp-0001AW-CM; Fri, 10 May 2024 02:40:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvR-00015W-4Z for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvO-0001X9-Dl for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:12 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-GTH30Qg8Owe6FbaVklMCkw-1; Fri, 10 May 2024 02:40:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F64D801211; Fri, 10 May 2024 06:40:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA8722079B08; Fri, 10 May 2024 06:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9IMt1Iki+bGdU0k9hfLiLzd7efUNV5kkdo6ol/E5A5Y=; b=XwhjGJFx5V8pKXXQhzjlg+EcRDLYuun1ZEa00T0j1jVZEKujGMFsuIs9snU4qWLEQLFnd6 kvduTpBzqetWaihravtbXQ1UWRt17oFl37E7uf0kyVMwKqO1WMVQ74VM019ZJfHsnHQF0q huSNhJsgkY5PAi0pkVG5gMInTdP7Wbs= X-MC-Unique: GTH30Qg8Owe6FbaVklMCkw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 2/8] s390x: Introduce a SCLPDevice pointer under the machine Date: Fri, 10 May 2024 08:39:55 +0200 Message-ID: <20240510064001.26002-3-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323269490100004 From: C=C3=A9dric Le Goater Initialize directly SCLPDevice from the machine init handler and remove s390_sclp_init(). We will use the SCLPDevice pointer later to create the consoles. Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20240502131533.377719-2-clg@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- include/hw/s390x/s390-virtio-ccw.h | 3 +++ include/hw/s390x/sclp.h | 2 -- hw/s390x/s390-virtio-ccw.c | 6 +++++- hw/s390x/sclp.c | 10 ---------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index c1d46e78af..7605d06bff 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -13,6 +13,7 @@ =20 #include "hw/boards.h" #include "qom/object.h" +#include "hw/s390x/sclp.h" =20 #define TYPE_S390_CCW_MACHINE "s390-ccw-machine" =20 @@ -28,6 +29,8 @@ struct S390CcwMachineState { bool dea_key_wrap; bool pv; uint8_t loadparm[8]; + + SCLPDevice *sclp; }; =20 #define S390_PTF_REASON_NONE (0x00 << 8) diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index b405a387b6..d32f6180e0 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -221,8 +221,6 @@ static inline int sccb_data_len(SCCB *sccb) return be16_to_cpu(sccb->h.length) - sizeof(sccb->h); } =20 - -void s390_sclp_init(void); void sclp_service_interrupt(uint32_t sccb); void raise_irq_cpu_hotplug(void); int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 726c2ab436..159f67d05c 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -251,11 +251,15 @@ static void s390_create_sclpconsole(const char *type,= Chardev *chardev) static void ccw_init(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + S390CcwMachineState *ms =3D S390_CCW_MACHINE(machine); int ret; VirtualCssBus *css_bus; DeviceState *dev; =20 - s390_sclp_init(); + ms->sclp =3D SCLP(object_new(TYPE_SCLP)); + object_property_add_child(OBJECT(machine), TYPE_SCLP, OBJECT(ms->sclp)= ); + qdev_realize_and_unref(DEVICE(ms->sclp), NULL, &error_fatal); + /* init memory + setup max page size. Required for the CPU model */ s390_memory_init(machine->ram); =20 diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 893e71a41b..d236dbaf0b 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -378,16 +378,6 @@ void sclp_service_interrupt(uint32_t sccb) } =20 /* qemu object creation and initialization functions */ - -void s390_sclp_init(void) -{ - Object *new =3D object_new(TYPE_SCLP); - - object_property_add_child(qdev_get_machine(), TYPE_SCLP, new); - object_unref(new); - qdev_realize(DEVICE(new), NULL, &error_fatal); -} - static void sclp_realize(DeviceState *dev, Error **errp) { MachineState *machine =3D MACHINE(qdev_get_machine()); --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323268; cv=none; d=zohomail.com; s=zohoarc; b=NmVEWvYbdpBVosyLVz/NUOktNLOBXXGnkyM70MX5aazJfGQwU2Q0cF1LUUWnMurl6ErYY4OudmqDbYpB8DalbCi4wGeA1HGROEh0jHphs5W3A56DqmOoeJ/kfuMys0aii0F94d0asi2DRqVonE2xtTG+2HloDEZ1tLo97zrQKHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323268; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LK7VKeHEgef+sRxRXZXJculo3eBN1bpcKjAtwE2gzYU=; b=fRP8KqTgeQTjkp7wI2pwHo4Dc6zCuqxXEeBOgt7oGxHnF7/NcUb+4vTqOVB8SPatdgNNDWUvwG59xl0EfoiwvHDylW7lt6SmJrVFtCTdxLeAZm0NWPs6kkqRwyYPBxEDaBGhVtOWr3tLdQUTI4bi8bVvmB3czcdh0vs0LCAlNvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323268849277.20240169172655; Thu, 9 May 2024 23:41:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Jvx-0001H3-Na; Fri, 10 May 2024 02:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvS-00015l-77 for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvP-0001Xg-Gz for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:12 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-VGjXC725PQCzs-gWrfV98g-1; Fri, 10 May 2024 02:40:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D11A73C00090; Fri, 10 May 2024 06:40:08 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86E1E2079267; Fri, 10 May 2024 06:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LK7VKeHEgef+sRxRXZXJculo3eBN1bpcKjAtwE2gzYU=; b=ATWsgQONRNC5ohXZttR+BrJOr0UJnfWM19WA5BBPjALl69+Vco44P1UAQ77uDXPnAbyXsw r0dUcQMQsKbj1DPO2UQP7N24E1N9KhwjfuQxz29bKYHwRH4WKCEbA1xA7J7b0xoJ852D1K hDoLgnbEQSOi8Wwix/bivrNjZO3gaQI= X-MC-Unique: VGjXC725PQCzs-gWrfV98g-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 3/8] s390x/event-facility: Simplify sclp_get_event_facility_bus() Date: Fri, 10 May 2024 08:39:56 +0200 Message-ID: <20240510064001.26002-4-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323269484100003 From: C=C3=A9dric Le Goater sclp_get_event_facility_bus() scans the whole machine to find a TYPE_SCLP_EVENTS_BUS object. The SCLPDevice instance is now available under the machine state, use it to simplify the lookup and adjust the creation of the consoles. Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20240502131533.377719-3-clg@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- include/hw/s390x/event-facility.h | 2 +- hw/s390x/event-facility.c | 13 ++----------- hw/s390x/s390-virtio-ccw.c | 12 +++++++----- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index 3ffd575d8f..ff874e792d 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -203,6 +203,6 @@ struct SCLPEventFacilityClass { bool (*event_pending)(SCLPEventFacility *ef); }; =20 -BusState *sclp_get_event_facility_bus(void); +BusState *sclp_get_event_facility_bus(SCLPEventFacility *ef); =20 #endif diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index f9829de953..06c1da0ece 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -523,16 +523,7 @@ static void register_types(void) =20 type_init(register_types) =20 -BusState *sclp_get_event_facility_bus(void) +BusState *sclp_get_event_facility_bus(SCLPEventFacility *ef) { - Object *busobj; - SCLPEventsBus *sbus; - - busobj =3D object_resolve_path_type("", TYPE_SCLP_EVENTS_BUS, NULL); - sbus =3D OBJECT_CHECK(SCLPEventsBus, busobj, TYPE_SCLP_EVENTS_BUS); - if (!sbus) { - return NULL; - } - - return &sbus->qbus; + return BUS(&ef->sbus); } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 159f67d05c..2afaf45ce6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -237,13 +237,15 @@ static void s390_create_virtio_net(BusState *bus, con= st char *name) } } =20 -static void s390_create_sclpconsole(const char *type, Chardev *chardev) +static void s390_create_sclpconsole(SCLPDevice *sclp, + const char *type, Chardev *chardev) { - BusState *ev_fac_bus =3D sclp_get_event_facility_bus(); + SCLPEventFacility *ef =3D sclp->event_facility; + BusState *ev_fac_bus =3D sclp_get_event_facility_bus(ef); DeviceState *dev; =20 dev =3D qdev_new(type); - object_property_add_child(OBJECT(ev_fac_bus->parent), type, OBJECT(dev= )); + object_property_add_child(OBJECT(ef), type, OBJECT(dev)); qdev_prop_set_chr(dev, "chardev", chardev); qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal); } @@ -308,10 +310,10 @@ static void ccw_init(MachineState *machine) =20 /* init consoles */ if (serial_hd(0)) { - s390_create_sclpconsole("sclpconsole", serial_hd(0)); + s390_create_sclpconsole(ms->sclp, "sclpconsole", serial_hd(0)); } if (serial_hd(1)) { - s390_create_sclpconsole("sclplmconsole", serial_hd(1)); + s390_create_sclpconsole(ms->sclp, "sclplmconsole", serial_hd(1)); } =20 /* init the TOD clock */ --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323294; cv=none; d=zohomail.com; s=zohoarc; b=kOQgOnEzwLZrBfdXl7bd2C/XW4bmEygy3qyZpxYL5Fga7g5I5Fmq7DzGvy8Zq/0EDG1+SbhKSwT1YA50/hCR+DM8vgsqIXrRbU+dOIO/ie/GNGUSGlnAISjGTuB5p8KdeW2WKJ9YUglqHcIbW+rnRa0ZLXNjW9IFgRfGhjnh6uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323294; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tnQHlqbpbwtC41oePd9E7PL+QKFsjDBZiYZDh48F+io=; b=TiWkd7ffOD/Dewolzh0vMg4wFBf8oBjhvHAqzCfcS91AO5J3e/HdJh94FJpHu1PUwyX7b53KlSB29YINK86+Xlmy9+d5mwU5d3oDk7n06YCI+8bmR5CEXsFROu8b/0pAkSvAu+wMo0FtefRRyYLDNxF6/lcxovZq0n7OYz19BLU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171532329421294.94708849760798; Thu, 9 May 2024 23:41:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5JwH-0001Nl-SV; Fri, 10 May 2024 02:41:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jvd-00017c-To for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvR-0001Y4-EI for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-QI7Tx3fiMJK61xFSjblK7Q-1; Fri, 10 May 2024 02:40:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DCB13800206; Fri, 10 May 2024 06:40:10 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51C4D2087D72; Fri, 10 May 2024 06:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tnQHlqbpbwtC41oePd9E7PL+QKFsjDBZiYZDh48F+io=; b=K6KPNk0HmPI/tw8xuuaojDL922Y67xMXB+TtB9aMZMtTI+iDjx0FIJWq++ivk6Uid5d4Lm QRC6FujgE6dup8XZSXWL4WhyV9bd8Xn3hnheCQHPtJt06WnQ3Uv4N1Ya8lYgKDhSHD2k2T deJxbM0Gitvex0BqrfbvbLOIB23e5ZA= X-MC-Unique: QI7Tx3fiMJK61xFSjblK7Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 4/8] s390x/sclp: Simplify get_sclp_device() Date: Fri, 10 May 2024 08:39:57 +0200 Message-ID: <20240510064001.26002-5-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323295311100001 From: C=C3=A9dric Le Goater get_sclp_device() scans the whole machine to find a TYPE_SCLP object. Now that the SCLPDevice instance is available under the machine state, use it to simplify the lookup. While at it, remove the inline to let the compiler decide on how to optimize. Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20240502131533.377719-4-clg@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- hw/s390x/sclp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index d236dbaf0b..e725dcd5fd 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -21,13 +21,14 @@ #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/ipl.h" #include "hw/s390x/cpu-topology.h" +#include "hw/s390x/s390-virtio-ccw.h" =20 -static inline SCLPDevice *get_sclp_device(void) +static SCLPDevice *get_sclp_device(void) { static SCLPDevice *sclp; =20 if (!sclp) { - sclp =3D SCLP(object_resolve_path_type("", TYPE_SCLP, NULL)); + sclp =3D S390_CCW_MACHINE(qdev_get_machine())->sclp; } return sclp; } --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323285; cv=none; d=zohomail.com; s=zohoarc; b=EwVOIZhb2LWMDCIJq0xLXQ4tZI54AxAMfPwCLOZANembI80DZ8z1tjVDlE51cxu+/KHOK+oIrMBJMZDyvNUEa+5ygJzLuwNEr+3i37UB1t542j6SkLEjbdtIm+bJ6ZCEop1/zNggwBUtEkjZ9HCr1nnN8I/JWqUenvMZLrBEMBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323285; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6xpWUrTrwmb2sPbB/T2wVkMw6wkiEdIERa3LN5Dp9G8=; b=Cax7Ri06wbu9Jb4zBpIZOUG+xCIIS2mX9AG4V2R4dMlCuATR76AaYoMz1+Sc93Mx9DcF8hp4EA6fbioFPNr8l9CVTdd9pHoKV9Dcnk+qGFM8gfUxeU2bkKIgOOkiUINJBdqL7vlPZr6TKC6+YXZOMbzkZm5leJ66ilEJgNeTQqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323285462492.9988251881215; Thu, 9 May 2024 23:41:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5JwA-0001LC-Tf; Fri, 10 May 2024 02:40:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jvc-00017V-Oz for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvU-0001YX-7z for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:24 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-AY87wLXuO9-lB1ZvE_pTJw-1; Fri, 10 May 2024 02:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 800E01C05145; Fri, 10 May 2024 06:40:12 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30D042079267; Fri, 10 May 2024 06:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6xpWUrTrwmb2sPbB/T2wVkMw6wkiEdIERa3LN5Dp9G8=; b=fX8eXKcdO7t6dXpZKNiEZckNhnEWuu9ImRlpZP/+Ix/reK7lm8l5ihMpkd7S99OYcE6NoB Plif9uWjFp/1xQcDiIvGmEbz4I+7vOudkx4FjnTrwvVpFojSrSbOSLGQ0nHIr5xngP8u45 VQH518YltCVwNZlaRxMxEk7R8VFdi0w= X-MC-Unique: AY87wLXuO9-lB1ZvE_pTJw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Collin Walling , Markus Armbruster , David Hildenbrand Subject: [PULL 5/8] target/s390x: report deprecated-props in cpu-model-expansion reply Date: Fri, 10 May 2024 08:39:58 +0200 Message-ID: <20240510064001.26002-6-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323287290100003 Content-Type: text/plain; charset="utf-8" From: Collin Walling Retain a list of deprecated features disjoint from any particular CPU model. A query-cpu-model-expansion reply will now provide a list of properties (i.e. features) that are flagged as deprecated. Example: { "return": { "model": { "name": "z14.2-base", "deprecated-props": [ "bpb", "csske" ], "props": { "pfmfi": false, "exrl": true, ...a lot more props... "skey": false, "vxpdeh2": false } } } } It is recommended that s390 guests operate with these features explicitly disabled to ensure compatibility with future hardware. Signed-off-by: Collin Walling Acked-by: Markus Armbruster Reviewed-by: David Hildenbrand Message-ID: <20240429191059.11806-2-walling@linux.ibm.com> Signed-off-by: Thomas Huth --- qapi/machine-target.json | 7 ++++++- target/s390x/cpu_features.h | 1 + target/s390x/cpu_features.c | 14 ++++++++++++++ target/s390x/cpu_models_sysemu.c | 8 ++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 29e695aa06..2942853092 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -20,11 +20,16 @@ # # @props: a dictionary of QOM properties to be applied # +# @deprecated-props: a list of properties that are flagged as deprecated +# by the CPU vendor. These props are a subset of the full model's +# definition list of properties. (since 9.1) +# # Since: 2.8 ## { 'struct': 'CpuModelInfo', 'data': { 'name': 'str', - '*props': 'any' } } + '*props': 'any', + '*deprecated-props': ['str'] } } =20 ## # @CpuModelExpansionType: diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index a9bd68a2e1..661a8cd6db 100644 --- a/target/s390x/cpu_features.h +++ b/target/s390x/cpu_features.h @@ -69,6 +69,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S3= 90FeatType type, uint8_t *data); void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque, void (*fn)(const char *name, void *opaque)); +void s390_get_deprecated_features(S390FeatBitmap features); =20 /* Definition of a CPU feature group */ typedef struct { diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index d28eb65845..efafc9711c 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -212,6 +212,20 @@ void s390_feat_bitmap_to_ascii(const S390FeatBitmap fe= atures, void *opaque, }; } =20 +void s390_get_deprecated_features(S390FeatBitmap features) +{ + static const int feats[] =3D { + /* CSSKE is deprecated on newer generations */ + S390_FEAT_CONDITIONAL_SSKE, + S390_FEAT_BPB, + }; + int i; + + for (i =3D 0; i < ARRAY_SIZE(feats); i++) { + set_bit(feats[i], features); + } +} + #define FEAT_GROUP_INIT(_name, _group, _desc) \ { \ .name =3D _name, \ diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sys= emu.c index 15be729c3d..977fbc6522 100644 --- a/target/s390x/cpu_models_sysemu.c +++ b/target/s390x/cpu_models_sysemu.c @@ -206,6 +206,14 @@ static void cpu_info_from_model(CpuModelInfo *info, co= nst S390CPUModel *model, } else { info->props =3D QOBJECT(qdict); } + + /* features flagged as deprecated */ + bitmap_zero(bitmap, S390_FEAT_MAX); + s390_get_deprecated_features(bitmap); + + bitmap_and(bitmap, bitmap, model->def->full_feat, S390_FEAT_MAX); + s390_feat_bitmap_to_ascii(bitmap, &info->deprecated_props, list_add_fe= at); + info->has_deprecated_props =3D !!info->deprecated_props; } =20 CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType= type, --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323324; cv=none; d=zohomail.com; s=zohoarc; b=PgPqYlnJ9FFLn4SRJOm4Qcy24Du5KQWwZXevDlMSdf/WCT4TPPTz0qeWaIcgJf/laWALD2yIZjbpAGa2QQRBvEzwc2KpMAEI1Tivkt02BnDQh2fy4IOlXii5IJGEfE0HkdVvTUctmcFrSylZLGrnBn9YpiZhpaYg+vRx91iQ2lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323324; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lyN2wHv1ijdGz2Ma84Ruv6QsDQCxtoidDGw13yagQg8=; b=GpKA3al4gzsEWkOZphN+W8URgHI7oKUWtPkJwk5jtUg3Q0MwcTEC2u1DzPiY6g0loh0qbbkslIkkjH+xtgMXAcb9tbENBEJxd5lKHjUxagObhu7zsI/pC+itGdMCsSHpT/LigC3EczIqt0REevdf3FJgGl2i4vgndop33tbBxCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323324625107.43669660959108; Thu, 9 May 2024 23:42:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5JwH-0001N7-Dn; Fri, 10 May 2024 02:41:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jvc-00017L-HK for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvW-0001Ys-Ta for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:24 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-pdffeqLHN_-M7E5vqETdyw-1; Fri, 10 May 2024 02:40:14 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79F143C0E642; Fri, 10 May 2024 06:40:14 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 195E32079267; Fri, 10 May 2024 06:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lyN2wHv1ijdGz2Ma84Ruv6QsDQCxtoidDGw13yagQg8=; b=Gie1GSGmaNE2fPfMwK5Dz6wOIsItzMBqHLnZTp42Ke/3E2hvbwhTmQFqcAB52JTEYJpozw BdTs+zpOpCvSb0jbhpC4568NJ18v882o7UI3qkL9zgrqrIKrOZcj3OS7jCO39lEXet6m+f TMw978iieNC2BwlzuoU4RmOKS54D+QA= X-MC-Unique: pdffeqLHN_-M7E5vqETdyw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Collin Walling , David Hildenbrand Subject: [PULL 6/8] target/s390x: flag te and cte as deprecated Date: Fri, 10 May 2024 08:39:59 +0200 Message-ID: <20240510064001.26002-7-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323325463100001 Content-Type: text/plain; charset="utf-8" From: Collin Walling Add the CONSTRAINT_TRANSACTIONAL_EXE (cte) and TRANSACTIONAL_EXE (te) to the list of deprecated features. Signed-off-by: Collin Walling Reviewed-by: David Hildenbrand Message-ID: <20240429191059.11806-3-walling@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/cpu_features.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index efafc9711c..cb4e2b8920 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -218,6 +218,9 @@ void s390_get_deprecated_features(S390FeatBitmap featur= es) /* CSSKE is deprecated on newer generations */ S390_FEAT_CONDITIONAL_SSKE, S390_FEAT_BPB, + /* Deprecated on z16 */ + S390_FEAT_CONSTRAINT_TRANSACTIONAL_EXE, + S390_FEAT_TRANSACTIONAL_EXE }; int i; =20 --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323300; cv=none; d=zohomail.com; s=zohoarc; b=AQGalM4gZxCnTR82oezLN50k3omZEh9U1u+rYIH/x/fZA41uKj4jhSeoCUhaYgFyW0vs7lf22cwOhkiquG3MNVds/wNzBW2/tGZt8zgxdhEe5tD/H0CYyKJhOAHYalGZTUohAr8eZjt6W3VdRGzxyM7f9zd0oljkTZX2f9CjtcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323300; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Nd+475C9gFveQQ9v96nw/BgXcs4ZqBPdYgTk/af/SC8=; b=nvwY3EufaVCNjzDJWdoy+UKABbt/2fsgjmk3y5/Z4HH+9OgaX1VCVk8nmsKS2r4D/EiZZZ+1gyumWRNq+zMMdqkvRmjAfVcJQC6ctmduxs0wL7RhW8FVzGxBtCmck53G2brMZh30QexfzPCQNdmFAT/ph+RVY4l+j9ghSxjJXAc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323300485734.0485495104068; Thu, 9 May 2024 23:41:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Jvu-0001FM-Sn; Fri, 10 May 2024 02:40:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jvd-00017e-WC for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5JvZ-0001ZA-In for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-OzyRQs8_M0qxBp5FbMkzkA-1; Fri, 10 May 2024 02:40:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 45D8E800A03; Fri, 10 May 2024 06:40:16 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB2A82079267; Fri, 10 May 2024 06:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nd+475C9gFveQQ9v96nw/BgXcs4ZqBPdYgTk/af/SC8=; b=TdEIyef6BdXYQF9JES2S1tUoXUMaVPwNE0/3XlNeQxoIYu8t0FvdyH5BpzqlXpyxeBTbI+ 9EKO5EKpShoQwFMVDs8GAHKgYyH1+EXzJRr+2cCmitJfLJiMh4Ybyzb1F/mnPAjqzG0URQ V0sB4gDqEqpoR27impRkEkhTyfCWQ/c= X-MC-Unique: OzyRQs8_M0qxBp5FbMkzkA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 7/8] qemu-options: Deprecate "-runas" and introduce "-run-with user=..." instead Date: Fri, 10 May 2024 08:40:00 +0200 Message-ID: <20240510064001.26002-8-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323301362100001 The old "-runas" option has the disadvantage that it is not visible in the QAPI schema, so it is not available via the normal introspection mechanisms. We've recently introduced the "-run-with" option for exactly this purpose, which is meant to handle the options that affect the runtime behavior. Thus let's introduce a "user=3D..." parameter here now and deprecate the old "-runas" option. Message-ID: <20240506112058.51446-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 6 ++++++ system/vl.c | 15 +++++++++++++++ qemu-options.hx | 15 +++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e22acb17f2..6f709746db 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -61,6 +61,12 @@ configurations (e.g. -smp drawers=3D1,books=3D1,clusters= =3D1 for x86 PC machine) is marked deprecated since 9.0, users have to ensure that all the topology me= mbers described with -smp are supported by the target machine. =20 +``-runas`` (since 9.1) +---------------------- + +Use ``-run-with user=3D..`` instead. + + User-mode emulator command line arguments ----------------------------------------- =20 diff --git a/system/vl.c b/system/vl.c index 7756eac81e..b031427440 100644 --- a/system/vl.c +++ b/system/vl.c @@ -773,6 +773,10 @@ static QemuOptsList qemu_run_with_opts =3D { .name =3D "chroot", .type =3D QEMU_OPT_STRING, }, + { + .name =3D "user", + .type =3D QEMU_OPT_STRING, + }, { /* end of list */ } }, }; @@ -3586,6 +3590,7 @@ void qemu_init(int argc, char **argv) break; #if defined(CONFIG_POSIX) case QEMU_OPTION_runas: + warn_report("-runas is deprecated, use '-run-with user=3D.= ..' instead"); if (!os_set_runas(optarg)) { error_report("User \"%s\" doesn't exist" " (and is not :)", @@ -3612,6 +3617,16 @@ void qemu_init(int argc, char **argv) if (str) { os_set_chroot(str); } + str =3D qemu_opt_get(opts, "user"); + if (str) { + if (!os_set_runas(str)) { + error_report("User \"%s\" doesn't exist" + " (and is not :)", + optarg); + exit(1); + } + } + break; } #endif /* CONFIG_POSIX */ diff --git a/qemu-options.hx b/qemu-options.hx index cf61f6b863..f5c01eeeb4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4824,7 +4824,8 @@ DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ SRST ``-runas user`` Immediately before starting guest execution, drop root privileges, - switching to the specified user. + switching to the specified user. This option is deprecated, use + ``-run-with user=3D...`` instead. ERST =20 DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, @@ -4990,13 +4991,15 @@ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, ""= , QEMU_ARCH_ALL) =20 #ifdef CONFIG_POSIX DEF("run-with", HAS_ARG, QEMU_OPTION_run_with, - "-run-with [async-teardown=3Don|off][,chroot=3Ddir]\n" + "-run-with [async-teardown=3Don|off][,chroot=3Ddir][user=3Dusername|ui= d:gid]\n" " Set miscellaneous QEMU process lifecycle options:\n" " async-teardown=3Don enables asynchronous teardown (Li= nux only)\n" - " chroot=3Ddir chroot to dir just before starting the V= M\n", + " chroot=3Ddir chroot to dir just before starting the V= M\n" + " user=3Dusername switch to the specified user before s= tarting the VM\n" + " user=3Duid:gid ditto, but use specified user-ID and g= roup-ID instead\n", QEMU_ARCH_ALL) SRST -``-run-with [async-teardown=3Don|off][,chroot=3Ddir]`` +``-run-with [async-teardown=3Don|off][,chroot=3Ddir][user=3Dusername|uid:g= id]`` Set QEMU process lifecycle options. =20 ``async-teardown=3Don`` enables asynchronous teardown. A new process c= alled @@ -5013,6 +5016,10 @@ SRST ``chroot=3Ddir`` can be used for doing a chroot to the specified direc= tory immediately before starting the guest execution. This is especially us= eful in combination with -runas. + + ``user=3Dusername`` or ``user=3Duid:gid`` can be used to drop root pri= vileges + by switching to the specified user (via username) or user and group + (via uid:gid) immediately before starting guest execution. ERST #endif =20 --=20 2.45.0 From nobody Mon Apr 6 19:10:56 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715323342; cv=none; d=zohomail.com; s=zohoarc; b=HbebP0kegl9NvRNuWEe/QKgmkF0VZod/VQ+EkqYXaU0kQqNlVtdxCHt+UB+wPrUJB9M04nN47lOeGeMd40J5nHEF36soDyy447FeomZhZAebDjvxGbGA7O5aMj/m/zQkI0+LvGphqqZP4LKhHt3PP3HvEYvnfJKvYTUDbGzTqY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715323342; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1YrFwTifzcXCgtn8nac43KEmXtUZ2NyyytKwMCkBfxw=; b=HtQNZwJk7bP4AFpWeLUzLpvLqI4O0ZQrzaaoM5v50aEjEtSfE5yB0evUiIeL8NhDErWfeY5gt7eAS948HrmOhGZcJJ0cDJMAzeraL+qrRF33Jd42X04VyklmtiLyo1xvTCpW4cgyfkdrrMo8HSlgpVAVveYIcYGvDnqc7vA3CCs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715323342420974.661606775219; Thu, 9 May 2024 23:42:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5JwI-0001Om-Mo; Fri, 10 May 2024 02:41:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jvd-00017d-W4 for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Jva-0001ZM-Fs for qemu-devel@nongnu.org; Fri, 10 May 2024 02:40:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-qkXCWDNBMza0mmbPcv_-0A-1; Fri, 10 May 2024 02:40:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55BC9185A780; Fri, 10 May 2024 06:40:18 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAAE52079267; Fri, 10 May 2024 06:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715323221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1YrFwTifzcXCgtn8nac43KEmXtUZ2NyyytKwMCkBfxw=; b=Dqzu//xy+RkdFDiksn3HmHN0CDTcOR8q3mnqrmoUGlPezHyxVRk+DTuVuN+xsD6z0EIkVg T/zlMiDc88knSNQdJn/DuHYlqOmcNFsW48JUetuWAXiAg2tXDZxmKVjR2+NYH4R2nVHAGO 9fA71XuweDJHxd3et5/0j2GJX2zuCN0= X-MC-Unique: qkXCWDNBMza0mmbPcv_-0A-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Bibo Mao Subject: [PULL 8/8] tests/qtest: Add some test cases support on LoongArch Date: Fri, 10 May 2024 08:40:01 +0200 Message-ID: <20240510064001.26002-9-thuth@redhat.com> In-Reply-To: <20240510064001.26002-1-thuth@redhat.com> References: <20240510064001.26002-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715323343898100002 Content-Type: text/plain; charset="utf-8" From: Bibo Mao Add boot-serial-test and filter test cases support on LoongArch system. Signed-off-by: Bibo Mao Message-ID: <20240509084745.2514607-1-maobibo@loongson.cn> Signed-off-by: Thomas Huth --- tests/qtest/boot-serial-test.c | 10 ++++++++++ tests/qtest/meson.build | 3 +++ 2 files changed, 13 insertions(+) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index e3b7d65fe5..df389adeeb 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -26,6 +26,14 @@ static const uint8_t bios_avr[] =3D { 0x80, 0x93, 0xc6, 0x00, /* sts 0x00C6, r24 ; Output 'T' */ }; =20 +static const uint8_t bios_loongarch64[] =3D { + 0x0c, 0xc0, 0x3f, 0x14, /* lu12i.w $t0, 0x1fe00 */ + 0x8c, 0x81, 0x87, 0x03, /* ori $t0, $t0, 0x1e0 */ + 0x0d, 0x50, 0x81, 0x03, /* li.w $t1, 'T' */ + 0x8d, 0x01, 0x00, 0x29, /* st.b $t1, $t0, 0 */ + 0xff, 0xf3, 0xff, 0x53, /* b -16 # loop */ +}; + static const uint8_t kernel_mcf5208[] =3D { 0x41, 0xf9, 0xfc, 0x06, 0x00, 0x00, /* lea 0xfc060000,%a0 */ 0x10, 0x3c, 0x00, 0x54, /* move.b #'T',%d0 */ @@ -167,6 +175,8 @@ static const testdef_t tests[] =3D { { "sparc", "SS-600MP", "", "TMS390Z55" }, { "sparc64", "sun4u", "", "UltraSPARC" }, { "s390x", "s390-ccw-virtio", "", "device" }, + { "loongarch64", "virt", "-cpu max", "TT", sizeof(bios_loongarch64), + NULL, bios_loongarch64 }, { "m68k", "mcf5208evb", "", "TT", sizeof(kernel_mcf5208), kernel_mcf52= 08 }, { "m68k", "next-cube", "", "TT", sizeof(bios_nextcube), 0, bios_nextcu= be }, { "microblaze", "petalogix-s3adsp1800", "", "TT", diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 6f2f594ace..86293051dc 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -139,6 +139,9 @@ qtests_hppa =3D ['boot-serial-test'] + \ qtests_filter + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 +qtests_loongarch64 =3D qtests_filter + \ + ['boot-serial-test'] + qtests_m68k =3D ['boot-serial-test'] + \ qtests_filter =20 --=20 2.45.0