From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.7084.1646227930932743649 for ; Wed, 02 Mar 2022 05:32:11 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Vei6ppMB; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: sebastien.boeuf@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646227930; x=1677763930; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jNW2ZYxjJjjhiXgPQo0AglygxqpmGwvjfeEI+ueraDM=; b=Vei6ppMBegGqx1fmlxBgfURqHy3gtjPvdPBCn4JLt3KEtLzFWlCccKEG yzoIjGty6dNnblbLtKYphXKxOqPLOWYOQbJDSnufZHleAo3J1i7AMmbxu XfBQNc2wUItAZaG3zsGtY4NwYLepJ7Q25Bi+CDh5G6IxJznJ149eQFDzm fFy7xCTcEqxELqcxxlu9Ch956uYHg9F6nZTqyNU3MXDgrmunZ3O2QFY4x c83oFfNcby4YnBiXA25cc6kPg8bRLaCTFSgG2hsz0mD8YxyNu2meMX2EL U7tMX8PRAOMOsxuRTcKYJZ5sJEAHtfAv8ea/7W+2trmEs90zozOGjDwcj w==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="233365251" X-IronPort-AV: E=Sophos;i="5.90,149,1643702400"; d="scan'208";a="233365251" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 05:32:10 -0800 X-IronPort-AV: E=Sophos;i="5.90,149,1643702400"; d="scan'208";a="535389277" Received: from spearce-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.27.130]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 05:32:08 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [PATCH v6 3/8] OvmfPkg: Xen: Generate fdf include file from ELF header generator Date: Wed, 2 Mar 2022 14:31:32 +0100 Message-Id: <5b6b7ace7554eafc75ce1113cc029b89744bec2a.1646227817.git.sebastien.boeuf@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Sebastien Boeuf Updating the fdf include file based on the run of the ELF header generator. The diff from this patch is the result of: $ gcc -o elf_gen OvmfPkg/OvmfXenElfHeaderGenerator.c $ ./elf_gen 2097152 OvmfPkg/XenElfHeader.fdf.inc Acked-by: Gerd Hoffmann Signed-off-by: Sebastien Boeuf --- OvmfPkg/XenElfHeader.fdf.inc | 60 ++++++++++++------------------------ 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/OvmfPkg/XenElfHeader.fdf.inc b/OvmfPkg/XenElfHeader.fdf.inc index dbc1305d25..c4f04ad28b 100644 --- a/OvmfPkg/XenElfHeader.fdf.inc +++ b/OvmfPkg/XenElfHeader.fdf.inc @@ -8,57 +8,35 @@ ## = DATA =3D { - # - # This hex array have been generated by OvmfPkg/OvmfXenElfHeaderGenerato= r.c - # and copied manually. - # # ELF file header - 0x7f, 0x45, 0x4c, 0x46, # e_ident[0..3]: Magic number - 0x01, # File class: 32-bit objects - 0x01, # Data encoding: 2's complement, little endian - 0x01, # File version - 0x03, # OS ABI identification: Object uses GNU ELF extensions - 0x00, # ABI version - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # e_ident[EI_PAD...] - 0x02, 0x00, # e_type =3D Executable file - 0x03, 0x00, # e_machine =3D Intel 80386 - 0x01, 0x00, 0x00, 0x00, # e_version - 0xd0, 0xff, 0x2f, 0x00, # e_entry: Entry point virtual address - 0x34, 0x00, 0x00, 0x00, # e_phoff: Program header table file offset - 0x00, 0x00, 0x00, 0x00, # e_shoff: Section header table file offset - 0x00, 0x00, 0x00, 0x00, # e_flags: Processor-specific flags - 0x34, 0x00, # e_ehsize: ELF header size - 0x20, 0x00, # e_phentsize: Program header table entry size - 0x02, 0x00, # e_phnum: Program header table entry count - 0x00, 0x00, # e_shentsize: Section header table entry size - 0x00, 0x00, # e_shnum: Section header table entry count - 0x00, 0x00, # e_shstrndx + 0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, = 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, + 0xd0, 0xff, 0x2f, 0x00, # hdr.e_entry + 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, = 0x34, 0x00, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, = # ELF Program segment headers # - Load segment - 0x01, 0x00, 0x00, 0x00, # p_type =3D Loadable program segment - 0x00, 0x00, 0x00, 0x00, # p_offset - 0x00, 0x00, 0x10, 0x00, # p_vaddr: Segment virtual address - 0x00, 0x00, 0x10, 0x00, # p_paddr: Segment physical address - 0x00, 0x00, 0x20, 0x00, # p_filesz: Segment size in file - 0x00, 0x00, 0x20, 0x00, # p_memsz: Segment size in memory - 0x07, 0x00, 0x00, 0x00, # p_flags =3D Segment is executable | writable |= readable - 0x00, 0x00, 0x00, 0x00, # p_align + 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x20, 0x00, + 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, # - ELFNOTE segment - 0x04, 0x00, 0x00, 0x00, # p_type =3D PT_NOTE - 0x74, 0x00, 0x00, 0x00, # p_offset =3D point to XEN_ELFNOTE_PHYS32_ENTRY= below + 0x04, 0x00, 0x00, 0x00, + 0x74, 0x00, 0x00, 0x00, 0x74, 0x00, 0x10, 0x00, 0x74, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, # p_flags =3D Segment is readable + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, = # XEN_ELFNOTE_PHYS32_ENTRY - 0x04, 0x00, 0x00, 0x00, # name size - 0x04, 0x00, 0x00, 0x00, # desc size - 0x12, 0x00, 0x00, 0x00, # type =3D XEN_ELFNOTE_PHYS32_ENTRY - 0x58, 0x65, 0x6e, 0x00, # name =3D "Xen" - 0xd0, 0xff, 0x2f, 0x00, # desc: PVH entry point - 0x00 + 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, + 0x58, 0x65, 0x6e, 0x00, + 0xd0, 0xff, 0x2f, 0x00 } -- = 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, = 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.