feat(memory share): protect/unprotect memory
Use the protect/unprotect functions in ffa_region_group_identity_map.
The referred functions are responsible for updating S2 PTs.
The functions have been extended to use the map actions to extended
the previous uses for "check" and "commit" the page tables.
The "check" is extended with "check protect" to be able to request
the monitor to configure memory into secure PAS.
The "commit" is extend with "commit unprotect" to be able to reset
memory back to non-secure PAS.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ifd209cea2d1d351698e87d9e8796daa376c28b90
diff --git a/inc/hf/ffa_internal.h b/inc/hf/ffa_internal.h
index c6bc73e..66946d5 100644
--- a/inc/hf/ffa_internal.h
+++ b/inc/hf/ffa_internal.h
@@ -11,6 +11,7 @@
#include <stdint.h>
#include "hf/check.h"
+#include "hf/vm.h"
#include "vmapi/hf/ffa.h"
diff --git a/inc/hf/ffa_memory_internal.h b/inc/hf/ffa_memory_internal.h
index a478e31..51835b5 100644
--- a/inc/hf/ffa_memory_internal.h
+++ b/inc/hf/ffa_memory_internal.h
@@ -170,10 +170,11 @@
uint32_t *fragment_constituent_counts, uint32_t fragment_count,
uint32_t sender_orig_mode, uint32_t share_func, bool clear,
struct mpool *page_pool);
-bool ffa_region_group_identity_map(
+struct ffa_value ffa_region_group_identity_map(
struct vm_locked vm_locked,
struct ffa_memory_region_constituent **fragments,
const uint32_t *fragment_constituent_counts, uint32_t fragment_count,
- uint32_t mode, struct mpool *ppool, enum ffa_map_action action);
+ uint32_t mode, struct mpool *ppool, enum ffa_map_action action,
+ bool *memory_protected);
bool memory_region_receivers_from_other_world(
struct ffa_memory_region *memory_region);