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 05:47:17 -0700 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 mx1.redhat.com (Postfix) with ESMTPS id A1D53308338F; Tue, 30 Jul 2019 12:47:16 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D8BF5D6A7; Tue, 30 Jul 2019 12:47:15 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 32/35] OvmfPkg: Introduce PcdXenGrantFrames 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-33-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <365f2b95-b6c9-03cf-5346-5e1192bfa437@redhat.com> Date: Tue, 30 Jul 2019 14:47:14 +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-33-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 30 Jul 2019 12:47:16 +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: > Introduce PcdXenGrantFrames to replace a define in XenBusDxe and allow > the same value to be used in a different module. > > The reason for the number of page to be 4 doesn't exist anymore, so > simply remove the comment. > > Signed-off-by: Anthony PERARD > --- > OvmfPkg/OvmfPkg.dec | 3 +++ > OvmfPkg/XenBusDxe/XenBusDxe.inf | 2 ++ > OvmfPkg/XenBusDxe/XenBusDxe.h | 1 + > OvmfPkg/XenBusDxe/GrantTable.c | 3 +-- > 4 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec > index 04d5e29272..d5fee805ef 100644 > --- a/OvmfPkg/OvmfPkg.dec > +++ b/OvmfPkg/OvmfPkg.dec > @@ -225,6 +225,9 @@ [PcdsFixedAtBuild] > gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|0x0|UINT32|0x17 > gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize|0x0|UINT32|0x32 > > + ## Number of page frames to use for storing grant table entries. > + gUefiOvmfPkgTokenSpaceGuid.PcdXenGrantFrames|4|UINT32|0x33 > + > [PcdsDynamic, PcdsDynamicEx] > gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2 > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x10 > diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.inf b/OvmfPkg/XenBusDxe/XenBusDxe.inf > index 86e0fb8224..0b78cd0af4 100644 > --- a/OvmfPkg/XenBusDxe/XenBusDxe.inf > +++ b/OvmfPkg/XenBusDxe/XenBusDxe.inf > @@ -59,3 +59,5 @@ [Protocols] > gXenBusProtocolGuid > gXenIoProtocolGuid > > +[FixedPcd] > + gUefiOvmfPkgTokenSpaceGuid.PcdXenGrantFrames > diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.h b/OvmfPkg/XenBusDxe/XenBusDxe.h > index 8510361bca..b1dcc3549c 100644 > --- a/OvmfPkg/XenBusDxe/XenBusDxe.h > +++ b/OvmfPkg/XenBusDxe/XenBusDxe.h > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > > // Good catch; in my v3 review at I didn't realize we'd be introducing the PcdLib dependency anew. (1) However, in that case, we should list PcdLib in the [LibraryClasses] section of the INF file as well. With (1) fixed: Reviewed-by: Laszlo Ersek There is no need to post v5 just because of this -- if a v5 is otherwise unnecessary, I can fix this up for you before pushing v4. Thanks Laszlo > diff --git a/OvmfPkg/XenBusDxe/GrantTable.c b/OvmfPkg/XenBusDxe/GrantTable.c > index 6575e9b88c..1130404cd1 100644 > --- a/OvmfPkg/XenBusDxe/GrantTable.c > +++ b/OvmfPkg/XenBusDxe/GrantTable.c > @@ -22,8 +22,7 @@ > > #define NR_RESERVED_ENTRIES 8 > > -/* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ > -#define NR_GRANT_FRAMES 4 > +#define NR_GRANT_FRAMES (FixedPcdGet32 (PcdXenGrantFrames)) > #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * EFI_PAGE_SIZE / sizeof(grant_entry_v1_t)) > > STATIC grant_entry_v1_t *GrantTable = NULL; >