From nobody Wed Mar 12 16:36:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1740601122217668.4276160660461; Wed, 26 Feb 2025 12:18:42 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 22B0C196C; Wed, 26 Feb 2025 15:18:41 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 3A3E01951; Wed, 26 Feb 2025 15:16:52 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7244B17B9; Wed, 26 Feb 2025 15:16:47 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7DBED191E for ; Wed, 26 Feb 2025 15:16:35 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-91-4trrRQeRPxqYfkK4p_kYHQ-1; Wed, 26 Feb 2025 15:16:31 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A852D1800871 for ; Wed, 26 Feb 2025 20:16:30 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.44.33.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5040B300018D; Wed, 26 Feb 2025 20:16:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740600995; 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=YNJdtsU/XYgQnvnSkZtfoS4h6atxQ9EAafocSR0ETME=; b=Q8NOsn0FTl7VfIbWxQ2KJUzuFQhQL0jYdKFnFruUqKZKuSylQoSkhytMd1go1MbgaYojp9 LIIfSjmcPlvhuLzZp0DD/IsjIjlKKp8OOF9/jr3EtJ9t5qvM2eRZ8g67HVoctVKXJlNntA ix8sQRqkIOfjllb6ZlbZ1ujhN405qQQ= X-MC-Unique: 4trrRQeRPxqYfkK4p_kYHQ-1 X-Mimecast-MFC-AGG-ID: 4trrRQeRPxqYfkK4p_kYHQ_1740600990 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: devel@lists.libvirt.org Subject: [PATCH v2 3/7] src: introduce 'raw' and 'rawset' ACPI table types Date: Wed, 26 Feb 2025 20:16:15 +0000 Message-ID: <20250226201619.2730066-4-berrange@redhat.com> In-Reply-To: <20250226201619.2730066-1-berrange@redhat.com> References: <20250226201619.2730066-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ViHJuojZbOAdtNQKxGsxPbrdNdw2T2DYz13TT6knRt0_1740600990 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: PCZC5WQK4CSIYVZR3SNQYZT2WELQMSJO X-Message-ID-Hash: PCZC5WQK4CSIYVZR3SNQYZT2WELQMSJO X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Victor Toso X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1740601123642019100 Content-Type: text/plain; charset="utf-8" The QEMU driver has only accepted type=3Dslic even though QEMU is able to accept individual tables of any type, without needing to specify a signature. Introduce type=3Draw to address this usage scenario. Contrary to other types, this one may appear multiple times. The Xen driver has mistakenly accepted type=3Dslic and use it to set the Xen acpi_firmware setting, which performs a simple passthrough of multiple concatenated data table. Introduce type=3Drawset to address this usage scenario. Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/formatdomain.rst | 19 ++++++++++++++++--- src/conf/domain_conf.c | 5 ++++- src/conf/domain_conf.h | 2 ++ src/conf/schemas/domaincommon.rng | 6 +++++- src/libxl/libxl_domain.c | 7 +++++++ src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_validate.c | 7 +++++++ 7 files changed, 43 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index fdb3c2459e..d3add663e2 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -490,9 +490,22 @@ These options apply to any form of booting of the gues= t OS. ... =20 ``acpi`` - The ``table`` element contains a fully-qualified path to the ACPI table= . The - ``type`` attribute contains the ACPI table type (currently only ``slic`= ` is - supported) :since:`Since 1.3.5 (QEMU)` :since:`Since 5.9.0 (Xen)` + The ``table`` element contains a fully-qualified path to the ACPI table, + with the ``type`` attribute dictating what data must be present in the + file: + + * ``raw``: a single ACPI table with header and data, with ACPI + signature auto-detected from header (:since:`Since 11.2.0`). + * ``rawset``: concatenation of multiple ACPI tables with header + and data, each with any ACPI signature, auto-detected from header + (:since:`Since 11.2.0`). + * ``slic``: a single ACPI table with header and data, providing + software licensing information. The ACPI table signature in the + header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`, + mis-interpreted as ``rawset`` :since:`Since 5.9.0 (Xen)`). + + Each type may be used only once, except for ``raw`` which can + appear multiple times. =20 =20 SMBIOS System Information diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fc8ed9fc54..530473e200 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1459,6 +1459,8 @@ VIR_ENUM_IMPL(virDomainOsDefFirmwareFeature, =20 VIR_ENUM_IMPL(virDomainOsACPITable, VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST, + "raw", + "rawset", "slic", ); =20 @@ -17925,7 +17927,8 @@ virDomainDefParseBootAcpiOptions(virDomainDef *def, goto error; =20 for (j =3D 0; j < i; j++) { - if (tables[j]->type =3D=3D type) { + if (tables[j]->type =3D=3D type && + type !=3D VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW) { virReportError(VIR_ERR_XML_ERROR, _("ACPI table type '%1$s' may only appear o= nce"), virDomainOsACPITableTypeToString(type)); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cc9fd503fa..299e2cbd5b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2475,6 +2475,8 @@ typedef enum { VIR_ENUM_DECL(virDomainOsDefFirmwareFeature); =20 typedef enum { + VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW, + VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET, VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC, =20 VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 824da9d066..b5eaf7c233 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -7180,7 +7180,11 @@ - slic + + raw + rawset + slic + diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index efd01840de..e564d9e5fe 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -336,6 +336,13 @@ libxlDomainDefValidate(const virDomainDef *def, case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC: break; =20 + case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW: + case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("ACPI table type '%1$s' is not supported"), + virDomainOsACPITableTypeToString(def->os.acpiTa= bles[i]->type)); + return -1; + default: case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST: virReportEnumRangeError(virDomainOsACPITable, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6048c755fc..bef06049ec 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -130,6 +130,8 @@ VIR_ENUM_IMPL(qemuNumaPolicy, VIR_ENUM_DECL(qemuACPITableSIG); VIR_ENUM_IMPL(qemuACPITableSIG, VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST, + "", /* raw */ + "", /* rawset */ "SLIC"); =20 =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 1759ab4e6e..de36bfc7ea 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -747,6 +747,13 @@ qemuValidateDomainDefBoot(const virDomainDef *def, case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC: break; =20 + case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW: + case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("ACPI table type '%1$s' is not supported"), + virDomainOsACPITableTypeToString(def->os.acpiTa= bles[i]->type)); + return -1; + default: case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST: virReportEnumRangeError(virDomainOsACPITable, --=20 2.47.1