From 3bbc60604366c324295d54a7d93dd7d258a0e2aa Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Mon, 18 Nov 2024 11:23:01 +0100 Subject: executor: arm64: allocate memory for ITS tables on the host side --- executor/common_kvm_arm64.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'executor/common_kvm_arm64.h') 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 -- cgit mrf-deployment