From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web09.10621.1583404308268373821 for ; Thu, 05 Mar 2020 02:31:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CxSTrVr2; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583404307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6DHNFYaIbBmAfy2ng00qenKEbwhGgm1CxBKFuvXe1Ak=; b=CxSTrVr2CeAu1NCrF3Rilm9eYgQPsWckgCZY6qRS8DW9n5r4nHUKCl171qWevi7GUd78yx O3A512+7CL2VI0os9OvCUdMrGyS6tvjaAw7/U4HFiafjw9tpQwKF3eBuBN+zx7x5ml3T3b ifeU+unJ4IXf2BPmDJKZ+eaK/oDhnIw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-N87PrRtgPkK3v1U8U7U_jA-1; Thu, 05 Mar 2020 05:31:45 -0500 X-MC-Unique: N87PrRtgPkK3v1U8U7U_jA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB1F910509B3; Thu, 5 Mar 2020 10:31:44 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-216.ams2.redhat.com [10.36.117.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 488EA73874; Thu, 5 Mar 2020 10:31:44 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 09/14] OvmfPkg: create protocol and GUID header for legacy loaded images To: devel@edk2.groups.io, ard.biesheuvel@linaro.org References: <20200304095233.21046-1-ard.biesheuvel@linaro.org> <20200304095233.21046-10-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: Date: Thu, 5 Mar 2020 11:31:43 +0100 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: <20200304095233.21046-10-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/04/20 10:52, Ard Biesheuvel wrote: > In preparation of moving the legacy x86 loading to an implementation > of the QEMU load image library class, introduce a protocol header > and GUID that we will use to identify legacy loaded images in the > protocol database. > > Signed-off-by: Ard Biesheuvel > --- > OvmfPkg/Include/Protocol/X86QemuKernelLoadedImage.h | 19 +++++++++++++++++++ > OvmfPkg/OvmfPkg.dec | 1 + > 2 files changed, 20 insertions(+) > > diff --git a/OvmfPkg/Include/Protocol/X86QemuKernelLoadedImage.h b/OvmfPkg/Include/Protocol/X86QemuKernelLoadedImage.h > new file mode 100644 > index 000000000000..7e1bebaa6a07 > --- /dev/null > +++ b/OvmfPkg/Include/Protocol/X86QemuKernelLoadedImage.h > @@ -0,0 +1,19 @@ > +/** @file > + Protocol/GUID definition to describe a kernel image loaded by the legacy X86 > + loader from the file specified on the QEMU command line via the -kernel > + option. (1) Please add a comment that the interface structure associated with this protocol GUID is subject to change, and should not be used outside of the EDK II tree. (I'm requesting this comment regardless of point (5) below.) > + > + Copyright (c) 2020, Arm, Ltd. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#ifndef X86_QEMU_KERNEL_LOADED_IMAGE_GUID_H__ > +#define X86_QEMU_KERNEL_LOADED_IMAGE_GUID_H__ (2) Please drop "_GUID" from the guard macro's name. > + > +#define X86_QEMU_KERNEL_LOADED_IMAGE_GUID \ > + {0xa3edc05d, 0xb618, 0x4ff6, {0x95, 0x52, 0x76, 0xd7, 0x88, 0x63, 0x43, 0xc8}} (3) Please replace "_GUID" with "_PROTOCOL_GUID" in the initializer macro's name. > + > +extern EFI_GUID gX86QemuKernelLoadedImageGuid; (4) Please replace "Guid" with "ProtocolGuid" in the variable name. > + > +#endif (5) Please consider moving the QEMU_LEGACY_LOADED_IMAGE typedef here, from the next patch. It's not a technical necessity at all, but edk2 protocol headers always include the interface typedef too. And due to (1) above, I think it's safe too. If you don't like the idea, I won't insist. :) > diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec > index 055caaa43041..06ffd4198d44 100644 > --- a/OvmfPkg/OvmfPkg.dec > +++ b/OvmfPkg/OvmfPkg.dec > @@ -112,6 +112,7 @@ [Protocols] > gEfiLegacyBiosPlatformProtocolGuid = {0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x09, 0x07, 0x9c, 0x0c, 0xb4}} > gEfiLegacyInterruptProtocolGuid = {0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe}} > gEfiVgaMiniPortProtocolGuid = {0xc7735a2f, 0x88f5, 0x4882, {0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3}} > + gX86QemuKernelLoadedImageGuid = {0xa3edc05d, 0xb618, 0x4ff6, {0x95, 0x52, 0x76, 0xd7, 0x88, 0x63, 0x43, 0xc8}} (6) Same as (4). > > [PcdsFixedAtBuild] > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0 > With (1)-(4) and (6) fixed, and with (5) optionally implemented: Reviewed-by: Laszlo Ersek Thanks! Laszlo