Refactor aarch64 barriers and TLBI commands
Use macros instead of function calls to not rely on LTO inlining.
Make macros take the op-kind argument to generalize.
Test: ./kokoro/ubuntu/build.sh
Change-Id: I8a5553d47cf3a0965fbf35d93c3c925f5f02ac4e
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 7ee74d1..621b847 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -18,6 +18,7 @@
#include "hf/arch/barriers.h"
#include "hf/arch/init.h"
+#include "hf/arch/mm.h"
#include "hf/api.h"
#include "hf/cpu.h"
@@ -102,15 +103,6 @@
}
/**
- * Ensures all explicit memory access and management instructions for
- * non-shareable normal memory have completed before continuing.
- */
-static void dsb_nsh(void)
-{
- __asm__ volatile("dsb nsh");
-}
-
-/**
* Invalidate all stage 1 TLB entries on the current (physical) CPU for the
* current VMID.
*/
@@ -135,7 +127,7 @@
* TLB invalidation has taken effect. Non-sharable is enough because the
* TLB is local to the CPU.
*/
- dsb_nsh();
+ dsb(nsh);
}
/**