Reapply "[MTE] allocate ring buffer for stack history"
This reverts commit 45b29f13bbefd1edc1d16a15bb4c1f8e8d8068fc.
The observed slowdown was actually an artifact of stack alignment.
Change-Id: I3af8af33c624491124bfed07e869b4330adfacb3
diff --git a/tests/libs/testbinary_is_stack_mte.cpp b/tests/libs/testbinary_is_stack_mte.cpp
index d8074d5..0cdc466 100644
--- a/tests/libs/testbinary_is_stack_mte.cpp
+++ b/tests/libs/testbinary_is_stack_mte.cpp
@@ -36,7 +36,9 @@
#if defined(__BIONIC__) && defined(__aarch64__)
extern "C" int main(int, char**) {
- int ret = is_stack_mte_on() ? 0 : 1;
+ void* mte_tls_ptr = mte_tls();
+ *reinterpret_cast<uintptr_t*>(mte_tls_ptr) = 1;
+ int ret = is_stack_mte_on() && mte_tls_ptr != nullptr ? 0 : 1;
printf("RAN\n");
return ret;
}