From nobody Tue May 7 22:21:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44029+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44029+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563523793; cv=none; d=zoho.com; s=zohoarc; b=GwV4zbk8vtkRHgFdwUZoteBKrazFLSSdr5r7JNhz/mnyGZghvzulzT3Mswn6aXzUgLbJYDOueDLEwzHo5B0COYleA25o/ViQJkpWR84hLaJSf+9GwOPMTfxYHjSKSTK8FNJxo7dniSyH2xyWpc3V2rivIFCxQh7aQrEajvM5EPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563523793; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=dwDVRRgK29XHec3bzC1r5RWvh2s+9h0T5Z5FBAt7Fuc=; b=fwX9R5gZ6pfAeQSgzbfQ/KC9sRr47dyoJZQqfYfhjXaYQc5fd4Ewd53a5gj4Im1PNkEUyvoZix8lzCir1UEhYqt9Y+iIU8T0DoCNH+tywx+MXJ73i4gI+lAUbalf5tvKrtVORPqHQOMn0tSLva6iWOGJFPq20LDo+hJv7ysUyNI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44029+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563523793582151.33925214326496; Fri, 19 Jul 2019 01:09:53 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Fri, 19 Jul 2019 01:09:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 01:09:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208";a="187951031" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2019 01:09:51 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 1/4] MdePkg/UefiSpec.h: Add define of runtime services support Date: Fri, 19 Jul 2019 16:09:18 +0800 Message-Id: <20190719080921.17516-2-zhichao.gao@intel.com> In-Reply-To: <20190719080921.17516-1-zhichao.gao@intel.com> References: <20190719080921.17516-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563523793; bh=2wUtqHzgh9YuP5nQrMYCMhoa7X8VRvPnSJPLN9aIZcw=; h=Cc:Date:From:Reply-To:Subject:To; b=JwTLOwvv8hc5BvE3BhGPSmqCx8AtU9wqr07Mwdo0svAYn3HXhqKp6BhTMniKK0wlk8e o+ThXgehUqltCC+k6jWgK7dTpPUzHb+JC03i0a0GiseNst8Bek4saPnv7tA+c9cK5cU0e bx7Z+odD/FWPdcsO2wTCZonvRVopIxPejtU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1907 UEFI spec 2.8, Section 8.1.1 define some MACROs for RuntimeServicesSupported variable. Add them to UefiSpec.h. Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdePkg/Include/Uefi/UefiSpec.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index 44a0a6a7fa..20ecbff26e 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -1783,6 +1783,21 @@ EFI_STATUS #define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S',= 'E','R','V') #define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION =20 +#define EFI_RT_SUPPORTED_GET_TIME 0x0001 +#define EFI_RT_SUPPORTED_SET_TIME 0x0002 +#define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004 +#define EFI_RT_SUPPORTED_SET_WAKEUP_TIME 0x0008 +#define EFI_RT_SUPPORTED_GET_VARIABLE 0x0010 +#define EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME 0x0020 +#define EFI_RT_SUPPORTED_SET_VARIABLE 0x0040 +#define EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP 0x0080 +#define EFI_RT_SUPPORTED_CONVERT_POINTER 0x0100 +#define EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT 0x0200 +#define EFI_RT_SUPPORTED_RESET_SYSTEM 0x0400 +#define EFI_RT_SUPPORTED_UPDATE_CAPSULE 0x0800 +#define EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES 0x1000 +#define EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO 0x2000 + /// /// EFI Runtime Services Table. /// --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44029): https://edk2.groups.io/g/devel/message/44029 Mute This Topic: https://groups.io/mt/32524669/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 22:21:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44030+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44030+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563523794; cv=none; d=zoho.com; s=zohoarc; b=Swapzx9p4s5PxtWOqARf+mnedagEFdrD0aQLfJbJYxGZp/RTvtbSBydvHg5C+qA+v9Oy7lmLoY7yd2atud0y5TGmu0xjEBUuZOGyyfOCnIFfpu/JPcEXRiDoa67cxLIV89oieIzYUSaHGCXBqUQ3crTCNk2IJFEmpzuW3FNHG4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563523794; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=YvR/iiaFPIn3VTMs03WrjEd/zuzKFsFNgswO3Uk6y8U=; b=FV7LJzAxtTXb9Ve7JWW5QqRzO69RlxgPRsXUhG1IUKs0p9KjEsz3ktmRwttiUySs3oSEP6w30SjX3YbuTtT1vG1PER5sVOJd3PwZHbP6KmvMjZZqHXJpLHfqeOLr9b4Z9ZQwBgG5hfgSS7xDGmDnYDWjOaa4EZSXSNFtdA9ATdo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44030+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563523794836266.9680440199253; Fri, 19 Jul 2019 01:09:54 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Fri, 19 Jul 2019 01:09:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 01:09:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208";a="187951050" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2019 01:09:52 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 2/4] MdePkg: Add new pcd PcdRuntimeServicesSupport Date: Fri, 19 Jul 2019 16:09:19 +0800 Message-Id: <20190719080921.17516-3-zhichao.gao@intel.com> In-Reply-To: <20190719080921.17516-1-zhichao.gao@intel.com> References: <20190719080921.17516-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563523794; bh=WltPGVlid/reBjZZPT7LIdJ/8ycKJbbhO29N0TRAHtQ=; h=Cc:Date:From:Reply-To:Subject:To; b=rCJi9p/dBRJIn7KSkai+aQ3U1qvakY46G96Yu7YACuuTg9WWfQ7pWLKPzf5j3+kjp7S RGXkyfzLCQnUIsrLDDudivMjUSAwyqr+rxi3z3OHod3AqK0sKm6d0nKXKxLOYpHXDUaq1 D9XebKkSvinVDRO+zSuBAgNVdjr2eRoUcxE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1907 Add pcd PcdRuntimeServicesSupport to control whether runtime services is supported at runtime phase. It is a UINT16 type bitmask value. Refer to Uefi Spec 2.8, Section 8.1.1. Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdePkg/MdePkg.dec | 19 +++++++++++++++++++ MdePkg/MdePkg.uni | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index b382efd578..c66c88970e 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2079,6 +2079,25 @@ # @Prompt Speculation Barrier Type. gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType|0x01|UINT8|0x30001018 =20 + ## Indicates the supported runtime services after exit boot services. + # Uefi Spec 2.8, Section 8.1.1, RuntimeServicesSupported variable realt= ed definitions.

+ # 0x0001 (EFI_RT_SUPPORTED_GET_TIME)
+ # 0x0002 (EFI_RT_SUPPORTED_SET_TIME)
+ # 0x0004 (EFI_RT_SUPPORTED_GET_WAKEUP_TIME)
+ # 0x0008 (EFI_RT_SUPPORTED_SET_WAKEUP_TIME)
+ # 0x0010 (EFI_RT_SUPPORTED_GET_VARIABLE)
+ # 0x0020 (EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)
+ # 0x0040 (EFI_RT_SUPPORTED_SET_VARIABLE)
+ # 0x0080 (EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP)
+ # 0x0100 (EFI_RT_SUPPORTED_CONVERT_POINTER)
+ # 0x0200 (EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT)
+ # 0x0400 (EFI_RT_SUPPORTED_RESET_SYSTEM)
+ # 0x0800 (EFI_RT_SUPPORTED_UPDATE_CAPSULE)
+ # 0x1000 (EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES)
+ # 0x2000 (EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) + # @Prompt Runtime Services support. + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupport|0x3FFF|UINT16|0x30001= 019 + [PcdsFixedAtBuild,PcdsPatchableInModule] ## Indicates the maximum length of unicode string used in the following # BaseLib functions: StrLen(), StrSize(), StrCmp(), StrnCmp(), StrCpy()= , StrnCpy()

diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index 5c1fa24065..09e0cf22f1 100644 --- a/MdePkg/MdePkg.uni +++ b/MdePkg/MdePkg.uni @@ -157,6 +157,25 @@ = "0x02 - CPUID (IA32/X64).
\n" = "Other - reserved" =20 +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupport_PROMPT #la= nguage en-US "Runtime Services support." + +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupport_HELP #lang= uage en-US "Indicates the supported runtime services after exit boot servic= es." + = "Uefi Spec 2.8, Section 8.1.1, RuntimeServicesSupported variable= realted definitions.

" + = " 0x0001 (EFI_RT_SUPPORTED_GET_TIME)
" + = " 0x0002 (EFI_RT_SUPPORTED_SET_TIME)
" + = " 0x0004 (EFI_RT_SUPPORTED_GET_WAKEUP_TIME)
" + = " 0x0008 (EFI_RT_SUPPORTED_SET_WAKEUP_TIME)
" + = " 0x0010 (EFI_RT_SUPPORTED_GET_VARIABLE)
" + = " 0x0020 (EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)
" + = " 0x0040 (EFI_RT_SUPPORTED_SET_VARIABLE)
" + = " 0x0080 (EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP)
" + = " 0x0100 (EFI_RT_SUPPORTED_CONVERT_POINTER)
" + = " 0x0200 (EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT)
" + = " 0x0400 (EFI_RT_SUPPORTED_RESET_SYSTEM)
" + = " 0x0800 (EFI_RT_SUPPORTED_UPDATE_CAPSULE)
" + = " 0x1000 (EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES)
" + = " 0x2000 (EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO)" + #string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_PROMPT #= language en-US "Maximum Length of Ascii String" =20 #string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_HELP #la= nguage en-US "Sets the maximum number of ASCII characters used for string f= unctions. This affects the following BaseLib functions: AsciiStrLen(), Asc= iiStrSize(), AsciiStrCmp(), AsciiStrnCmp(), AsciiStrCpy(), AsciiStrnCpy(). =

\n" --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44030): https://edk2.groups.io/g/devel/message/44030 Mute This Topic: https://groups.io/mt/32524670/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 22:21:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44031+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44031+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563523796; cv=none; d=zoho.com; s=zohoarc; b=nYNS6GWTgMFD5ckC9WvvZxvXsCBN67VfljxgXg97y/i3Q0zJ67B470etlKnjKlf2Iz+HcNr0mlsKvF1JIHy6Et6eHCyJ6a0tRLO5RvIyIEC2Sl5Q9Sw6rXtOwaEZxRuRAhCjVe3/0F9LW1JTtFfWFPMaiLtt+FhK15drKCz9s+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563523796; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=8jiIF/TYJExUi6qhHM2l/HQpFyGO/KyoSvjdwgdgpys=; b=cwAS8efCpQnwl1Pogmydo3nXcKei0MgY+xMsAzFbSEt4VkDc3ciyM/LM08TuFREu1o/hpv1gX7FL1gFUiTmjBUA+8k5ugtTOrTGMtS0yxLOVYu8IAohYV46i43O0lMnFp7yKdOHd0B6Qrmw+uvzSGvPhlLtQmIj0GDURHP+OG+M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44031+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563523796494207.09621372237098; Fri, 19 Jul 2019 01:09:56 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Fri, 19 Jul 2019 01:09:55 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 01:09:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208";a="187951065" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2019 01:09:54 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner , Bret Barkelew , Laszlo Ersek Subject: [edk2-devel] [PATCH V2 3/4] MdeModulePkg/RuntimeDxe: Set RuntimeServicesSupport base on Pcd Date: Fri, 19 Jul 2019 16:09:20 +0800 Message-Id: <20190719080921.17516-4-zhichao.gao@intel.com> In-Reply-To: <20190719080921.17516-1-zhichao.gao@intel.com> References: <20190719080921.17516-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563523796; bh=6gHeKqb8sKU5HZqOPjkOPHZEpHd0KX9OI8yQQb5opOQ=; h=Cc:Date:From:Reply-To:Subject:To; b=ROLXxCR4y3GsVjRGHApUPbRPYvmqxMohz52f60FwN+MAms+F3F+XhGdYLsBQu22t1JI BoaBzcpaLzcGBoKKCfKthXAURM1LIozVr4JrkE3PHu2uDSFEGq2v9izmNsJIszUOXxUc4 v1NtKNLsQLeZ/fI7av+v3ajgm5ZcJf9MXro= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1907 Add a pcd named PcdRuntimeServicesSupport, RuntimeDxe driver would set variable L"RuntimeServicesSupported" base on this pcd. The varialbe would indicate whether the runtime services is supported or not in runtime phase. If the pcd's value is 0x3FFF, that means all runtime services is supported at runtime, then the variable wouldn't be set. Refer to UEFI spec 2.8, Section 8.1. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Cc: Laszlo Ersek Signed-off-by: Zhichao Gao --- MdeModulePkg/Core/RuntimeDxe/Runtime.c | 65 ++++++++++++++++++++- MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf | 8 ++- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/RuntimeDxe/Runtime.c b/MdeModulePkg/Core/Run= timeDxe/Runtime.c index c52b2b7ecf..394baf230a 100644 --- a/MdeModulePkg/Core/RuntimeDxe/Runtime.c +++ b/MdeModulePkg/Core/RuntimeDxe/Runtime.c @@ -35,7 +35,7 @@ Revision History: Table now contains an item named CalculateCrc32. =20 =20 -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -359,6 +359,65 @@ RuntimeDriverSetVirtualAddressMap ( return EFI_SUCCESS; } =20 +/** + Set the L"RuntimeServicesSupported" variable depend on the pcd PcdRuntim= eServicesSupport. + + Firstly try to get the variable, it may be set in other dxe driver. If i= t is set, then return + EFI_SUCCESS. If it isn't present, try to set it. + + @retval EFI_SUCCESS The variable is already set. + EFI_NOT_FOUND All runtime services are supported at runtime.= No variable is set. + Others Error to get variable or set variable. Unexpec= ted. +**/ +static +EFI_STATUS +SetRuntimeServicesSupported ( + VOID + ) +{ + EFI_STATUS Status; + UINT16 RuntimeServicesSupported; + UINT32 Attributes; + UINTN DataSize; + + // + // Firstly try to get L"RuntimeServicesSupported" variable + // + Attributes =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_AC= CESS; + DataSize =3D sizeof (UINT16); + Status =3D gRT->GetVariable ( + L"RuntimeServicesSupported", + &gEfiGlobalVariableGuid, + &Attributes, + &DataSize, + &RuntimeServicesSupported + ); + + if (Status =3D=3D EFI_NOT_FOUND) { + // + // L"RuntimeServicesSupported" isn't set yet. Then set it if + // some of the RuntimeServices is unsupported. + // + RuntimeServicesSupported =3D PcdGet16 (PcdRuntimeServicesSupport); + if (RuntimeServicesSupported !=3D 0x3FFF) { + Status =3D gRT->SetVariable ( + L"RuntimeServicesSupported", + &gEfiGlobalVariableGuid, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTI= ME_ACCESS, + sizeof (UINT16), + &RuntimeServicesSupported + ); + } else { + // + // Set Status to EFI_NOT_FOUND to indicate not such variable + // + Status =3D EFI_NOT_FOUND; + } + } + + return Status; +} + /** Entry Point for Runtime driver. =20 @@ -401,6 +460,10 @@ RuntimeDriverInitialize ( gRT->SetVirtualAddressMap =3D RuntimeDriverSetVirtualAddressMap; gRT->ConvertPointer =3D RuntimeDriverConvertPointer; =20 + Status =3D SetRuntimeServicesSupported (); + + ASSERT (Status =3D=3D EFI_NOT_FOUND || Status =3D=3D EFI_SUCCESS); + // // Install the Runtime Architectural Protocol onto a new handle // diff --git a/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf b/MdeModulePkg/Cor= e/RuntimeDxe/RuntimeDxe.inf index 694c7690fa..48ecec9e99 100644 --- a/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf +++ b/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf @@ -5,7 +5,7 @@ # CalculateCrc32 boot services table, SetVirtualAddressMap & ConvertPoint= er # runtime services table. # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -53,6 +53,12 @@ gEfiRuntimeArchProtocolGuid ## PRODUCES gEfiLoadedImageProtocolGuid ## CONSUMES =20 +[Guids] + gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ##= Variable L"RuntimeServicesSupported" + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupport ## SOME_TI= MES_CONSUMES + [depex] TRUE =20 --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44031): https://edk2.groups.io/g/devel/message/44031 Mute This Topic: https://groups.io/mt/32524671/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 22:21:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44032+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44032+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563523798; cv=none; d=zoho.com; s=zohoarc; b=EHu/XfU9r83aQJzzJHsVhNMSHuatAxNJWwIhrKJhJpTJvY5NIckz5cqXulYeAH6iA/a2YTlsD89X65/UsI6B1By+xzuUnih/LlLj3BCAFT7u5KFDx2se1dO1nlRY0tW5YWgwH5MB5FJoxRWDYZpTdtBOMSLMISwjdwKEpHGhams= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563523798; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=lVNx/qMOyAcGfKxvLBk6fIVc08cj7t6tqoVKtPRoGvI=; b=abxyHr+MWxoV+i5kRS7ZDbUePsZqZX63jnybjjZroERLUvkAh9FSL0nehIDSUoTf56ghx/zLhddVysHe6XJlL1i0LuKv5TSwLkLXPPpWM6L2X0PqnIm83YZwJhQzPlNpGteq09KQqCwwUIP3RKgCFjGsuZ8DCSZQgGq+0UpL6tI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44032+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563523798229265.9252042952169; Fri, 19 Jul 2019 01:09:58 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Fri, 19 Jul 2019 01:09:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 01:09:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208";a="187951073" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2019 01:09:55 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner , Bret Barkelew , Laszlo Ersek Subject: [edk2-devel] [PATCH V2 4/4] MdeModulePkg/CapsuleRuntimeDxe: Implement RuntimeServicesSupported Date: Fri, 19 Jul 2019 16:09:21 +0800 Message-Id: <20190719080921.17516-5-zhichao.gao@intel.com> In-Reply-To: <20190719080921.17516-1-zhichao.gao@intel.com> References: <20190719080921.17516-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563523797; bh=jz875bokk7Kux50uT6QGtYGBUw97fW4ihK+LWLbKFo0=; h=Cc:Date:From:Reply-To:Subject:To; b=f7LGLLvj7SPg9D3ppmZkcvTmxNJxzNP242JO9eZ9Akqyr7Bw7FrV+a4QvRL+SRTju2A nfHRgokbO61lcGgrjeu66sKNqzTbjHLC3XgjdgULwFOEOQ5qMTfSHUFQ1doRL3Caf0R8j PhVXceJEsONSz4Cy0UYu/rHShcg7PLFucTw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1907 Control the capsule services supported at runtime base on the variable L"RuntimeServicesSupported". It would update a global variable mRuntimeServicesSupported at ExitBootServices event. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Cc: Laszlo Ersek Signed-off-by: Zhichao Gao --- .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 2 + .../CapsuleRuntimeDxe/CapsuleService.c | 68 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf= b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf index 9da450722b..15d498863a 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf @@ -72,6 +72,8 @@ ## SOMETIMES_PRODUCES ## Variable:L"CapsuleLongModeBuffer" # The long = mode buffer used by IA32 Capsule PEIM to call X64 CapsuleCoalesce code to h= andle >4GB capsule blocks gEfiCapsuleVendorGuid gEfiFmpCapsuleGuid ## SOMETIMES_CONSUMES ##= GUID # FMP capsule GUID + gEfiGlobalVariableGuid ## CONSUMES ##= Variable L"RuntimeServicesSupported" + gEfiEventExitBootServicesGuid ## CONSUMES =20 [Protocols] gEfiCapsuleArchProtocolGuid ## PRODUCES diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/Md= eModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 77b8f00062..e4e700764b 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -24,6 +24,13 @@ UINTN mTimes =3D 0; UINT32 mMaxSizePopulateCapsule =3D 0; UINT32 mMaxSizeNonPopulateCapsule =3D 0; =20 +// +// Runtime Services Supported Flag +// Initialize it to 0x3FFF to indicate it is all supported before runtime +// +static UINT16 mRuntimeServicesSupported =3D 0x3FFF; + + /** Passes capsules to the firmware with both virtual and physical mapping. = Depending on the intended consumption, the firmware may process the capsule immediately. If the pa= yload should persist @@ -71,6 +78,10 @@ UpdateCapsule ( CHAR16 CapsuleVarName[30]; CHAR16 *TempVarName; =20 + if (!(mRuntimeServicesSupported | EFI_RT_SUPPORTED_UPDATE_CAPSULE)) { + return EFI_UNSUPPORTED; + } + // // Check if platform support Capsule In RAM or not. // Platform could choose to drop CapsulePei/CapsuleX64 and do not suppor= t Capsule In RAM. @@ -259,6 +270,10 @@ QueryCapsuleCapabilities ( EFI_CAPSULE_HEADER *CapsuleHeader; BOOLEAN NeedReset; =20 + if (!(mRuntimeServicesSupported | EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABIL= ITIES)) { + return EFI_UNSUPPORTED; + } + // // Capsule Count can't be less than one. // @@ -343,6 +358,48 @@ QueryCapsuleCapabilities ( return EFI_SUCCESS; } =20 +/** + ExitBootServices Event to update the mRuntimeServicesSupported to + affect the runtime services. + + @param[in] Event Event whose notification function is being invoked + @param[in] Context Pointer to the notification function's context +**/ +static +VOID +EFIAPI +UpdateRuntimeServicesSupported ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + UINT16 RuntimeServicesSupported; + UINT32 Attributes; + UINTN DataSize; + + Attributes =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_AC= CESS; + DataSize =3D sizeof (UINT16); + Status =3D gRT->GetVariable ( + L"RuntimeServicesSupported", + &gEfiGlobalVariableGuid, + &Attributes, + &DataSize, + &RuntimeServicesSupported + ); + + if (!EFI_ERROR (Status)) { + mRuntimeServicesSupported =3D RuntimeServicesSupported; + } else if (Status =3D=3D EFI_NOT_FOUND) { + mRuntimeServicesSupported =3D 0x3FFF; + } else { + // + // Should never arrive here. + // + ASSERT_EFI_ERROR (Status); + } +} + =20 /** =20 @@ -362,6 +419,7 @@ CapsuleServiceInitialize ( ) { EFI_STATUS Status; + EFI_EVENT Event; =20 mMaxSizePopulateCapsule =3D PcdGet32(PcdMaxSizePopulateCapsule); mMaxSizeNonPopulateCapsule =3D PcdGet32(PcdMaxSizeNonPopulateCapsule); @@ -381,6 +439,16 @@ CapsuleServiceInitialize ( gRT->UpdateCapsule =3D UpdateCapsule; gRT->QueryCapsuleCapabilities =3D QueryCapsuleCapabilities; =20 + Status =3D gBS->CreateEventEx( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + UpdateRuntimeServicesSupported, + NULL, + &gEfiEventExitBootServicesGuid, + &Event + ); + ASSERT_EFI_ERROR (Status); + // // Install the Capsule Architectural Protocol on a new handle // to signify the capsule runtime services are ready. --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44032): https://edk2.groups.io/g/devel/message/44032 Mute This Topic: https://groups.io/mt/32524672/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-