Skip to content

Commit 4589df0

Browse files
executor: introduce global state page for SYZOS
Reserve a dedicated 4KB page at X86_SYZOS_ADDR_GLOBALS (0x17F000) to store global state shared across the SYZOS L1 guest environment. This region is required to store the state of the guest-side memory allocator (specifically the allocation offset and total size of the unused heap), enabling thread-safe dynamic memory allocation for nested L2 page tables.
1 parent ef506c9 commit 4589df0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

executor/common_kvm_amd64.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ static const struct mem_region syzos_mem_regions[] = {
237237
{X86_SYZOS_ADDR_BOOT_ARGS, 1, 0},
238238
// Dynamic Page Table Pool.
239239
{X86_SYZOS_ADDR_PT_POOL, X86_SYZOS_PT_POOL_SIZE, 0},
240+
// Global State Page.
241+
{X86_SYZOS_ADDR_GLOBALS, 1, 0},
240242
// SMRAM memory.
241243
{X86_SYZOS_ADDR_SMRAM, 10, 0},
242244
// Unmapped region to trigger a page faults for uexits etc.

executor/kvm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
// Base offset for the area containing the 4 L2 VM slots.
7777
#define X86_SYZOS_L1_VCPU_OFFSET_L2_VMS_AREA 0x1000
7878

79+
// Global state page (Allocator offsets, etc).
80+
#define X86_SYZOS_ADDR_GLOBALS 0x17F000
81+
7982
// Separated Page Table Pool in high memory.
8083
// Located above L2 VCPU regions.
8184
#define X86_SYZOS_ADDR_PT_POOL 0x180000

0 commit comments

Comments
 (0)