summaryrefslogtreecommitdiff
path: root/spm/cactus/plat/arm/fvp
diff options
context:
space:
mode:
authorJ-Alves <joao.alves@arm.com>2021-07-28 13:57:09 +0100
committerJ-Alves <joao.alves@arm.com>2021-10-04 09:17:20 +0100
commit60ea4c3507f00781be41822271ba869da28d997e (patch)
tree36c74bab6c3f0cf70c37ba68505e645a12ab7522 /spm/cactus/plat/arm/fvp
parent912ab1a418d7cb6b79ab8cef7b726eb432d289d7 (diff)
fix(cactus): memory sharing tests failure MP
The last test to share memory functionality tested the FFA_MEMORY_DONATE interface. After donating the memory, the original owner didn't update its stage-1 translation at EL1. Hence, when booting a MP setup, there would be a data abort, as at stage-2 translation the memory region is now owned by the receiver of the test. Share memory region was being allocated part of the BSS section, was being mapped as a static region in the xlat libraries. A static region is not meant to be unmapped. To fix the above points: - allocated a memory region in the partition manifest of all Cactus SPs for the sake of the memory sharing tests. - at stage-1 before using it for the first memory share operation, the sender would map its segment as a dynamic region. - if test included a FFA_MEMORY_DONATE call, after donation the owner unmaps the memory region from its stage-1 translation. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I039c0d0d1633688b0e9d6ba1e2bbebfd518fc72b
Diffstat (limited to 'spm/cactus/plat/arm/fvp')
-rw-r--r--spm/cactus/plat/arm/fvp/fdts/cactus-secondary.dts8
-rw-r--r--spm/cactus/plat/arm/fvp/fdts/cactus-tertiary.dts8
-rw-r--r--spm/cactus/plat/arm/fvp/fdts/cactus.dts8
-rw-r--r--spm/cactus/plat/arm/fvp/include/cactus_platform_def.h5
4 files changed, 29 insertions, 0 deletions
diff --git a/spm/cactus/plat/arm/fvp/fdts/cactus-secondary.dts b/spm/cactus/plat/arm/fvp/fdts/cactus-secondary.dts
index 42f05fc..17ace6f 100644
--- a/spm/cactus/plat/arm/fvp/fdts/cactus-secondary.dts
+++ b/spm/cactus/plat/arm/fvp/fdts/cactus-secondary.dts
@@ -56,6 +56,14 @@
attributes = <0x3>; /* read-write */
};
+ /* Memory to be shared in memory sharing tests. */
+ share-memory {
+ description = "share-memory";
+ pages-count = <1>;
+ base-address = <0x00000000 0x7501000>;
+ attributes = <0x3>; /* read-write */
+ };
+
/* Without optional base-address */
test-memory {
description = "test-memory";
diff --git a/spm/cactus/plat/arm/fvp/fdts/cactus-tertiary.dts b/spm/cactus/plat/arm/fvp/fdts/cactus-tertiary.dts
index 38f15fe..88a5c3f 100644
--- a/spm/cactus/plat/arm/fvp/fdts/cactus-tertiary.dts
+++ b/spm/cactus/plat/arm/fvp/fdts/cactus-tertiary.dts
@@ -42,6 +42,14 @@
pages-count = <4>;
attributes = <0x7>; /* read-write-execute */
};
+
+ /* Memory to be shared in memory sharing tests. */
+ share-memory {
+ description = "share-memory";
+ pages-count = <1>;
+ base-address = <0x00000000 0x7502000>;
+ attributes = <0x3>; /* read-write */
+ };
};
device-regions {
diff --git a/spm/cactus/plat/arm/fvp/fdts/cactus.dts b/spm/cactus/plat/arm/fvp/fdts/cactus.dts
index 7d74e1e..759adc4 100644
--- a/spm/cactus/plat/arm/fvp/fdts/cactus.dts
+++ b/spm/cactus/plat/arm/fvp/fdts/cactus.dts
@@ -57,6 +57,14 @@
attributes = <0x3>; /* read-write */
};
+ /* Memory to be shared in memory sharing tests. */
+ share-memory {
+ description = "share-memory";
+ pages-count = <1>;
+ base-address =<0x00000000 0x7500000>;
+ attributes = <0x3>; /* read-write */
+ };
+
/* Without optional base-address */
test-memory {
description = "test-memory";
diff --git a/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h b/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
index d35194d..c48ce96 100644
--- a/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
+++ b/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
@@ -26,4 +26,9 @@
#define USR_BASE_FRAME ULL(0x2BFE0000)
#define PRIV_BASE_FRAME ULL(0x2BFF0000)
+/* Base address for memory sharing tests. */
+#define CACTUS_SP1_MEM_SHARE_BASE 0x7500000
+#define CACTUS_SP2_MEM_SHARE_BASE 0x7501000
+#define CACTUS_SP3_MEM_SHARE_BASE 0x7502000
+
#endif /* CACTUS_PLATFORM_DEF_H */