fix: pass ns bit to tlb invalidate
From Arm ARM I.a D8.13.5 TLB maintenance instructions I_CPNYZ,
"For TLB maintenance instructions that take a register argument that
holds an IPA and that do not apply to a range of addresses, the register
specified by the Xt argument has the following format:
Register bit[63] is one of the following:
-If the instruction is executed in Secure state, the NS bit specifying
the Secure or Non-secure IPA space.
-If the instruction is executed in Non-secure state, RES 0."
The mm library is missing specifying the security state for S2 TLB
invalidation by IPA. It means S2 TLB invalidation operations always
apply to the secure IPA space. This change conveys a parameter
specifying if the S2 TLB operation applies to the secure or NS IPA
space, resulting in invalidating pages from the appropriate IPA space.
Change-Id: Iba2449112ffad0c1fc1fc460c2a67600075df743
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/inc/hf/mm.h b/inc/hf/mm.h
index e416103..25bc1ce 100644
--- a/inc/hf/mm.h
+++ b/inc/hf/mm.h
@@ -129,7 +129,7 @@
bool mm_vm_unmap(struct mm_ptable *t, paddr_t begin, paddr_t end,
struct mpool *ppool);
void mm_stage1_defrag(struct mm_ptable *t, struct mpool *ppool);
-void mm_vm_defrag(struct mm_ptable *t, struct mpool *ppool);
+void mm_vm_defrag(struct mm_ptable *t, struct mpool *ppool, bool non_secure);
void mm_vm_dump(struct mm_ptable *t);
bool mm_vm_get_mode(struct mm_ptable *t, ipaddr_t begin, ipaddr_t end,
uint32_t *mode);