aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_kvm_arm64.h
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-11-18 11:23:01 +0100
committerAlexander Potapenko <glider@google.com>2024-11-26 11:12:47 +0000
commit3bbc60604366c324295d54a7d93dd7d258a0e2aa (patch)
tree7f2598945acc42bd3f2b3a901decc9260307fc5a /executor/common_kvm_arm64.h
parent26cf63663eb59ad18dd3d635de7698a91ba24f2a (diff)
executor: arm64: allocate memory for ITS tables on the host side
Diffstat (limited to 'executor/common_kvm_arm64.h')
-rw-r--r--executor/common_kvm_arm64.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/executor/common_kvm_arm64.h b/executor/common_kvm_arm64.h
index bb47c88f4..bc809a152 100644
--- a/executor/common_kvm_arm64.h
+++ b/executor/common_kvm_arm64.h
@@ -104,6 +104,12 @@ static void setup_vm(int vmfd, void* host_mem, void** text_slot)
// Map the remaining pages at address 0.
next = alloc_guest_mem(&allocator, allocator.size);
vm_set_user_memory_region(vmfd, slot++, 0, 0, next.size, (uintptr_t)next.addr);
+
+ // Allocate memory for the ITS tables.
+ // TODO(glider): leak this memory for now, this shouldn't be a problem for the short-living executor process.
+ int its_size = SZ_64K * (4 + /*num_cpus*/ 4 + /*num_devices*/ 16);
+ void* its = mmap(NULL, its_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
+ vm_set_user_memory_region(vmfd, slot++, 0, ARM64_ADDR_ITS_TABLES, its_size, (uintptr_t)its);
}
#endif