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; Thu, 11 Apr 2019 04:49:06 -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 77936C066461; Thu, 11 Apr 2019 11:49:06 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-225.rdu2.redhat.com [10.10.120.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD10164046; Thu, 11 Apr 2019 11:49:04 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 11/31] OvmfPkg/XenPlatformPei: Use mXenHvmloaderInfo to get E820 To: devel@edk2.groups.io, anthony.perard@citrix.com Cc: Jordan Justen , Ard Biesheuvel , Julien Grall , xen-devel@lists.xenproject.org References: <20190409110844.14746-1-anthony.perard@citrix.com> <20190409110844.14746-12-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <94638c0b-1756-f1ba-da8e-12c1297d15c2@redhat.com> Date: Thu, 11 Apr 2019 13:49:03 +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: <20190409110844.14746-12-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.31]); Thu, 11 Apr 2019 11:49:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 04/09/19 13:08, Anthony PERARD wrote: > Use the already checked pointer mXenHvmloaderInfo to retrieve the E820 > table produced by hvmloader. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Anthony PERARD > --- > OvmfPkg/XenPlatformPei/Xen.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c > index a866641b67..df906b6be5 100644 > --- a/OvmfPkg/XenPlatformPei/Xen.c > +++ b/OvmfPkg/XenPlatformPei/Xen.c > @@ -59,18 +59,18 @@ XenGetE820Map ( > UINT32 *Count > ) > { > - EFI_XEN_OVMF_INFO *Info = > - (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS; > + // > + // Get E820 produced by hvmloader > + // > + if (mXenHvmloaderInfo != NULL) { > + ASSERT (mXenHvmloaderInfo->E820 < MAX_ADDRESS); > + *Entries = (EFI_E820_ENTRY64 *)(UINTN) mXenHvmloaderInfo->E820; > + *Count = mXenHvmloaderInfo->E820EntriesCount; > > - if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) { > - return EFI_NOT_FOUND; > + return EFI_SUCCESS; > } > > - ASSERT (Info->E820 < MAX_ADDRESS); > - *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820; > - *Count = Info->E820EntriesCount; > - > - return EFI_SUCCESS; > + return EFI_NOT_FOUND; > } > > /** > Acked-by: Laszlo Ersek