From patchwork Tue Aug 13 11:31:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11091965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D33E514F7 for ; Tue, 13 Aug 2019 11:59:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C456E2844E for ; Tue, 13 Aug 2019 11:59:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B843E285FD; Tue, 13 Aug 2019 11:59:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62BED285F9 for ; Tue, 13 Aug 2019 11:59:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxVRM-00018P-JC; Tue, 13 Aug 2019 11:58:12 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxVRK-00016B-Jp for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 11:58:10 +0000 X-Inumbo-ID: 968dde7e-bdc1-11e9-96d2-9b42df4b5054 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 968dde7e-bdc1-11e9-96d2-9b42df4b5054; Tue, 13 Aug 2019 11:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565697477; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P3vIPTrpS4WmMWZ4BMkDvYJqY5kSnzXIWfLL64j3DtM=; b=M/XvsDdoM0H/goAzPOqvM4CExYf6InL20yD5NOz84P4ogiiCL2RKL+lr bpiO0R6lYF6MXbJcpQ1uxe6fAW0Vv1E9HklwmgbJoe7PRHUfITGSHjmxw SitW2fTwAlu1rmN0uZRbYOvz4ruwOoVFGg1o6jsOhBZHYelSV+3Yja7Xz g=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: JSGYgwJynx42Wg4ESZWLvES884rRtA4gT5D8G8NRpvwt2ThABOfDSzZeYNvczJPJrrWuWG3HnR mLCRJF+KoXkCMPBH1J2XHd6WioSUgijYYE9oSMnsKFJJ0Gba2U5BL9RDMJGCQvgnV6jmYIPzHJ 2zsje8OmM5IrA6YBVQ/mq0BO/FQ3ZdnQZS9aTm8a7NDiR97venpYojahWVo4B0B0Pa61pQciBp SdtcdQnRnZanz1yDtN7Mnl9nBm7xc/6Lhb37R8r4RRhcsovJxxBlBAqSIwJwsafewLt5355JID dAY= X-SBRS: 2.7 X-MesageID: 4210839 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,381,1559534400"; d="scan'208";a="4210839" From: Anthony PERARD To: Date: Tue, 13 Aug 2019 12:31:16 +0100 Message-ID: <20190813113119.14804-33-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190813113119.14804-1-anthony.perard@citrix.com> References: <20190813113119.14804-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 32/35] OvmfPkg: Introduce PcdXenGrantFrames X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Jordan Justen , Julien Grall , Anthony PERARD , xen-devel@lists.xenproject.org, Laszlo Ersek Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Laszlo Ersek --- Notes: v5: - add missing PcdLib to [LibraryClasses] v4: - new patch OvmfPkg/OvmfPkg.dec | 3 +++ OvmfPkg/XenBusDxe/XenBusDxe.inf | 3 +++ OvmfPkg/XenBusDxe/XenBusDxe.h | 1 + OvmfPkg/XenBusDxe/GrantTable.c | 3 +-- 4 files changed, 8 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..536b49fa8c 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.inf +++ b/OvmfPkg/XenBusDxe/XenBusDxe.inf @@ -51,6 +51,7 @@ [LibraryClasses] XenHypercallLib SynchronizationLib PrintLib + PcdLib [Protocols] gEfiDriverBindingProtocolGuid @@ -59,3 +60,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 // 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;