aboutsummaryrefslogtreecommitdiffstats
path: root/executor/kvm.h
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2025-09-30 18:17:15 +0200
committerAlexander Potapenko <glider@google.com>2025-10-17 06:51:20 +0000
commitc42fde19c0fd97583e4c8f6f88e2059ba630bc08 (patch)
tree296fd533ff295df11a28799223bf878b1dfa3a24 /executor/kvm.h
parent2606b77513573de02745daefe9de925c9494cfff (diff)
executor: use dynamic page table allocation for guest
Use a pool of 32 pages to allocate PT and PE entries for the guest page tables. This eliminates the need for manually assigned page table entries that are brittle and may break when someone changes the memory layout.
Diffstat (limited to 'executor/kvm.h')
-rw-r--r--executor/kvm.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/executor/kvm.h b/executor/kvm.h
index 8e5dc62be..eb0bb7b56 100644
--- a/executor/kvm.h
+++ b/executor/kvm.h
@@ -41,17 +41,9 @@
#define X86_SYZOS_ADDR_PML4 0x2000
// PDP for GPAs 0x0 - 0x7fffffffff.
#define X86_SYZOS_ADDR_PDP 0x3000
-// Lowmem PD for GPAs 0x0 - 0x3fffffff.
-#define X86_SYZOS_ADDR_PD 0x4000
-// IOAPIC PD for GPAs 0xc0000000 - 0xffffffff.
-#define X86_SYZOS_ADDR_PD_IOAPIC 0x5000
-// Lowmem PT for GPAs 0x000000 - 0x1fffff.
-#define X86_SYZOS_ADDR_PT_LOW_MEM 0x6000
-// Two PTs for unused memory for GPAs 0x200000 - 0x3fffff.
-#define X86_SYZOS_ADDR_PT_UNUSED_MEM 0x7000
-// IOAPIC PT for GPAs 0xfed00000 - 0xfedfffff.
-#define X86_SYZOS_ADDR_PT_IOAPIC 0x9000
-#define X86_SYZOS_ADDR_VAR_IDT 0x10000
+// Pool of 32 pages for dynamic PT/PD allocations.
+#define X86_SYZOS_ADDR_PT_POOL 0x5000
+#define X86_SYZOS_ADDR_VAR_IDT 0x25000
#define X86_SYZOS_ADDR_SMRAM 0x30000
// Write to this page to trigger a page fault and stop KVM_RUN.