audk/ArmPkg/Include
Ard Biesheuvel 31441f2983 ArmPkg/ArmMmuLib: avoid type promotion in TCR_EL1 assignment
Commit fafb7e9c11 ("ArmPkg: correct TTBR1_EL1 settings in TCR_EL1")
introduced a symbolic constant TCR_TG1_4KB which resolves to (2 << 30),
and ORs it into the value to be written into TCR_EL1 (if executing at
EL1). Since the constant is implicitly typed as signed int, and has the
sign bit set, the promotion that occurs when casting to UINT64 results
in a TCR value that has bits [63:32] all set, which includes mostly
RES0 bits but also the TBIn, AS and IPS fields.

So explicitly redefine all TCR related constants as 'unsigned long'
types, using the UL suffix. To avoid confusion in the future, the
inappropriately named VTCR_EL23_xxx constants have the leading V
removed, and the actual VTCR_EL2 related constants are dropped, given
that we never configure stage 2 translation in UEFI.

Reported-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
2016-07-13 12:38:48 +02:00
..
Chipset ArmPkg/ArmMmuLib: avoid type promotion in TCR_EL1 assignment 2016-07-13 12:38:48 +02:00
Guid ARM Packages: Replace tabs by spaces for indentation 2014-08-26 10:14:17 +00:00
IndustryStandard ArmPkg: Add PSCI 0.2 constants for system poweroff and reset 2014-09-10 18:45:08 +00:00
Library ArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLib 2016-07-07 14:33:47 +02:00
Ppi ArmPkg/ArmMpCoreInfo.h: Fixed macro definition 2013-12-10 16:37:10 +00:00
Protocol ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
AsmMacroExport.inc ArmPkg RVCT: add asm macro combining EXPORT, AREA and label definition 2015-12-02 16:23:20 +00:00
AsmMacroIoLib.h ArmPkg: remove SetPrimaryStack and InitializePrimaryStack macros 2015-11-27 17:11:03 +00:00
AsmMacroIoLib.inc ArmPkg: remove SetPrimaryStack and InitializePrimaryStack macros 2015-11-27 17:11:03 +00:00
AsmMacroIoLibV8.h ArmPkg/AsmMacroIoLibV8: remove undocumented assumption from ELx macros 2016-03-22 14:39:01 +01:00