BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
Platform could choose to drop CapsulePei/CapsuleX64 and not to support
Capsule In Ram.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
---
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1 +
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
index 338577e293..9da450722b 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
@@ -88,10 +88,11 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ## SOMETIMES_CONSUMES # Populate Image requires reset support.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ## CONSUMES
[Pcd.X64]
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index aaf819c4c6..53a1af44e2 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -2,11 +2,11 @@
Capsule Runtime Driver produces two UEFI capsule runtime services.
(UpdateCapsule, QueryCapsuleCapabilities)
It installs the Capsule Architectural Protocol defined in PI1.0a to signify
the capsule runtime services are ready.
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "CapsuleService.h"
@@ -69,10 +69,18 @@ UpdateCapsule (
BOOLEAN NeedReset;
BOOLEAN InitiateReset;
CHAR16 CapsuleVarName[30];
CHAR16 *TempVarName;
+ //
+ // Check if platform support Capsule In RAM or not.
+ // Platform could choose to drop CapsulePei/CapsuleX64 and do not support Capsule In RAM.
+ //
+ if (!PcdGetBool(PcdCapsuleInRamSupport)) {
+ return EFI_UNSUPPORTED;
+ }
+
//
// Capsule Count can't be less than one.
//
if (CapsuleCount < 1) {
return EFI_INVALID_PARAMETER;
--
2.16.2.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#41952): https://edk2.groups.io/g/devel/message/41952
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Xu,
> Wei6
> Sent: Wednesday, June 05, 2019 11:42 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to control this feature.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
> Platform could choose to drop CapsulePei/CapsuleX64 and not to support
> Capsule In Ram.
For this patch, it only affects UpdateCapsule(). Do we need to update the
behavior for QueryCapsuleCapabilities() as well?
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Chao B Zhang <chao.b.zhang@intel.com>
> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
> ---
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1
> +
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10
> +++++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b 100644
> ---
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ##
> CONSUMES
>
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ##
> SOMETIMES_CONSUMES # Populate Image requires reset support.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ##
> CONSUMES
>
> [Pcd.X64]
> gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ##
> SOMETIMES_CONSUMES
>
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @@
> Capsule Runtime Driver produces two UEFI capsule runtime services.
> (UpdateCapsule, QueryCapsuleCapabilities)
> It installs the Capsule Architectural Protocol defined in PI1.0a to signify
> the capsule runtime services are ready.
>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "CapsuleService.h"
> @@ -69,10 +69,18 @@ UpdateCapsule (
> BOOLEAN NeedReset;
> BOOLEAN InitiateReset;
> CHAR16 CapsuleVarName[30];
> CHAR16 *TempVarName;
>
> + //
> + // Check if platform support Capsule In RAM or not.
> + // Platform could choose to drop CapsulePei/CapsuleX64 and do not
> support Capsule In RAM.
> + //
> + if (!PcdGetBool(PcdCapsuleInRamSupport)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> //
> // Capsule Count can't be less than one.
> //
> if (CapsuleCount < 1) {
> return EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42261): https://edk2.groups.io/g/devel/message/42261
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Hi Hao:
I think blocking UpdateCapsule interface is enough for Capsule in RAM. QueryCapsuleCapabilities can still be used to test capsules before delivering by different sources.
From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Xu,
> Wei6
> Sent: Wednesday, June 05, 2019 11:42 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to control this feature.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
> Platform could choose to drop CapsulePei/CapsuleX64 and not to support
> Capsule In Ram.
For this patch, it only affects UpdateCapsule(). Do we need to update the
behavior for QueryCapsuleCapabilities() as well?
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Cc: Chao B Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Signed-off-by: Wei6 Xu <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
> ---
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1
> +
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10
> +++++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b 100644
> ---
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ##
> CONSUMES
>
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ##
> SOMETIMES_CONSUMES # Populate Image requires reset support.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ##
> CONSUMES
>
> [Pcd.X64]
> gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ##
> SOMETIMES_CONSUMES
>
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @@
> Capsule Runtime Driver produces two UEFI capsule runtime services.
> (UpdateCapsule, QueryCapsuleCapabilities)
> It installs the Capsule Architectural Protocol defined in PI1.0a to signify
> the capsule runtime services are ready.
>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "CapsuleService.h"
> @@ -69,10 +69,18 @@ UpdateCapsule (
> BOOLEAN NeedReset;
> BOOLEAN InitiateReset;
> CHAR16 CapsuleVarName[30];
> CHAR16 *TempVarName;
>
> + //
> + // Check if platform support Capsule In RAM or not.
> + // Platform could choose to drop CapsulePei/CapsuleX64 and do not
> support Capsule In RAM.
> + //
> + if (!PcdGetBool(PcdCapsuleInRamSupport)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> //
> // Capsule Count can't be less than one.
> //
> if (CapsuleCount < 1) {
> return EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42558): https://edk2.groups.io/g/devel/message/42558
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 8:42 AM
To: Wu, Hao A; devel@edk2.groups.io; Xu, Wei6
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Hi Hao:
I think blocking UpdateCapsule interface is enough for Capsule in RAM. QueryCapsuleCapabilities can still be used to test capsules before delivering by different sources.
Hello Chao,
I am okay with the usage update for the function.
But I think we need to update the comments for the QueryCapsuleCapabilities()
function within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' service for
EFI_RUNTIME_SERVICES to reflect the fact that even QueryCapsuleCapabilities()
returns without error, the capsule may still be unsupported by UpdateCapsule():
/**
Returns if the capsule can be supported via UpdateCapsule().
...
**/
Best Regards,
Hao Wu
From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Xu,
> Wei6
> Sent: Wednesday, June 05, 2019 11:42 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to control this feature.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
> Platform could choose to drop CapsulePei/CapsuleX64 and not to support
> Capsule In Ram.
For this patch, it only affects UpdateCapsule(). Do we need to update the
behavior for QueryCapsuleCapabilities() as well?
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Cc: Chao B Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Signed-off-by: Wei6 Xu <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
> ---
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1
> +
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10
> +++++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b 100644
> ---
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ##
> CONSUMES
>
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ##
> SOMETIMES_CONSUMES # Populate Image requires reset support.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ##
> CONSUMES
>
> [Pcd.X64]
> gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ##
> SOMETIMES_CONSUMES
>
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @@
> Capsule Runtime Driver produces two UEFI capsule runtime services.
> (UpdateCapsule, QueryCapsuleCapabilities)
> It installs the Capsule Architectural Protocol defined in PI1.0a to signify
> the capsule runtime services are ready.
>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "CapsuleService.h"
> @@ -69,10 +69,18 @@ UpdateCapsule (
> BOOLEAN NeedReset;
> BOOLEAN InitiateReset;
> CHAR16 CapsuleVarName[30];
> CHAR16 *TempVarName;
>
> + //
> + // Check if platform support Capsule In RAM or not.
> + // Platform could choose to drop CapsulePei/CapsuleX64 and do not
> support Capsule In RAM.
> + //
> + if (!PcdGetBool(PcdCapsuleInRamSupport)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> //
> // Capsule Count can't be less than one.
> //
> if (CapsuleCount < 1) {
> return EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42559): https://edk2.groups.io/g/devel/message/42559
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Hi Hao:
OK that is a good point. We will follow up to clean this. Tks
From: Wu, Hao A
Sent: Wednesday, June 19, 2019 9:00 AM
To: Zhang, Chao B <chao.b.zhang@intel.com>; devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 8:42 AM
To: Wu, Hao A; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Xu, Wei6
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Hi Hao:
I think blocking UpdateCapsule interface is enough for Capsule in RAM. QueryCapsuleCapabilities can still be used to test capsules before delivering by different sources.
Hello Chao,
I am okay with the usage update for the function.
But I think we need to update the comments for the QueryCapsuleCapabilities()
function within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' service for
EFI_RUNTIME_SERVICES to reflect the fact that even QueryCapsuleCapabilities()
returns without error, the capsule may still be unsupported by UpdateCapsule():
/**
Returns if the capsule can be supported via UpdateCapsule().
...
**/
Best Regards,
Hao Wu
From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Xu, Wei6 <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
Cc: Wang, Jian J <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>; Zhang, Chao B <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Xu,
> Wei6
> Sent: Wednesday, June 05, 2019 11:42 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to control this feature.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
> Platform could choose to drop CapsulePei/CapsuleX64 and not to support
> Capsule In Ram.
For this patch, it only affects UpdateCapsule(). Do we need to update the
behavior for QueryCapsuleCapabilities() as well?
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Cc: Chao B Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Signed-off-by: Wei6 Xu <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
> ---
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1
> +
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10
> +++++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b 100644
> ---
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ##
> CONSUMES
>
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ##
> SOMETIMES_CONSUMES # Populate Image requires reset support.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ##
> CONSUMES
>
> [Pcd.X64]
> gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ##
> SOMETIMES_CONSUMES
>
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @@
> Capsule Runtime Driver produces two UEFI capsule runtime services.
> (UpdateCapsule, QueryCapsuleCapabilities)
> It installs the Capsule Architectural Protocol defined in PI1.0a to signify
> the capsule runtime services are ready.
>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "CapsuleService.h"
> @@ -69,10 +69,18 @@ UpdateCapsule (
> BOOLEAN NeedReset;
> BOOLEAN InitiateReset;
> CHAR16 CapsuleVarName[30];
> CHAR16 *TempVarName;
>
> + //
> + // Check if platform support Capsule In RAM or not.
> + // Platform could choose to drop CapsulePei/CapsuleX64 and do not
> support Capsule In RAM.
> + //
> + if (!PcdGetBool(PcdCapsuleInRamSupport)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> //
> // Capsule Count can't be less than one.
> //
> if (CapsuleCount < 1) {
> return EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42560): https://edk2.groups.io/g/devel/message/42560
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 9:13 AM
To: Wu, Hao A; devel@edk2.groups.io; Xu, Wei6
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Hi Hao:
OK that is a good point. We will follow up to clean this. Tks
Hello Chao,
I am not sure if the update still applies to the UEFI spec with regard to
the description for the QueryCapsuleCapabilities service of EFI_RUNTIME_SERVICES.
IMO, I think it is fine, but it would be better to double confirm.
Best Regards,
Hao Wu
From: Wu, Hao A
Sent: Wednesday, June 19, 2019 9:00 AM
To: Zhang, Chao B <chao.b.zhang@intel.com>; devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 8:42 AM
To: Wu, Hao A; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Xu, Wei6
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Hi Hao:
I think blocking UpdateCapsule interface is enough for Capsule in RAM. QueryCapsuleCapabilities can still be used to test capsules before delivering by different sources.
Hello Chao,
I am okay with the usage update for the function.
But I think we need to update the comments for the QueryCapsuleCapabilities()
function within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' service for
EFI_RUNTIME_SERVICES to reflect the fact that even QueryCapsuleCapabilities()
returns without error, the capsule may still be unsupported by UpdateCapsule():
/**
Returns if the capsule can be supported via UpdateCapsule().
...
**/
Best Regards,
Hao Wu
From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Xu, Wei6 <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
Cc: Wang, Jian J <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>; Zhang, Chao B <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Xu,
> Wei6
> Sent: Wednesday, June 05, 2019 11:42 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to control this feature.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
> Platform could choose to drop CapsulePei/CapsuleX64 and not to support
> Capsule In Ram.
For this patch, it only affects UpdateCapsule(). Do we need to update the
behavior for QueryCapsuleCapabilities() as well?
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Cc: Chao B Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Signed-off-by: Wei6 Xu <wei6.xu@intel.com<mailto:wei6.xu@intel.com>>
> ---
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1
> +
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10
> +++++++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b 100644
> ---
> a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ##
> CONSUMES
>
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ##
> SOMETIMES_CONSUMES # Populate Image requires reset support.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ##
> CONSUMES
>
> [Pcd.X64]
> gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ##
> SOMETIMES_CONSUMES
>
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @@
> Capsule Runtime Driver produces two UEFI capsule runtime services.
> (UpdateCapsule, QueryCapsuleCapabilities)
> It installs the Capsule Architectural Protocol defined in PI1.0a to signify
> the capsule runtime services are ready.
>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "CapsuleService.h"
> @@ -69,10 +69,18 @@ UpdateCapsule (
> BOOLEAN NeedReset;
> BOOLEAN InitiateReset;
> CHAR16 CapsuleVarName[30];
> CHAR16 *TempVarName;
>
> + //
> + // Check if platform support Capsule In RAM or not.
> + // Platform could choose to drop CapsulePei/CapsuleX64 and do not
> support Capsule In RAM.
> + //
> + if (!PcdGetBool(PcdCapsuleInRamSupport)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> //
> // Capsule Count can't be less than one.
> //
> if (CapsuleCount < 1) {
> return EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42565): https://edk2.groups.io/g/devel/message/42565
Mute This Topic: https://groups.io/mt/31938579/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.