From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 30 Jul 2019 02:25:28 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A762481DE3; Tue, 30 Jul 2019 09:25:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C1D060856; Tue, 30 Jul 2019 09:25:26 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 05/35] OvmfPkg/OvmfXen: Creating an ELF header To: devel@edk2.groups.io, anthony.perard@citrix.com Cc: Julien Grall , xen-devel@lists.xenproject.org, Jordan Justen , Ard Biesheuvel References: <20190729153944.24239-1-anthony.perard@citrix.com> <20190729153944.24239-6-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <12d1d4e4-715d-8e7b-585b-5324a40a17ff@redhat.com> Date: Tue, 30 Jul 2019 11:25:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190729153944.24239-6-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 30 Jul 2019 09:25:27 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/29/19 17:39, Anthony PERARD wrote: > This patch changes the flash device image of OvmfXen to make it look > like it's an ELF. For this, we replace the empty embedded variable store > by a binary array, which is a ELF file header. > > The ELF header explain to a loader to load the binary at the address > 1MB, then jump to the PVH entry point which will be created in a later > patch. The header also includes a Xen ELF note that is part of the > PVH ABI. > > That patch include OvmfXenElfHeaderGenerator.c which can be use to > regenerate the ELF header, but this will be a manual step. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > Acked-by: Laszlo Ersek > --- > > Notes: > v4: > - fix top-level comment style > - Update Maintainers.txt > > v3: > - added license to generate_elf_header.c > which is renamed to OvmfPkg/OvmfXenElfHeaderGenerator.c > - added an ELF NOTE into the header > > OvmfPkg/OvmfXen.fdf | 101 +++++++++++++++++++- > OvmfPkg/OvmfXenElfHeaderGenerator.c | 140 ++++++++++++++++++++++++++++ > Maintainers.txt | 1 + > 3 files changed, 239 insertions(+), 3 deletions(-) > create mode 100644 OvmfPkg/OvmfXenElfHeaderGenerator.c [...] > diff --git a/Maintainers.txt b/Maintainers.txt > index 42ec8d54af..016523b401 100644 > --- a/Maintainers.txt > +++ b/Maintainers.txt > @@ -373,6 +373,7 @@ F: OvmfPkg/Library/XenConsoleSerialPortLib/ > F: OvmfPkg/Library/XenHypercallLib/ > F: OvmfPkg/Library/XenIoMmioLib/ > F: OvmfPkg/OvmfXen.* > +F: OvmfPkg/OvmfXenElfHeaderGenerator.c > F: OvmfPkg/PlatformPei/MemDetect.c > F: OvmfPkg/PlatformPei/Platform.* > F: OvmfPkg/PlatformPei/Xen.* > Acked-by: Laszlo Ersek