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; Mon, 08 Jul 2019 08:07:49 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0A3430833C0; Mon, 8 Jul 2019 15:07:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4BD55D9E5; Mon, 8 Jul 2019 15:07:30 +0000 (UTC) Subject: Re: [PATCH v3 17/35] OvmfPkg/XenPlatformPei: Reinit XenHypercallLib 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-18-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 8 Jul 2019 17:07:29 +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-18-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 08 Jul 2019 15:07:37 +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: > The XenPlatformPei needs to make hypercalls, but the XenHypercallLib was > initialised before the HyperPage was ready. Now that XenPlatformPei has > initialised the HyperPage, reinitialise the XenHypercallLib. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > --- > > Notes: > v3: > - new patch split from XenHypercallLib: Enable it in PEIM. > - check for Lib initialisation failure. > > OvmfPkg/XenPlatformPei/XenPlatformPei.inf | 1 + > OvmfPkg/XenPlatformPei/Xen.c | 9 +++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > index 4d00206d09..0ef77db92c 100644 > --- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > +++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > @@ -59,6 +59,7 @@ [LibraryClasses] > MtrrLib > MemEncryptSevLib > PcdLib > + XenHypercallLib > > [Pcd] > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase > diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c > index c5293498c4..877d776de8 100644 > --- a/OvmfPkg/XenPlatformPei/Xen.c > +++ b/OvmfPkg/XenPlatformPei/Xen.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include "Platform.h" > #include "Xen.h" > @@ -88,6 +89,7 @@ XenConnect ( > EFI_XEN_OVMF_INFO *Info; > CHAR8 Sig[sizeof (Info->Signature) + 1]; > UINT32 *PVHResetVectorData; > + RETURN_STATUS Status; > > AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL); > mXenInfo.HyperPages = AllocatePages (TransferPages); > @@ -152,6 +154,13 @@ XenConnect ( > sizeof(mXenInfo) > ); > > + // > + // Initialize the XenHypercall library, now that the XenInfo HOB is > + // available > + // > + Status = XenHypercallLibInit (); > + ASSERT_RETURN_ERROR (Status); > + > return EFI_SUCCESS; > } > > Reviewed-by: Laszlo Ersek