summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-10-28 11:45:01 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-28 11:45:01 -0700
commit17e0a4adde76391e7f8be8a4f50083c24b6882a4 (patch)
treea8c3869fc59803245fa7ea292166c8a6f4d07515 /test/syscalls/linux
parent8fa18e8ecb3e3da2015e5c73db9e46494dcfeff7 (diff)
parent45221684f3e3d985f91a1a896cac616c537516e2 (diff)
Merge pull request #2849 from lubinszARM:pr_memory_barrier
PiperOrigin-RevId: 339504677
Diffstat (limited to 'test/syscalls/linux')
-rw-r--r--test/syscalls/linux/mmap.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/syscalls/linux/mmap.cc b/test/syscalls/linux/mmap.cc
index e52c9cbcb..83546830d 100644
--- a/test/syscalls/linux/mmap.cc
+++ b/test/syscalls/linux/mmap.cc
@@ -592,6 +592,12 @@ TEST_F(MMapTest, ProtExec) {
memcpy(reinterpret_cast<void*>(addr), machine_code, sizeof(machine_code));
+#if defined(__aarch64__)
+ // We use this as a memory barrier for Arm64.
+ ASSERT_THAT(Protect(addr, kPageSize, PROT_READ | PROT_EXEC),
+ SyscallSucceeds());
+#endif
+
func = reinterpret_cast<uint32_t (*)(void)>(addr);
EXPECT_EQ(42, func());