summaryrefslogtreecommitdiff
path: root/cactus
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-11-10 10:21:23 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2017-11-10 15:33:46 +0000
commitbdfe99834260af0e3f929e1fd9e1b0691637e2e3 (patch)
tree6742dca14be0ebeee20881cf115b83374809ebc4 /cactus
parent9e5fb401b25215bfbea7706b60a0368242f745d2 (diff)
cactus: Fix test of incorrect granularity
After the changes done to the shared buffers and the heap of the Secure Partitions (now they are mapped with a 4 KiB granularity) it is needed to find a new memory region for the tests. The region chosen is the 2 MiB block right after the UART registers. This means that, even if the test failed and the region changed its attributes it wouldn't leave the console useless. This only applies to FVP. Change-Id: I108603d12c53fd8078f7c05aa806484c1224546b Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'cactus')
-rw-r--r--cactus/cactus_tests_memory_attributes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cactus/cactus_tests_memory_attributes.c b/cactus/cactus_tests_memory_attributes.c
index ac15f7e..d6dfc69 100644
--- a/cactus/cactus_tests_memory_attributes.c
+++ b/cactus/cactus_tests_memory_attributes.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include <debug.h>
#include <errno.h>
+#include <platform_def.h>
#include <secure_partition.h>
#include <spm_svc.h>
#include <stdio.h>
@@ -203,11 +204,12 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
announce_test_start(test_desc6);
/*
- * The Secure Partition is placed in DRAM, so there is a lot of
- * remaining space that doesn't have any restrictions when it is mapped.
- * It has most likely been mapped with a granularity of 2MB.
+ * This address is usually mapped at a 2 MiB granularity. By using as
+ * test address the block after the console we make sure that in case
+ * the attributes of the block actually changed, the console would work
+ * and we would get the error message.
*/
- addr = boot_info->sp_mem_limit - 2 * PAGE_SIZE;
+ addr = ((uintptr_t)PLAT_ARM_UART_BASE + 0x200000ULL) & ~(0x200000ULL - 1ULL);
attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
ret = request_mem_attr_changes(addr, 1, attributes);
expect(ret, SPM_INVALID_PARAMETER);