From nobody Sun Apr 12 05:51:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@amazon.com; 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=quarantine dis=none) header.from=amazon.com ARC-Seal: i=1; a=rsa-sha256; t=1772057425; cv=none; d=zohomail.com; s=zohoarc; b=BXeojIVwnyVqWAkaynPfiFRTdbJWrmDgu4din+3OZ3U+wky80mDoAfDaMYA6PdoN0nDNF4btl/aqG/pgc2WUk9pgsrHy9nSO2RnF2EVJgWs3XdJfkGSXdZ1VcSGuzjrwxHEmxhfrw6pDZ8jIOqYlBOTC39VbHmkPXtcndub5PyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772057425; 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=aglmDwrScyQmZ1Gqv0UlX8GtgDjIcpToIs7+LnpYPK0=; b=cLmlAN7kT37X1i4gUq0R1jQoLahZPXiKFlwZeYnWjIpGmYU82mADfTMO1K376uDCXVGqjt9jTv+bKQjRp5k+o9Rcs71PYDt7vrAp2R4yhUaK63NLjaJ1rGUt0b9khjlk8QInFBXZAstePFHO4CqC0BU+oyp7OZL1MKXxO61E2LY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@amazon.com; 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177205742532740.85527227722321; Wed, 25 Feb 2026 14:10:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vvN4p-0000kh-Ct; Wed, 25 Feb 2026 17:09:51 -0500 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 1vvN4n-0000XJ-2o; Wed, 25 Feb 2026 17:09:49 -0500 Received: from pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com ([44.246.77.92]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vvN4l-00014U-5d; Wed, 25 Feb 2026 17:09:48 -0500 Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2026 22:09:41 +0000 Received: from EX19MTAUWB001.ant.amazon.com [205.251.233.104:21869] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.7.80:2525] with esmtp (Farcaster) id 18b0d670-d589-478e-b7b6-f111fa7c8e0c; Wed, 25 Feb 2026 22:09:41 +0000 (UTC) Received: from EX19D020UWC004.ant.amazon.com (10.13.138.149) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Wed, 25 Feb 2026 22:09:39 +0000 Received: from ip-10-253-83-51.amazon.com (172.19.99.218) by EX19D020UWC004.ant.amazon.com (10.13.138.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Wed, 25 Feb 2026 22:09:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1772057387; x=1803593387; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aglmDwrScyQmZ1Gqv0UlX8GtgDjIcpToIs7+LnpYPK0=; b=d69VVNS7JdblEOo1l8HQB0OWjRPSQrTNGVIa3uajI9j3aY1HPFHYfrwA a2MjZgrx5yZcBqTSu+bgqFRR479FE9GBfmYESMMah18sphR1UHBVwjFl/ BwvuGtXcg98rg2X6g3gqXU/j58BlkZ5sDPKd5dZSUXitIyZHOD4hR+07I UmGAc2U/B/jgkH4W8MC8n9TRvRMEqrOBp/Sp5GjHs361Rd2ExU6E9krtP E5zWZiOHnBgfW3tO9v2dc1GTsLlzgmJz2ggR7j13+SRV9/92RI+yJJhaR K7+EWeLIwEVffOMLlUkrkJ17NvexQtvoLRZkHHoAPJV36ksLr0El3nGm4 w==; X-CSE-ConnectionGUID: QJJbUWzbRPe2oCJ8dEeq0w== X-CSE-MsgGUID: dVwlD+X0RaKRZRKRkfXZPw== X-IronPort-AV: E=Sophos;i="6.21,311,1763424000"; d="scan'208";a="13796753" X-Farcaster-Flow-ID: 18b0d670-d589-478e-b7b6-f111fa7c8e0c From: Alexander Graf To: CC: , Peter Maydell , "Thomas Huth" , , , , , Cornelia Huck , , Dorjoy Chowdhury , Pierrick Bouvier , Paolo Bonzini , Tyler Fanelli , , Subject: [PATCH v3 09/11] hw/core/eif: Move definitions to header Date: Wed, 25 Feb 2026 22:08:03 +0000 Message-ID: <20260225220807.33092-10-graf@amazon.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260225220807.33092-1-graf@amazon.com> References: <20260225220807.33092-1-graf@amazon.com> MIME-Version: 1.0 X-Originating-IP: [172.19.99.218] X-ClientProxiedBy: EX19D035UWA003.ant.amazon.com (10.13.139.86) To EX19D020UWC004.ant.amazon.com (10.13.138.149) Content-Transfer-Encoding: quoted-printable 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=44.246.77.92; envelope-from=prvs=509822c20=graf@amazon.de; helo=pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.734, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.78, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @amazon.com) X-ZM-MESSAGEID: 1772057426939158500 Content-Type: text/plain; charset="utf-8" In follow-up patches we need some EIF file definitions that are currently in the eif.c file, but want to access them from a separate device. Move them into the header instead. Signed-off-by: Alexander Graf Reviewed-by: Dorjoy Chowdhury --- hw/core/eif.c | 38 -------------------------------------- hw/core/eif.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/hw/core/eif.c b/hw/core/eif.c index 513caec6b4..96f1d76578 100644 --- a/hw/core/eif.c +++ b/hw/core/eif.c @@ -18,44 +18,6 @@ =20 #include "hw/core/eif.h" =20 -#define MAX_SECTIONS 32 - -/* members are ordered according to field order in .eif file */ -typedef struct EifHeader { - uint8_t magic[4]; /* must be .eif in ascii i.e., [46, 101, 105, 102] = */ - uint16_t version; - uint16_t flags; - uint64_t default_memory; - uint64_t default_cpus; - uint16_t reserved; - uint16_t section_cnt; - uint64_t section_offsets[MAX_SECTIONS]; - uint64_t section_sizes[MAX_SECTIONS]; - uint32_t unused; - uint32_t eif_crc32; -} QEMU_PACKED EifHeader; - -/* members are ordered according to field order in .eif file */ -typedef struct EifSectionHeader { - /* - * 0 =3D invalid, 1 =3D kernel, 2 =3D cmdline, 3 =3D ramdisk, 4 =3D si= gnature, - * 5 =3D metadata - */ - uint16_t section_type; - uint16_t flags; - uint64_t section_size; -} QEMU_PACKED EifSectionHeader; - -enum EifSectionTypes { - EIF_SECTION_INVALID =3D 0, - EIF_SECTION_KERNEL =3D 1, - EIF_SECTION_CMDLINE =3D 2, - EIF_SECTION_RAMDISK =3D 3, - EIF_SECTION_SIGNATURE =3D 4, - EIF_SECTION_METADATA =3D 5, - EIF_SECTION_MAX =3D 6, -}; - static const char *section_type_to_string(uint16_t type) { const char *str; diff --git a/hw/core/eif.h b/hw/core/eif.h index fed3cb5514..a3412377a9 100644 --- a/hw/core/eif.h +++ b/hw/core/eif.h @@ -11,6 +11,44 @@ #ifndef HW_CORE_EIF_H #define HW_CORE_EIF_H =20 +#define MAX_SECTIONS 32 + +/* members are ordered according to field order in .eif file */ +typedef struct EifHeader { + uint8_t magic[4]; /* must be .eif in ascii i.e., [46, 101, 105, 102] = */ + uint16_t version; + uint16_t flags; + uint64_t default_memory; + uint64_t default_cpus; + uint16_t reserved; + uint16_t section_cnt; + uint64_t section_offsets[MAX_SECTIONS]; + uint64_t section_sizes[MAX_SECTIONS]; + uint32_t unused; + uint32_t eif_crc32; +} QEMU_PACKED EifHeader; + +/* members are ordered according to field order in .eif file */ +typedef struct EifSectionHeader { + /* + * 0 =3D invalid, 1 =3D kernel, 2 =3D cmdline, 3 =3D ramdisk, 4 =3D si= gnature, + * 5 =3D metadata + */ + uint16_t section_type; + uint16_t flags; + uint64_t section_size; +} QEMU_PACKED EifSectionHeader; + +enum EifSectionTypes { + EIF_SECTION_INVALID =3D 0, + EIF_SECTION_KERNEL =3D 1, + EIF_SECTION_CMDLINE =3D 2, + EIF_SECTION_RAMDISK =3D 3, + EIF_SECTION_SIGNATURE =3D 4, + EIF_SECTION_METADATA =3D 5, + EIF_SECTION_MAX =3D 6, +}; + bool read_eif_file(const char *eif_path, const char *machine_initrd, char **kernel_path, char **initrd_path, char **kernel_cmdline, uint8_t *image_sha384, --=20 2.47.1 Amazon Web Services Development Center Germany GmbH Tamara-Danz-Str. 13 10243 Berlin Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B Sitz: Berlin Ust-ID: DE 365 538 597