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
diff --git a/spm/cactus/plat/arm/tc0/fdts/cactus.dts b/spm/cactus/plat/arm/tc0/fdts/cactus.dts
index 142535c..bcf9245 100644
--- a/spm/cactus/plat/arm/tc0/fdts/cactus.dts
+++ b/spm/cactus/plat/arm/tc0/fdts/cactus.dts
@@ -54,6 +54,14 @@
base-address = <0x00000000 0xfe301000>;
attributes = <0x3>; /* read-write */
};
+
+ /* Memory to be shared in memory sharing tests. */
+ share-memory {
+ description = "share-memory";
+ pages-count = <1>;
+ base-address =<0x00000000 0xfe500000>;
+ attributes = <0x3>; /* read-write */
+ };
};
device-regions {