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; Fri, 05 Jul 2019 07:10:10 -0700 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36C7C30C31AA; Fri, 5 Jul 2019 14:10:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-244.ams2.redhat.com [10.36.116.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA3DB82297; Fri, 5 Jul 2019 14:09:57 +0000 (UTC) Subject: Re: [PATCH v3 05/35] OvmfPkg/OvmfXen: Creating an ELF header To: Anthony PERARD , devel@edk2.groups.io Cc: xen-devel@lists.xenproject.org, Ard Biesheuvel , Jordan Justen , Julien Grall References: <20190704144233.27968-1-anthony.perard@citrix.com> <20190704144233.27968-6-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <97575295-13eb-76be-ba06-4340d6019f7a@redhat.com> Date: Fri, 5 Jul 2019 16:09:56 +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: <20190704144233.27968-6-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 05 Jul 2019 14:10:00 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/04/19 16:42, 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 > --- > > Notes: > 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 ++++++++++++++++++++++++++++ > 2 files changed, 238 insertions(+), 3 deletions(-) > create mode 100644 OvmfPkg/OvmfXenElfHeaderGenerator.c [...] > diff --git a/OvmfPkg/OvmfXenElfHeaderGenerator.c b/OvmfPkg/OvmfXenElfHeaderGenerator.c > new file mode 100644 > index 0000000000..6cbad8fbf7 > --- /dev/null > +++ b/OvmfPkg/OvmfXenElfHeaderGenerator.c > @@ -0,0 +1,140 @@ > +/* > + * @file > + * This program generates a hex array to be manually coppied into > + * OvmfXen.fdf. > + * The purpose is for the flash device image to be recognize as an ELF. > + * > + * Copyright (c) 2019, Citrix Systems, Inc. > + * > + * SPDX-License-Identifier: BSD-2-Clause-Patent > + */ (1) This patch is almost complete, just please update the comment style, for this top-level comment, from /* * @file * blah */ to: /** @file blah **/ Please refer to e.g. "OvmfPkg/XenBusDxe/XenBusDxe.c". With that comment style update: Acked-by: Laszlo Ersek Thanks Laszlo