Reviewed-By: Olivier Martin <olivier.mar...@arm.com> -----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: 01 May 2015 16:36 To: ler...@redhat.com; Olivier Martin; leif.lindh...@linaro.org; roy.fr...@linaro.org; ge...@infradead.org; edk2-devel@lists.sourceforge.net Cc: Ard Biesheuvel Subject: [PATCH v3 2/2] ArmVExpressPkg: disallow the use of ArmVExpressSysConfigLib at runtime
The ArmVExpressSysConfigLib library does not (and cannot) runtime remap its MMIO registers, so return RETURN_UNSUPPORTED when trying to use it after calling SetVirtualAddressMap(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- .../Library/ArmVExpressSysConfigLib/ArmVExpressSysConfig.c | 6 ++++++ .../Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf | 1 + 2 files changed, 7 insertions(+) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfig.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfig.c index 6dfbacd11762..87ecb63c6c23 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfig.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmV +++ ExpressSysConfig.c @@ -13,8 +13,10 @@ **/ #include <Base.h> +#include <Uefi.h> #include <Library/IoLib.h> #include <Library/DebugLib.h> +#include <Library/UefiRuntimeLib.h> #include <Library/ArmPlatformSysConfigLib.h> #include <ArmPlatform.h> @@ -72,6 +74,10 @@ AccessSysCfgRegister ( { UINT32 SysCfgCtrl; + if (EfiGoneVirtual ()) { + return RETURN_UNSUPPORTED; + } + // Clear the COMPLETE bit MmioAnd32(ARM_VE_SYS_CFGSTAT_REG, ~SYS_CFGSTAT_COMPLETE); diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf index c1647756efbe..268202cc2038 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmV +++ ExpressSysConfigLib.inf @@ -33,3 +33,4 @@ [LibraryClasses] BaseLib IoLib + UefiRuntimeLib -- 1.9.1 -- 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. ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel