From f301da44fa233bbde2e457b64aa7903623c53586 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Tue, 25 Apr 2017 14:09:47 +0100 Subject: [PATCH] xlat: Always compile TLB invalidation functions TLB invalidation functions used to be conditionally compiled in. They were enabled only when using the dynamic mapping feature. because only then would we need to modify page tables on the fly. Actually there are other use cases where invalidating TLBs is required. When changing memory attributes in existing translation descriptors for example. These other use cases do not necessarily depend on the dynamic mapping feature. This patch removes this dependency and always compile TLB invalidation functions in. If they're not used, they will be removed from the binary at link-time anyway so there's no consequence on the memory footprint if these functions are not called. Change-Id: I1c33764ae900eb00073ee23b7d0d53d4efa4dd21 Signed-off-by: Sandrine Bailleux --- lib/xlat_tables_v2/aarch64/xlat_tables_arch.c | 5 ----- lib/xlat_tables_v2/xlat_tables_private.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c index 760db928..81e035be 100644 --- a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c +++ b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -82,8 +81,6 @@ int is_mmu_enabled(void) #endif } -#if PLAT_XLAT_TABLES_DYNAMIC - void xlat_arch_tlbi_va(uintptr_t va) { /* @@ -124,8 +121,6 @@ void xlat_arch_tlbi_va_sync(void) isb(); } -#endif /* PLAT_XLAT_TABLES_DYNAMIC */ - int xlat_arch_current_el(void) { int el = GET_EL(read_CurrentEl()); diff --git a/lib/xlat_tables_v2/xlat_tables_private.h b/lib/xlat_tables_v2/xlat_tables_private.h index d352583c..fbd9578a 100644 --- a/lib/xlat_tables_v2/xlat_tables_private.h +++ b/lib/xlat_tables_v2/xlat_tables_private.h @@ -34,6 +34,8 @@ typedef enum { MT_DYNAMIC = 1 << MT_DYN_SHIFT } mmap_priv_attr_t; +#endif /* PLAT_XLAT_TABLES_DYNAMIC */ + /* * Function used to invalidate all levels of the translation walk for a given * virtual address. It must be called for every translation table entry that is @@ -47,8 +49,6 @@ void xlat_arch_tlbi_va(uintptr_t va); */ void xlat_arch_tlbi_va_sync(void); -#endif /* PLAT_XLAT_TABLES_DYNAMIC */ - /* Print VA, PA, size and attributes of all regions in the mmap array. */ void print_mmap(mmap_region_t *const mmap); -- 2.30.2