From nobody Mon May 6 00:38:31 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+43849+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+43849+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563349051; cv=none; d=zoho.com; s=zohoarc; b=jum/SjRb7I4JRMPhvm1Vieiw6jCouPPS1bhDa3DWmLlH6FgxO7Uc3Pnf4SUmgNnDO6o57/7gCOgON4zSMqmUCOtMthe/v/zsQfCjWsAIzgCQ2l9ZrsrJtZYT0DjF4K6qwl2LK2PI4rEewuX3y54Byxau2kva7oWGGWLkG2lFH6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563349051; 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=25YIfTE3ZHFWKjnsMZ06OCu99uXu8xRpmlpZcfScz7s=; b=Ss3cD8Nrql+6BYrW3wR2Pb6wFZAnmTSoiEA4FPL4DvXRuosAAQwd4JmwVHJoD+VLoHntTI5GD9WaswGw1Bt/IPj4QNTUYyAOHi/nWd+uyXgF8cdF+5Hj5aeDGW7AEirMfUt6AUZgoB0n+7PsLdtaK4J5JmsjG2qRdznFj157VUg= 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+43849+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 1563349051413364.8025273977855; Wed, 17 Jul 2019 00:37:31 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Wed, 17 Jul 2019 00:37:30 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 00:37:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="187506295" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2019 00:37:29 -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 1/3] MdePkg/UefiSpec.h: Add define of runtime services support Date: Wed, 17 Jul 2019 15:37:23 +0800 Message-Id: <20190717073725.30304-2-zhichao.gao@intel.com> In-Reply-To: <20190717073725.30304-1-zhichao.gao@intel.com> References: <20190717073725.30304-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=1563349051; bh=o1PBYkqcVLrQo2P5Sij7lFpNAEZC6bGEqimEbfIStTU=; h=Cc:Date:From:Reply-To:Subject:To; b=UGsNqraAgE/sDkLOaXEXYLZkrqO7tRquFYSKLRpE7bNWRtaM1QySJ9JX0QntR3DxvDw HCIv3aJs8bWq7af0boK9r6rzmC11X6+IJKBlakJhj+AeLIni37Bt+JCleONbR5AkYqEp/ lr41+IzPGa0IQdSMWv2i98SMKVRVvc+qDQU= 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 (#43849): https://edk2.groups.io/g/devel/message/43849 Mute This Topic: https://groups.io/mt/32500926/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 Mon May 6 00:38:31 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+43850+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+43850+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563349053; cv=none; d=zoho.com; s=zohoarc; b=WT4sd7WV1bw9PcaWntwa7Q17W67lqN6XiV7Avil8vGLvedxkNMPtg1SaSvgKqTjuHyFEQGvFMQsSlvmpNztS6M+LQTFREA7OfPTqz/+Oh54EDzvS8O5nrnjbNb1RLmjw2gI+AvrmN1ES0Uk5rF3LDXFkvhMYuFwRaLT+iC32RKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563349053; 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=BD7jIIZqqUea8LEm60CnaWRUortpwHJeUgUsgAY+jVY=; b=GV3YCG267P3aAae4obloqSZ6uGisI8OeMRFYQPEottlR66oVJ2TEwzYNiqApSdoZMLCwlttcetoZuE47th9Zt4ne73R8NoosjNaVHxcR9AZaW/65DeVUR1qxZhv5pX1EyKISNtpSN4CZeVeP10e0C2z3ZKVuuLyxNiKMvfMpZ1E= 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+43850+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 1563349053268985.9087177296442; Wed, 17 Jul 2019 00:37:33 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Wed, 17 Jul 2019 00:37:32 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 00:37:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="187506302" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2019 00:37:30 -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 2/3] MdePkg: Add new pcd PcdRuntimeServicesSupport Date: Wed, 17 Jul 2019 15:37:24 +0800 Message-Id: <20190717073725.30304-3-zhichao.gao@intel.com> In-Reply-To: <20190717073725.30304-1-zhichao.gao@intel.com> References: <20190717073725.30304-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=1563349052; bh=CLoUH0yjHBqX+timT+tWl0GonZ63fYItNJWLGjU/0SI=; h=Cc:Date:From:Reply-To:Subject:To; b=QeVydj8VB3mlTEOa7jL6jq66CESFkrWe02sn0sgjNkslf4dEaQ4sw76imlvNnBM8Tm7 VYCQAP2uXGvIliT4i1zaP6EhdetEqY3an/Hv7WaAnbqpMOVGpuT3fB2dp6Qh3n0iyMKmJ 1JJOAopU1nH8mhpDHcfftTAUWkPKYh9G6pE= 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 6c563375ee..5e9205dc10 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2076,6 +2076,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 serv= ices." + = "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 (#43850): https://edk2.groups.io/g/devel/message/43850 Mute This Topic: https://groups.io/mt/32500927/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 Mon May 6 00:38:31 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+43851+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+43851+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563349055; cv=none; d=zoho.com; s=zohoarc; b=MG8op5JujSiXjUnMhM+CKu772d9GmoF+tG5OVItecVIUhbwsrvW7y59xU3YksSB41Mg2qgF+3uveN4qs3na/1OmTuq3kQ/9z8mB6bu8tA3DIAeB5NDDaFPAiramX4JgqAxUhVuOXOA35va3PFBVRFUBLwRiBRuw+0YWLy727JsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563349055; 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=XVoiOhljOqDFUbEnUPFl647SsIOBhRs1qfZHGbW16SE=; b=Vv2T9Cm0I2LjnOqzm0J0JQ5EREyXfsTQb8m415GaS6Su5hYbCLGSU0sYbUT++HyvyUQ5Qmd4umh03KP3bcEqEkNCdUzzvdmIdFWwpV0UtM4Y6HWZEXRFqryRw5lXzoAev1DxBMbptIF0kmPhBL09O7okOJdvrA0QVVhU2DdeFSk= 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+43851+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 1563349054984545.8525250307155; Wed, 17 Jul 2019 00:37:34 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Wed, 17 Jul 2019 00:37:34 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 00:37:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="187506311" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2019 00:37:32 -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 Subject: [edk2-devel] [PATCH 3/3] MdeModulePkg/CapsuleRuntimeDxe: Control runtime services supported Date: Wed, 17 Jul 2019 15:37:25 +0800 Message-Id: <20190717073725.30304-4-zhichao.gao@intel.com> In-Reply-To: <20190717073725.30304-1-zhichao.gao@intel.com> References: <20190717073725.30304-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=1563349054; bh=ez49+9YDLW48pUuG3QCk975nLTZ8cJnHdrKcCK4a77E=; h=Cc:Date:From:Reply-To:Subject:To; b=duKe1H7EXbKTqRr73HObk0APUsXHzdz4LNPoL54jrfCTe6luH9XT+tPPhI2JAaBBKl7 yMGa+ya0nJ0ZpkEX+5FTr5I0saCxYJRMvF5roDHWLrTEMwIpftxz4giEbQWUK9joDIOqF EAEoFmFTfwKMc0wvvgIq/tsbnvzMLqM2TvM= 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 PcdRuntimeServicesSupport to control whether the capsule services is supported during runtime phase. If the L"RuntimeServicesSupported" variable is not set yet, it would set the variable base on the pcd. If the pcd value is 0x3FFF that means all runtime services is supported at runtime phase, L"RuntimeServicesSupported" would not be set. 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 Signed-off-by: Zhichao Gao --- .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 3 + .../CapsuleRuntimeDxe/CapsuleService.c | 129 ++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf= b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf index 9da450722b..95b760d94e 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 ## SOMETIMES_CONSUMES ##= Variable L"RuntimeServicesSupported" + gEfiEventExitBootServicesGuid ## CONSUMES =20 [Protocols] gEfiCapsuleArchProtocolGuid ## PRODUCES @@ -91,6 +93,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ## SOMETIM= ES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ## SOMETIM= ES_CONSUMES # Populate Image requires reset support. gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupport ## SOME_TI= MES_CONSUMES =20 [Pcd.X64] gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize ## SOMET= IMES_CONSUMES diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/Md= eModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 77b8f00062..8ab77361d8 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -24,6 +24,12 @@ 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 +77,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 +269,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 +357,106 @@ QueryCapsuleCapabilities ( 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; +} + +/** + 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 +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 +476,7 @@ CapsuleServiceInitialize ( ) { EFI_STATUS Status; + EFI_EVENT Event; =20 mMaxSizePopulateCapsule =3D PcdGet32(PcdMaxSizePopulateCapsule); mMaxSizeNonPopulateCapsule =3D PcdGet32(PcdMaxSizeNonPopulateCapsule); @@ -393,5 +508,19 @@ CapsuleServiceInitialize ( ); ASSERT_EFI_ERROR (Status); =20 + Status =3D SetRuntimeServicesSupported (); + + ASSERT (Status =3D=3D EFI_NOT_FOUND || Status =3D=3D EFI_SUCCESS); + + Status =3D gBS->CreateEventEx( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + UpdateRuntimeServicesSupported, + NULL, + &gEfiEventExitBootServicesGuid, + &Event + ); + ASSERT_EFI_ERROR (Status); + return Status; } --=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 (#43851): https://edk2.groups.io/g/devel/message/43851 Mute This Topic: https://groups.io/mt/32500928/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-