From nobody Sat Nov 15 14:49:48 2025 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1750082586; cv=none; d=zohomail.com; s=zohoarc; b=GQbCySQKw0GZTfrH1NPczNQEVyI+WCIDWfaC4LhPshP14dsBsE80tGdWKeDEG8v2VK+dv8zd4fKft1HKCogr1RtzNjSkac8qwRxT6fKRGQEUt6riVACfu0P+QrqDkTg0trG/VDp7i179yQnMo8iSTUOnvSuBiy98fKFiZi7MyDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750082586; 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=nzJCdpa6pRup70FRm7V2FLPHDBNBprbu8bKymNgtLD4=; b=VSjeSc4Rk6OO6inO0aIqI3UUh4k2Rtjw688r8fbKB8steEdJ+zP4SVmVOP8ML/89lvKc8GQcx2oxiEFBXnyW6cDFQgzX4zTwHYJO2j6i+HNE8F1Hzuj+w05J57eEUnW/KHKZsgCPGXAHo8eDwhkAr0mu2HqGMyQpNtXyxcBMMVE= 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+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750082586837867.9652073452967; Mon, 16 Jun 2025 07:03:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uRAPK-0004gN-MU; Mon, 16 Jun 2025 10:01: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 1uRAOz-0004PX-6q; Mon, 16 Jun 2025 10:01:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uRAOw-0002iE-KB; Mon, 16 Jun 2025 10:01:32 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G5Sv6l021040; Mon, 16 Jun 2025 14:01:27 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4790tdt953-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:27 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55GC79Hj027475; Mon, 16 Jun 2025 14:01:26 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 479ksypgnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:25 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55GE1Mex28311828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2025 14:01:22 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1159E2004D; Mon, 16 Jun 2025 14:01:22 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C22CE20043; Mon, 16 Jun 2025 14:01:21 +0000 (GMT) Received: from a46lp68.lnxne.boe (unknown [9.152.108.100]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 16 Jun 2025 14:01:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=nzJCdpa6pRup70FRm 7V2FLPHDBNBprbu8bKymNgtLD4=; b=c4CcbR6mUC4W/kUhojXTaEEl4A59rxiMZ 5pCfZXebJ8NUoz2se2mWI7R15O47qNmWR6gHed7NDcM9VFgOV5Ja15Xuk+mscInK AJIf1FiR7A55i1eEiPHwIYxDWd1qmkyQ2wEfPBR+7XFjQcs0azLN6TajYZKNfKts 9fF2Y7w/56W903UR14sggUAmWY4GdL6ZMG5HMEpvXz7XHAOye6LwZ7iY7wxTQw9r pbTQiBdl+bJ/wW+toQUIXHhPtG3SLId3GsupkdkakZFM95DKsJDHCGu12aYd/1xY MkowQDARI+GwosvZ0/own+1qD/FdU/FfMEomfBUHuOrrkuUOo6X8w== From: Shalini Chellathurai Saroja To: qemu-s390x mailing list , Thomas Huth Cc: Daniel Berrange , qemu-devel mailing list , Nina Schoetterl-Glausch , Hendrik Brueckner , Shalini Chellathurai Saroja Subject: [PATCH v6 1/3] hw/s390x: add SCLP event type CPI Date: Mon, 16 Jun 2025 16:01:05 +0200 Message-ID: <20250616140107.990538-2-shalini@linux.ibm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250616140107.990538-1-shalini@linux.ibm.com> References: <20250616140107.990538-1-shalini@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: XQ80_kRPUVUpWH2UF-YhxRlOhiFYM9px X-Proofpoint-GUID: XQ80_kRPUVUpWH2UF-YhxRlOhiFYM9px X-Authority-Analysis: v=2.4 cv=c92rQQ9l c=1 sm=1 tr=0 ts=685023b7 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=20KFwNOVAAAA:8 a=4KQUGMdETVzdB9oGavsA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE2MDA4NyBTYWx0ZWRfX7uW1gAM9Zdd/ aizOfjnLuBxui2kqjHgHaPKVZ/R2/VytvOmFENRBIVq40EeCxnrMkYxFLpQOwLhp9X8BAvllUCu 16L8iLo6gZSeUSo8WQ+bkXSIeYS9EE146hzghU+uQADt+i12sGMolmfUkTX2na8nHznWYQ91G9B 1GCffmmcV7nPWUEagJEtsuC5+JocCW9Nw2h3eD5mp++vTD5iyGorkcCb+LgVuLyHXXp0BLsIehN VoZzVmd3x9iwk/hiCTBv8ViCtVT87jnq7GWsGLsgZQjDPUONPyakU89JkT8slte3/iC5kKzYdFI lpwP9VYxSZlDROUQLNTjlzj1B39vJsOcHybBuaNGBUF7JL5ZSeUnG+ONm6cocZctnFR1EUHmqI2 u/yyLj8TUHGaZ6y65j6PqcM5IzrJwACReZcbXoyXjf79v1zO6lu4PsP3hFiEURcZPRlysz75 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_06,2025-06-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 suspectscore=0 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506160087 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=shalini@linux.ibm.com; helo=mx0a-001b2d01.pphosted.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1750082589560116600 Content-Type: text/plain; charset="utf-8" Implement the Service-Call Logical Processor (SCLP) event type Control-Program Identification (CPI) in QEMU. This event is used to send CPI identifiers from the guest to the host. The CPI identifiers are: system type, system name, system level and sysplex name. System type: operating system of the guest (e.g. "LINUX "). System name: user configurable name of the guest (e.g. "TESTVM "). System level: distribution and kernel version, if the system type is Linux (e.g. 74872343805430528). Sysplex name: name of the cluster which the guest belongs to (if any) (e.g. "PLEX"). The SCLP event CPI is supported only from "s390-ccw-virtio-10.1" machine and higher. Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Thomas Huth --- hw/s390x/event-facility.c | 2 + hw/s390x/meson.build | 1 + hw/s390x/s390-virtio-ccw.c | 22 +++++ hw/s390x/sclpcpi.c | 124 +++++++++++++++++++++++++++++ include/hw/s390x/event-facility.h | 12 +++ include/hw/s390x/s390-virtio-ccw.h | 1 + 6 files changed, 162 insertions(+) create mode 100644 hw/s390x/sclpcpi.c diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 7b7bf237fe..fee286ea63 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -4,6 +4,7 @@ * handles SCLP event types * - Signal Quiesce - system power down * - ASCII Console Data - VT220 read and write + * - Control-Program Identification - Send OS data from guest to = host * * Copyright IBM, Corp. 2012 * @@ -40,6 +41,7 @@ struct SCLPEventFacility { SysBusDevice parent_obj; SCLPEventsBus sbus; SCLPEvent quiesce, cpu_hotplug; + SCLPEventCPI cpi; /* guest's receive mask */ union { uint32_t receive_mask_pieces[2]; diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index 99cbcbd7d6..1bc8583799 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -13,6 +13,7 @@ s390x_ss.add(files( 's390-skeys.c', 's390-stattrib.c', 'sclp.c', + 'sclpcpi.c', 'sclpcpu.c', 'sclpquiesce.c', 'tod.c', diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index ce3c13defb..a79bd13275 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -260,9 +260,21 @@ static void s390_create_sclpconsole(SCLPDevice *sclp, qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal); } =20 +static void s390_create_sclpcpi(SCLPDevice *sclp) +{ + SCLPEventFacility *ef =3D sclp->event_facility; + BusState *ev_fac_bus =3D sclp_get_event_facility_bus(ef); + DeviceState *dev; + + dev =3D qdev_new(TYPE_SCLP_EVENT_CPI); + object_property_add_child(OBJECT(ef), "sclpcpi", OBJECT(dev)); + qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal); +} + static void ccw_init(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); S390CcwMachineState *ms =3D S390_CCW_MACHINE(machine); int ret; VirtualCssBus *css_bus; @@ -323,6 +335,12 @@ static void ccw_init(MachineState *machine) =20 /* init the TOD clock */ s390_init_tod(); + + /* init SCLP event Control-Program Identification */ + if (s390mc->use_cpi) { + s390_create_sclpcpi(ms->sclp); + } + } =20 static void s390_cpu_plug(HotplugHandler *hotplug_dev, @@ -783,6 +801,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) DumpSKeysInterface *dsi =3D DUMP_SKEYS_INTERFACE_CLASS(oc); =20 s390mc->max_threads =3D 1; + s390mc->use_cpi =3D true; mc->reset =3D s390_machine_reset; mc->block_default_type =3D IF_VIRTIO; mc->no_cdrom =3D 1; @@ -908,6 +927,9 @@ static void ccw_machine_10_0_instance_options(MachineSt= ate *machine) =20 static void ccw_machine_10_0_class_options(MachineClass *mc) { + S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); + s390mc->use_cpi =3D false; + ccw_machine_10_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); } diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c new file mode 100644 index 0000000000..a0b175c5d5 --- /dev/null +++ b/hw/s390x/sclpcpi.c @@ -0,0 +1,124 @@ + /* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * SCLP event type 11 - Control-Program Identification (CPI): + * CPI is used to send program identifiers from the guest to the + * Service-Call Logical Processor (SCLP). It is not sent by the SCLP. + * + * Control-program identifiers provide data about the guest operating + * system. The control-program identifiers are: system type, system n= ame, + * system level and sysplex name. + * + * In Linux, all the control-program identifiers are user configurable= . The + * system type, system name, and sysplex name use EBCDIC characters fr= om + * this set: capital A-Z, 0-9, $, @, #, and blank. In Linux, the syst= em + * type, system name and sysplex name are arbitrary free-form texts. + * + * In Linux, the 8-byte hexadecimal system-level has the format + * 0x
, where: + * : is a 4-bit digit, its most significant bit indicates hyperviso= r use + * : is one digit that represents Linux distributions as follows + * 0: generic Linux + * 1: Red Hat Enterprise Linux + * 2: SUSE Linux Enterprise Server + * 3: Canonical Ubuntu + * 4: Fedora + * 5: openSUSE Leap + * 6: Debian GNU/Linux + * 7: Red Hat Enterprise Linux CoreOS + * : are two digits for a distribution-specific encoding of the ma= jor + * version of the distribution + *
: are two digits for a distribution-specific encoding of the mi= nor + * version of the distribution + * : are four digits for the patch level of the distribution + * : are two digits for the major version of the kernel + * : are two digits for the minor version of the kernel + * : are two digits for the stable version of the kernel + * (e.g. 74872343805430528, when converted to hex is 0x010a000000060b0= 0). On + * machines prior to z16, some of the values are not available to disp= lay. + * + * Sysplex refers to a cluster of logical partitions that communicates= and + * co-operates with each other. + * + * The CPI feature is supported since 10.1. + * + * Copyright IBM, Corp. 2024 + * + * Authors: + * Shalini Chellathurai Saroja + * + */ + +#include "qemu/osdep.h" +#include "hw/s390x/event-facility.h" + +typedef struct Data { + uint8_t id_format; + uint8_t reserved0; + uint8_t system_type[8]; + uint64_t reserved1; + uint8_t system_name[8]; + uint64_t reserved2; + uint64_t system_level; + uint64_t reserved3; + uint8_t sysplex_name[8]; + uint8_t reserved4[16]; +} QEMU_PACKED Data; + +typedef struct ControlProgramIdMsg { + EventBufferHeader ebh; + Data data; +} QEMU_PACKED ControlProgramIdMsg; + +static bool can_handle_event(uint8_t type) +{ + return type =3D=3D SCLP_EVENT_CTRL_PGM_ID; +} + +static sccb_mask_t send_mask(void) +{ + return 0; +} + +/* Enable SCLP to accept buffers of event type CPI from the control-progra= m. */ +static sccb_mask_t receive_mask(void) +{ + return SCLP_EVENT_MASK_CTRL_PGM_ID; +} + +static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_h= dr) +{ + ControlProgramIdMsg *cpim =3D container_of(evt_buf_hdr, ControlProgram= IdMsg, + ebh); + + cpim->ebh.flags =3D SCLP_EVENT_BUFFER_ACCEPTED; + return SCLP_RC_NORMAL_COMPLETION; +} + +static void cpi_class_init(ObjectClass *klass, const void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + SCLPEventClass *k =3D SCLP_EVENT_CLASS(klass); + + dc->user_creatable =3D false; + + k->can_handle_event =3D can_handle_event; + k->get_send_mask =3D send_mask; + k->get_receive_mask =3D receive_mask; + k->write_event_data =3D write_event_data; +} + +static const TypeInfo sclp_cpi_info =3D { + .name =3D TYPE_SCLP_EVENT_CPI, + .parent =3D TYPE_SCLP_EVENT, + .instance_size =3D sizeof(SCLPEventCPI), + .class_init =3D cpi_class_init, +}; + +static void sclp_cpi_register_types(void) +{ + type_register_static(&sclp_cpi_info); +} + +type_init(sclp_cpi_register_types) + diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index ff874e792d..e81bc80498 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -25,6 +25,7 @@ #define SCLP_EVENT_MESSAGE 0x02 #define SCLP_EVENT_CONFIG_MGT_DATA 0x04 #define SCLP_EVENT_PMSGCMD 0x09 +#define SCLP_EVENT_CTRL_PGM_ID 0x0b #define SCLP_EVENT_ASCII_CONSOLE_DATA 0x1a #define SCLP_EVENT_SIGNAL_QUIESCE 0x1d =20 @@ -35,6 +36,7 @@ #define SCLP_EVENT_MASK_MSG SCLP_EVMASK(SCLP_EVENT_MESSAGE) #define SCLP_EVENT_MASK_CONFIG_MGT_DATA SCLP_EVMASK(SCLP_EVENT_CONFIG_MGT_= DATA) #define SCLP_EVENT_MASK_PMSGCMD SCLP_EVMASK(SCLP_EVENT_PMSGCMD) +#define SCLP_EVENT_MASK_CTRL_PGM_ID SCLP_EVMASK(SCLP_EVENT_CTRL_PGM_ID) #define SCLP_EVENT_MASK_MSG_ASCII SCLP_EVMASK(SCLP_EVENT_ASCII_CONSO= LE_DATA) #define SCLP_EVENT_MASK_SIGNAL_QUIESCE SCLP_EVMASK(SCLP_EVENT_SIGNAL_QUIE= SCE) =20 @@ -191,6 +193,16 @@ struct SCLPEventClass { bool (*can_handle_event)(uint8_t type); }; =20 +#define TYPE_SCLP_EVENT_CPI "sclpcpi" +typedef struct SCLPEventCPIClass SCLPEventCPIClass; +typedef struct SCLPEventCPI SCLPEventCPI; +OBJECT_DECLARE_TYPE(SCLPEventCPI, SCLPEventCPIClass, + SCLP_EVENT_CPI) + +struct SCLPEventCPI { + SCLPEvent event; +}; + #define TYPE_SCLP_EVENT_FACILITY "s390-sclp-event-facility" typedef struct SCLPEventFacility SCLPEventFacility; typedef struct SCLPEventFacilityClass SCLPEventFacilityClass; diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 321b26df30..526078a4e2 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -54,6 +54,7 @@ struct S390CcwMachineClass { =20 /*< public >*/ int max_threads; + bool use_cpi; }; =20 #endif --=20 2.49.0 From nobody Sat Nov 15 14:49:48 2025 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1750082558; cv=none; d=zohomail.com; s=zohoarc; b=TC0gd4BHhv6zA/E5Ya2MS6qyCUAP1fy5QB6PRtpSrbKcdHK15T0QbnuRgwyEHXVV8Ze29IHIasom+zximaOIDp2tfv7HUhL1+moGy1C/f4tmEekE91amNVEgjQcRi6SIvSejQjMq37tqHqUp8k+B+aELEdVBwQgBMchcqsMLW0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750082558; 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=TvaKeCJ9wkuFXOPoD+ecHwOPzz4cDiIzrRBppoJJWik=; b=D3YaTZgQpyIFUvK3cjEy04FL9c2t59cfcEKEKXg0IAVUR8vmM6WdCdEvXGTuIjQoTX14iVnPHl3yQLaDVGWhZgGvZSkrQlyLOz/SanbGFiA8NRf1+uLcW7lXvoftEUonF+ov/ZI1cvwxPu0FxEAfv3EUIfWI2G4In4Jg06XQbNc= 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+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175008255796467.33657640180047; Mon, 16 Jun 2025 07:02:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uRAPB-0004d6-UQ; Mon, 16 Jun 2025 10:01:45 -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 1uRAP0-0004Rc-RB; Mon, 16 Jun 2025 10:01:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uRAOx-0002ii-BK; Mon, 16 Jun 2025 10:01:34 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G8kg2A001010; Mon, 16 Jun 2025 14:01:29 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 478ygn26c3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:29 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55GCM72T027540; Mon, 16 Jun 2025 14:01:28 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 479ksypgp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:28 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55GE1ODP35848660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2025 14:01:25 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBC9220043; Mon, 16 Jun 2025 14:01:24 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CBA620063; Mon, 16 Jun 2025 14:01:24 +0000 (GMT) Received: from a46lp68.lnxne.boe (unknown [9.152.108.100]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 16 Jun 2025 14:01:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=TvaKeCJ9wkuFXOPoD +ecHwOPzz4cDiIzrRBppoJJWik=; b=X1al+yhOUGernp6yYGK/YGPskN3O2eCcE apn6Qhrw6xtaNHM1xWT0k0Fhf40g+i3R6EJxF36eVZIDXYDL0osivW1CmfnvqIn+ iuhphSEyRDLxSP1vCFE2QYrsl79omwA0v00zWI4+Y0rT8tWXZolcwDaa3WS5+IKP bgrTc7KnuFKPF6s+V2cOkL5jFVekWemNv7ckOU3nI+mv1HDdIgfR20SznkyOY2iG rENrUBIO1nHe3BvtYZRVa6lrfiGrHt+ZcxkzIXbTL7YT0eYujA8htLLqgEi0h/Xi p8vw+OdVmBAyhiK1PF679yUNdOxb3XlhwmnHfe3mDAQeBUS+hSi1w== From: Shalini Chellathurai Saroja To: qemu-s390x mailing list , Thomas Huth Cc: Daniel Berrange , qemu-devel mailing list , Nina Schoetterl-Glausch , Hendrik Brueckner , Shalini Chellathurai Saroja Subject: [PATCH v6 2/3] hw/s390x: add Control-Program Identification to QOM Date: Mon, 16 Jun 2025 16:01:06 +0200 Message-ID: <20250616140107.990538-3-shalini@linux.ibm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250616140107.990538-1-shalini@linux.ibm.com> References: <20250616140107.990538-1-shalini@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE2MDA4NyBTYWx0ZWRfX0RyuGllT7W8r AB76JJVoDnNMQXSWExPPzMeRWVx0GDiN6NTXVkK37rW6Jie7UAjbIGEHfhBS003x7y1RtgGoeUK 3RgTkjwq/ExbizaUqbKKcCkvvPGlfHWgZ93x0L4LLT82GiDzHr/n3J8S9Z3eEoMRcrLs65FhXXb F9VKfKeib2uJvZOsLCI/tVEpa97Yr3vLQhIbr5rVq/Gwm4rGbCl76tPSFYmeaAm6mgSOqJXFISa Ylj4o8apXI9BWFkK8jRJDCsU7sXG3ZPUzyw+keznz1Jsbv+dd5mRncGfwp/cd5uWUmbIWg4p9fJ Ogl04qvgHx8x2xNQMT6Br1C90nlLixOiCRVVg6+tGA7iEtfhZdyBqZJp4U2xtaenn//OSWQEFE5 ge+LHSPBKcIGyf+XE1Kpi9+ijFCaeDlamUq+K90c7oteF3peFqKkTY7H2F8F10Xt05AhkTc0 X-Authority-Analysis: v=2.4 cv=fYSty1QF c=1 sm=1 tr=0 ts=685023b9 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=gMOc093ePyEJ564YuRcA:9 X-Proofpoint-ORIG-GUID: GFByneYb6mgkW962qC_II1E0CqO7C8ZJ X-Proofpoint-GUID: GFByneYb6mgkW962qC_II1E0CqO7C8ZJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_06,2025-06-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 mlxscore=0 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506160087 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=shalini@linux.ibm.com; helo=mx0b-001b2d01.pphosted.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1750082563391116600 Content-Type: text/plain; charset="utf-8" Add Control-Program Identification (CPI) data to the QEMU Object Model (QOM), along with the timestamp in which the data was received as shown below. virsh # qemu-monitor-command vm --pretty '{"execute":"qom-list", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi"}}' { "return": [ [...] { "name": "system_level", "type": "uint64" }, { "name": "system_name", "type": "string" }, { "name": "system_type", "type": "string" }, { "name": "timestamp", "type": "uint64" }, { "name": "sysplex_name", "type": "string" } ], "id": "libvirt-14" } Example CPI data: virsh # qemu-monitor-command vm --pretty '{"execute":"qom-get", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi", "property":"system_type"}}' { "return": "LINUX ", "id": "libvirt-18" } virsh # qemu-monitor-command vm --pretty '{"execute":"qom-get", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi", "property":"system_name"}}' { "return": "TESTVM ", "id": "libvirt-19" } virsh # qemu-monitor-command vm --pretty '{"execute":"qom-get", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi", "property":"sysplex_name"}}' { "return": "PLEX ", "id": "libvirt-20" } virsh # qemu-monitor-command vm --pretty '{"execute":"qom-get", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi", "property":"system_level"}}' { "return": 74872343805430528, "id": "libvirt-21" } virsh # qemu-monitor-command vm --pretty '{"execute":"qom-get", "arguments":{"path":"/machine/sclp/s390-sclp-event-facility/sclpcpi", "property":"timestamp"}}' { "return": 1748866753433923000, "id": "libvirt-22" } Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Thomas Huth --- hw/s390x/sclpcpi.c | 74 +++++++++++++++++++++++++++++++ include/hw/s390x/event-facility.h | 5 +++ 2 files changed, 79 insertions(+) diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index a0b175c5d5..352ef0461d 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -50,7 +50,10 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/timer.h" #include "hw/s390x/event-facility.h" +#include "hw/s390x/ebcdic.h" +#include "qapi/qapi-visit-machine.h" =20 typedef struct Data { uint8_t id_format; @@ -90,11 +93,58 @@ static int write_event_data(SCLPEvent *event, EventBuff= erHeader *evt_buf_hdr) { ControlProgramIdMsg *cpim =3D container_of(evt_buf_hdr, ControlProgram= IdMsg, ebh); + SCLPEventCPI *e =3D SCLP_EVENT_CPI(event); + + ascii_put(e->system_type, (char *)cpim->data.system_type, + sizeof(cpim->data.system_type)); + ascii_put(e->system_name, (char *)cpim->data.system_name, + sizeof(cpim->data.system_name)); + ascii_put(e->sysplex_name, (char *)cpim->data.sysplex_name, + sizeof(cpim->data.sysplex_name)); + e->system_level =3D ldq_be_p(&cpim->data.system_level); + e->timestamp =3D qemu_clock_get_ns(QEMU_CLOCK_HOST); =20 cpim->ebh.flags =3D SCLP_EVENT_BUFFER_ACCEPTED; return SCLP_RC_NORMAL_COMPLETION; } =20 +static char *get_system_type(Object *obj, Error **errp) +{ + SCLPEventCPI *e =3D SCLP_EVENT_CPI(obj); + + return g_strndup((char *) e->system_type, sizeof(e->system_type)); +} + +static char *get_system_name(Object *obj, Error **errp) +{ + SCLPEventCPI *e =3D SCLP_EVENT_CPI(obj); + + return g_strndup((char *) e->system_name, sizeof(e->system_name)); +} + +static char *get_sysplex_name(Object *obj, Error **errp) +{ + SCLPEventCPI *e =3D SCLP_EVENT_CPI(obj); + + return g_strndup((char *) e->sysplex_name, sizeof(e->sysplex_name)); +} + +static void get_system_level(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + SCLPEventCPI *e =3D SCLP_EVENT_CPI(obj); + + visit_type_uint64(v, name, &e->system_level, errp); +} + +static void get_timestamp(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + SCLPEventCPI *e =3D SCLP_EVENT_CPI(obj); + + visit_type_uint64(v, name, &e->timestamp, errp); +} + static void cpi_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -106,6 +156,30 @@ static void cpi_class_init(ObjectClass *klass, const v= oid *data) k->get_send_mask =3D send_mask; k->get_receive_mask =3D receive_mask; k->write_event_data =3D write_event_data; + + object_class_property_add_str(klass, "system_type", get_system_type, N= ULL); + object_class_property_set_description(klass, "system_type", + "operating system e.g. \"LINUX \""); + + object_class_property_add_str(klass, "system_name", get_system_name, N= ULL); + object_class_property_set_description(klass, "system_name", + "user configurable name of the VM e.g. \"TESTVM \""); + + object_class_property_add_str(klass, "sysplex_name", get_sysplex_name, + NULL); + object_class_property_set_description(klass, "sysplex_name", + "name of the cluster which the VM belongs to, if any" + " e.g. \"PLEX \""); + + object_class_property_add(klass, "system_level", "uint64", get_system_= level, + NULL, NULL, NULL); + object_class_property_set_description(klass, "system_level", + "distribution and kernel version in Linux e.g. 748723438054305= 28"); + + object_class_property_add(klass, "timestamp", "uint64", get_timestamp, + NULL, NULL, NULL); + object_class_property_set_description(klass, "timestamp", + "latest update of CPI data in nanoseconds since the UNIX EPOCH= "); } =20 static const TypeInfo sclp_cpi_info =3D { diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index e81bc80498..eac7a51100 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -201,6 +201,11 @@ OBJECT_DECLARE_TYPE(SCLPEventCPI, SCLPEventCPIClass, =20 struct SCLPEventCPI { SCLPEvent event; + uint8_t system_type[8]; + uint8_t system_name[8]; + uint64_t system_level; + uint8_t sysplex_name[8]; + uint64_t timestamp; }; =20 #define TYPE_SCLP_EVENT_FACILITY "s390-sclp-event-facility" --=20 2.49.0 From nobody Sat Nov 15 14:49:48 2025 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1750082524; cv=none; d=zohomail.com; s=zohoarc; b=CFBYo0nT1iSESjqtWLyyVa/Pymy3nznFT7mYcOn2zzIFaWyULWuZQ6JbY1fhonO6J6HtugkIyTlSGF3LSLsP1C2MHbCXQ6ivXaDnMT+UQsbV5DmTkdRatG/3lkaplwJMNQT/nDeXwFQbUVjfmC1YGLxIM30l2LIVX5UWtTAUVN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750082524; 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=723T+Pq0HfpZk9DgTjAAoBOMZVMsiA3NltSECIUmWfo=; b=OBiIrAAUMTCRyAp8nFlx5aLBMWj3PodlcwPJ915an7L8fFKhRlKY1M4DyfvDg2EyOGTcItT8ndptKFfEOGZYZn5vWRqQfNUkh/Pzs2W/YlNgpU5H6trUVpcZL1pCiXeUcY3x7uHB+eMKehUtqhl64I/OZ0niZi2NpWERtO4B5gA= 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+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750082524239948.1004632431155; Mon, 16 Jun 2025 07:02:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uRAPB-0004cA-IL; Mon, 16 Jun 2025 10:01:45 -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 1uRAP0-0004Rb-Pl; Mon, 16 Jun 2025 10:01:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uRAOy-0002j2-NB; Mon, 16 Jun 2025 10:01:34 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G9e6eg019152; Mon, 16 Jun 2025 14:01:31 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 478ygn26c9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:31 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55GAHhN0014436; Mon, 16 Jun 2025 14:01:30 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 479p4261ed-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 14:01:30 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55GE1QKw33686148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2025 14:01:26 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9BD382004D; Mon, 16 Jun 2025 14:01:26 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D23720040; Mon, 16 Jun 2025 14:01:26 +0000 (GMT) Received: from a46lp68.lnxne.boe (unknown [9.152.108.100]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 16 Jun 2025 14:01:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=723T+Pq0HfpZk9DgT jAAoBOMZVMsiA3NltSECIUmWfo=; b=Lwqg/WsNQEFWGhS4HzFv6dWxUgK83229M d6YL7bIeupqDPBV3mzZLJvHQo3Kigk/a5sIQCwGP1gbYvH22wS4o26KXpkBld4k4 DWsM7rDn2jtMycBlaFjV86gn9i8CH75qNL5L2RGsgNGm3SXGzIMmMKREtyNykWrR KJaZ6s0ztjn3Wn6zc8GXy2TauaBQ/jLsl1/AsRZ7bosXpiGdK4xbk7tRwY7WD5l6 dMHyVi3QrX8o5Ft+jFvz1F77qT8vIhrQNhRcExp4kOH8EQoSyUnxfG8bAGes87+q 1u1fowIqfaOPh+YqYNlYoMen0MR6Kj/0Ar8QomwQhR7SbnHZpzDrw== From: Shalini Chellathurai Saroja To: qemu-s390x mailing list , Thomas Huth Cc: Daniel Berrange , qemu-devel mailing list , Nina Schoetterl-Glausch , Hendrik Brueckner , Shalini Chellathurai Saroja Subject: [PATCH v6 3/3] hw/s390x: support migration of CPI data Date: Mon, 16 Jun 2025 16:01:07 +0200 Message-ID: <20250616140107.990538-4-shalini@linux.ibm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250616140107.990538-1-shalini@linux.ibm.com> References: <20250616140107.990538-1-shalini@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE2MDA4NyBTYWx0ZWRfX9lMC0JrypPFt teJqHJEwX1fTVqI4fieKHSCrxzhmu6SQb4dN3odJV+oI44JBUI4aXMQosHO71i7FbcCRuU2f2lD 58fb/lMDUSAaa8PtuoKdf42LDZv/fik7F9ITNtrjdwkAqRydl13NaVAQW5d42eULxIbVSh65VdG puuXG8xUZYqdy3phrqjEDb4PUO+UEz/KHbdgjk221zRMmTNZ3pdWomcJ5jvXg4+TLIUpgc/NKx3 rK9q6amgSqe/GE4aCE4xqBBKPHibG69+TDCE8EaZrCOuus3oa/JVphL++PegM8ojlrspTTRW7/j S4QupfdlXA4yKlNeeL8p7+zck3l6262VVXmmjI9ywGGkHEHsMqvsqGIJBNSFNZ1lhxnAOo609l8 tvyrpJMU5fLgeumDhu7EJ5bcuC43Ro0xPKLuVT9Th9uB4oRCNc+Ikjma9iZAOg6SEc2fA7T1 X-Authority-Analysis: v=2.4 cv=fYSty1QF c=1 sm=1 tr=0 ts=685023bb cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=20KFwNOVAAAA:8 a=IYUaZ1EJS4Y0mmBzySsA:9 X-Proofpoint-ORIG-GUID: RftVm_pSE5nfckn9Y62mUVGiqnq_ST6V X-Proofpoint-GUID: RftVm_pSE5nfckn9Y62mUVGiqnq_ST6V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_06,2025-06-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 mlxscore=0 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506160087 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=shalini@linux.ibm.com; helo=mx0b-001b2d01.pphosted.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1750082525847116600 Content-Type: text/plain; charset="utf-8" Register Control-Program Identification data with the live migration infrastructure. Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Thomas Huth --- hw/s390x/sclpcpi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index 352ef0461d..88012f2279 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -54,6 +54,7 @@ #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" #include "qapi/qapi-visit-machine.h" +#include "migration/vmstate.h" =20 typedef struct Data { uint8_t id_format; @@ -145,12 +146,26 @@ static void get_timestamp(Object *obj, Visitor *v, co= nst char *name, visit_type_uint64(v, name, &e->timestamp, errp); } =20 +static const VMStateDescription vmstate_sclpcpi =3D { + .name =3D "s390_control_program_id", + .version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT8_ARRAY(system_type, SCLPEventCPI, 8), + VMSTATE_UINT8_ARRAY(system_name, SCLPEventCPI, 8), + VMSTATE_UINT64(system_level, SCLPEventCPI), + VMSTATE_UINT8_ARRAY(sysplex_name, SCLPEventCPI, 8), + VMSTATE_UINT64(timestamp, SCLPEventCPI), + VMSTATE_END_OF_LIST() + } +}; + static void cpi_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); SCLPEventClass *k =3D SCLP_EVENT_CLASS(klass); =20 dc->user_creatable =3D false; + dc->vmsd =3D &vmstate_sclpcpi; =20 k->can_handle_event =3D can_handle_event; k->get_send_mask =3D send_mask; --=20 2.49.0