xlat: Fix checks in mmap_add() and mmap_add_ctx()
Commit 79621f0 broke sgi575.

It is possible to have a region with 0 as value for the attributes. It
means device memory, read only, secure, executable. This is legitimate
if the code is in flash and the code is executed from there.

This is the case for SGI_MAP_FLASH0_RO, defined in the file
plat/arm/css/sgi/sgi_plat.c.

This problem is solved by checking both size and attributes in xlat v1.
In xlat v2, it is enough to check the granularity, as it can never be 0.

Change-Id: I7be11f1b0e51c4c2ffd560b4a6cdfbf15de2c276
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
1 parent 5634a49 commit a5fa5658e846ee00338dd90c2959b460e9aa54e6
@Antonio Nino Diaz Antonio Nino Diaz authored on 8 Oct 2018
Showing 2 changed files
View
lib/xlat_tables/xlat_tables_common.c
View
lib/xlat_tables_v2/xlat_tables_core.c