mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
fix(zynqmp): fix sdei arm_validate_ns_entrypoint()
Don't use BL31_LIMIT macro for validation logic directly but clearly mark BL31_LIMIT as 64bit address to avoid compilation error when -Werror=logical-op is passed. Likely caused by ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE is in 64bit logic 0x100000000 and compiler handles it as 32bit value. That's why error is shown. Use uint64_t variable for limit and also for base. Here is command line to replicate this issue: make realclean; make -j PLAT=zynqmp DEBUG=1 RESET_TO_BL31=1 \ SPD=tspd SDEI_SUPPORT=1 ZYNQMP_ATF_MEM_BASE=0xFFFC0000 \ ZYNQMP_ATF_MEM_SIZE=0x00040000 all -Werror=logical-op Also error which is coming: plat/xilinx/zynqmp/zynqmp_sdei.c: In function 'arm_validate_ns_entrypoint': plat/xilinx/zynqmp/zynqmp_sdei.c:19:40: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] 19 | return (entrypoint < BL31_BASE || entrypoint > BL31_LIMIT) ? 0 : -1; Change-Id: Ie1f1b4d2cd94b977aebb72786ecace0b062da418 Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
463655cc81
commit
3b3c70a418
1 changed files with 4 additions and 1 deletions
|
@ -16,7 +16,10 @@
|
|||
|
||||
int arm_validate_ns_entrypoint(uintptr_t entrypoint)
|
||||
{
|
||||
return (entrypoint < BL31_BASE || entrypoint > BL31_LIMIT) ? 0 : -1;
|
||||
uint64_t base = BL31_BASE;
|
||||
uint64_t limit = BL31_LIMIT;
|
||||
|
||||
return (entrypoint < base || entrypoint > limit) ? 0 : -1;
|
||||
}
|
||||
|
||||
/* Private event mappings */
|
||||
|
|
Loading…
Add table
Reference in a new issue