diff mbox series

[edk2,edk2-platforms,v2] Platform/ARM: use appropriate ReportStatusCodeLib resolution for RT drivers

Message ID 20171017134205.3907-1-ard.biesheuvel@linaro.org
State New
Headers show
Series [edk2,edk2-platforms,v2] Platform/ARM: use appropriate ReportStatusCodeLib resolution for RT drivers | expand

Commit Message

Ard Biesheuvel Oct. 17, 2017, 1:42 p.m. UTC
ResetSystemRuntimeDxe may be invoked by the OS at runtime, at which time
it will attempt to call into ReportStatusCodeLib. If we use the default
version for DXE drivers, this will access data structures that are no
longer there so switch to the special runtime version instead.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Sudeep Holla Oct. 17, 2017, 1:55 p.m. UTC | #1
On 17/10/17 14:42, Ard Biesheuvel wrote:
> ResetSystemRuntimeDxe may be invoked by the OS at runtime, at which time

> it will attempt to call into ReportStatusCodeLib. If we use the default

> version for DXE drivers, this will access data structures that are no

> longer there so switch to the special runtime version instead.

> 


Tested-by: Sudeep Holla <sudeep.holla@arm.com>


> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> index 8bcb84869c84..1605eedbdd8c 100644

> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> @@ -240,6 +240,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]

>    MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

>    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

>    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

> +  ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf

>  !if $(SECURE_BOOT_ENABLE) == TRUE

>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

>  !endif

> 


-- 
Regards,
Sudeep
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Leif Lindholm Oct. 17, 2017, 2 p.m. UTC | #2
Thanks.

Alexei, can you confirm that this addresses your concerns?

/
    Leif

On Tue, Oct 17, 2017 at 02:42:05PM +0100, Ard Biesheuvel wrote:
> ResetSystemRuntimeDxe may be invoked by the OS at runtime, at which time

> it will attempt to call into ReportStatusCodeLib. If we use the default

> version for DXE drivers, this will access data structures that are no

> longer there so switch to the special runtime version instead.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> index 8bcb84869c84..1605eedbdd8c 100644

> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> @@ -240,6 +240,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]

>    MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

>    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

>    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

> +  ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf

>  !if $(SECURE_BOOT_ENABLE) == TRUE

>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

>  !endif

> -- 

> 2.11.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Alexei Fedorov Oct. 17, 2017, 3:05 p.m. UTC | #3
Yes, system can be restarted properly with this patch.


Alexei.

________________________________
From: Leif Lindholm <leif.lindholm@linaro.org>

Sent: 17 October 2017 15:00:24
To: Ard Biesheuvel; Alexei Fedorov
Cc: edk2-devel@lists.01.org; Sudeep Holla
Subject: Re: [PATCH edk2-platforms v2] Platform/ARM: use appropriate ReportStatusCodeLib resolution for RT drivers

Thanks.

Alexei, can you confirm that this addresses your concerns?

/
    Leif

On Tue, Oct 17, 2017 at 02:42:05PM +0100, Ard Biesheuvel wrote:
> ResetSystemRuntimeDxe may be invoked by the OS at runtime, at which time

> it will attempt to call into ReportStatusCodeLib. If we use the default

> version for DXE drivers, this will access data structures that are no

> longer there so switch to the special runtime version instead.

>

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> index 8bcb84869c84..1605eedbdd8c 100644

> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> @@ -240,6 +240,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]

>    MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

>    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

>    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

> +  ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf

>  !if $(SECURE_BOOT_ENABLE) == TRUE

>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

>  !endif

> --

> 2.11.0

>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Leif Lindholm Oct. 17, 2017, 6:24 p.m. UTC | #4
Thanks!

I'll take that as a Tested-by:.

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Pushed as 1727ed8024.

/
    Leif

On Tue, Oct 17, 2017 at 03:05:36PM +0000, Alexei Fedorov wrote:
> Yes, system can be restarted properly with this patch.

> 

> 

> Alexei.

> 

> ________________________________

> From: Leif Lindholm <leif.lindholm@linaro.org>

> Sent: 17 October 2017 15:00:24

> To: Ard Biesheuvel; Alexei Fedorov

> Cc: edk2-devel@lists.01.org; Sudeep Holla

> Subject: Re: [PATCH edk2-platforms v2] Platform/ARM: use appropriate ReportStatusCodeLib resolution for RT drivers

> 

> Thanks.

> 

> Alexei, can you confirm that this addresses your concerns?

> 

> /

>     Leif

> 

> On Tue, Oct 17, 2017 at 02:42:05PM +0100, Ard Biesheuvel wrote:

> > ResetSystemRuntimeDxe may be invoked by the OS at runtime, at which time

> > it will attempt to call into ReportStatusCodeLib. If we use the default

> > version for DXE drivers, this will access data structures that are no

> > longer there so switch to the special runtime version instead.

> >

> > Contributed-under: TianoCore Contribution Agreement 1.1

> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> > ---

> >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 1 +

> >  1 file changed, 1 insertion(+)

> >

> > diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> > index 8bcb84869c84..1605eedbdd8c 100644

> > --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> > +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc

> > @@ -240,6 +240,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]

> >    MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

> >    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

> >    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

> > +  ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf

> >  !if $(SECURE_BOOT_ENABLE) == TRUE

> >    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

> >  !endif

> > --

> > 2.11.0

> >

> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 8bcb84869c84..1605eedbdd8c 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -240,6 +240,7 @@  [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
+  ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
 !if $(SECURE_BOOT_ENABLE) == TRUE
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
 !endif