diff options
| author | Alexander Potapenko <glider@google.com> | 2026-01-23 18:28:30 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2026-01-26 09:30:24 +0000 |
| commit | a4c52dd6fa17ba8bb0a3d6a08de46c61035f693c (patch) | |
| tree | 75411466e642eecacb656ca17d8698ca7895b8ea /executor/common_kvm_amd64.h | |
| parent | 4589df0fc1eb4bcb09ee65d33c34136a1372bdb2 (diff) | |
executor: implement dynamic L2 page table allocation in SYZOS
Enable the SYZOS guest (L1) to dynamically allocate memory
for nested L2 page tables, replacing the previous rigid static layout.
Move the mem_region and syzos_boot_args struct definitions to the guest
header (common_kvm_amd64_syzos.h) to allow the guest to parse the memory
map injected by the host.
Introduce a bump allocator, guest_alloc_page(), which targets the
X86_SYZOS_ADDR_UNUSED heap. This allocator relies on a new struct
syzos_globals located at X86_SYZOS_ADDR_GLOBALS to track the allocation
offset.
Refactor setup_l2_page_tables() to allocate intermediate paging levels
(PDPT, PD, PT) via guest_alloc_page() instead of using fixed contiguous
offsets relative to the PML4. This allows for disjoint memory usage and
supports future recursion requirements.
Diffstat (limited to 'executor/common_kvm_amd64.h')
| -rw-r--r-- | executor/common_kvm_amd64.h | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/executor/common_kvm_amd64.h b/executor/common_kvm_amd64.h index 12bc8958d..a181e302e 100644 --- a/executor/common_kvm_amd64.h +++ b/executor/common_kvm_amd64.h @@ -215,18 +215,6 @@ static void setup_64bit_idt(struct kvm_sregs* sregs, char* host_mem, uintptr_t g #define MEM_REGION_FLAG_NO_HOST_MEM (1 << 6) #define MEM_REGION_FLAG_REMAINING (1 << 7) -struct mem_region { - uint64 gpa; - int pages; - uint32 flags; -}; - -struct syzos_boot_args { - uint32 region_count; - uint32 reserved; - struct mem_region regions[]; -}; - // SYZOS guest virtual memory layout (must be in sync with executor/kvm.h): static const struct mem_region syzos_mem_regions[] = { // AMD64 fixed data structures (5 pages: Zero, GDT, PML4, PDP, PD). |
