Boot Protocol

Document Revision: 26h1.0
Protocol version: ZXFL_VERSION_4 (0x00000004)


1. Overview

The kernel receives a pointer to zxfl_boot_protocol_t in %r2 at entry. All pointer fields are HHDM virtual addresses. The struct is version 4.

The kernel must validate proto->magic == ZXFL_MAGIC (0x5A58464C, "ZXFL") before using any other field. A mismatch indicates the wrong value is in %r2 or the loader did not complete correctly.


2. Header Fields

FieldTypeValue / Description
magicu320x5A58464C ("ZXFL")
versionu320x00000004
flagsu32Bitmask of ZXFL_FLAG_* (see §8)
binding_tokenu64ZXVL_SEED ^ stfle_fac[0] ^ ipl_schid

3. Loader Identity

FieldTypeDescription
loader_majoru16Major version (1)
loader_minoru16Minor version (0)
loader_timestampu32Build time encoded as HHMMSSZx

4. IPL Device

FieldTypeDescription
ipl_schidu32Subchannel ID of the IPL device
ipl_dev_typeu16Device type from Sense ID (e.g. 0x3390)
ipl_dev_modelu16Device model from Sense ID

5. Kernel Image

FieldTypeDescription
kernel_phys_startu64Physical base of loaded kernel
kernel_phys_endu64Physical end (exclusive), after modules
kernel_entryu64ELF entry point (HHDM virtual)

6. Memory Map

FieldTypeDescription
mem_total_bytesu64Total usable + kernel RAM
mem_map_addru64HHDM virtual address of zxfl_mem_region_t[]
mem_map_countu32Number of valid entries

Each zxfl_mem_region_t entry is defined as:

FieldTypeDescription
baseu64Physical base address of the region
lengthu64Length of the region in bytes
typeu32ZXFL_MEM_* constant
numa_nodeu8Logical NUMA node ID this memory region belongs to

7. Page Table Pool

FieldTypeDescription
pgtbl_pool_endu64Physical end of bootloader page-table bump pool

Pool base is the first 1 MB-aligned address after kernel_phys_end, floored at 32 MB. The kernel PMM must mark [pool_base, pgtbl_pool_end) as reserved.


8. Kernel Stack

FieldTypeDescription
kernel_stack_topu64HHDM virtual address of initial stack top (32 KB)

The kernel should switch to its own stack as early as possible and treat this region as reserved.


9. Control Register Snapshots

FieldTypeDescription
cr0_snapshotu64CR0 at time of kernel jump
cr1_snapshotu64CR1 (ASCE) at time of jump
cr13_snapshotu64CR13 at time of jump

10. SMP / CPU Map

FieldTypeDescription
cpu_map[]zxfl_cpu_info_t[128]Up to 128 CPU entries
cpu_countu32Valid entries in cpu_map
bsp_cpu_addru16CPU address of the boot processor

Each zxfl_cpu_info_t:

FieldTypeDescription
cpu_addru16CPU address (0–65535)
typeu8ZXFL_CPU_TYPE_* constant
stateu8ZXFL_CPU_ONLINE or ZXFL_CPU_STOPPED
numa_nodeu8Logical NUMA node ID derived from physical book/socket
drawer_idu8Drawer physical identifier from STSI 15.1.x
book_idu8Book physical identifier from STSI 15.1.x
socket_idu8Socket physical identifier from STSI 15.1.x
chip_idu8Chip physical identifier from STSI 15.1.x
thread_idu8Thread physical identifier from STSI 15.1.x

Valid when ZXFL_FLAG_SMP is set.


11. System Identification

Populated from STSI when ZXFL_FLAG_SYSINFO is set:

FieldDescription
manufacturer[16]ASCII, e.g. "IBM"
type[4]Machine type, e.g. "2964"
model[16]Model identifier
sequence[16]Machine serial number
plant[4]Manufacturing plant code
lpar_name[8]LPAR name (STSI 2.2.2); empty on bare metal
lpar_numberLPAR number
cpus_totalTotal CPUs in CEC
cpus_configuredConfigured CPUs
cpus_standbyStandby CPUs
capabilityCPU capability rating

12. Modules

Up to 16 modules loaded from sysmodule= parmfile entries:

FieldDescription
modules[i].name[32]Dataset name (NUL-terminated)
modules[i].phys_startPhysical load address
modules[i].size_bytesSize in bytes

13. Flags

FlagBitMeaning
ZXFL_FLAG_SMP0cpu_map[] is valid
ZXFL_FLAG_MEM_MAP1mem_map is valid
ZXFL_FLAG_CMDLINE2cmdline_addr is valid
ZXFL_FLAG_LOWCORE3lowcore_phys is valid
ZXFL_FLAG_STFLE4stfle_fac[] is valid
ZXFL_FLAG_SYSINFO5sysinfo is valid
ZXFL_FLAG_TOD6tod_boot is valid

14. Binding Token

The binding token ties the boot session to the specific hardware and IPL device:

$$\texttt{binding_token} = \texttt{ZXVL_SEED} \oplus \texttt{stfle_fac[0]} \oplus \texttt{ipl_schid}$$

The kernel must recompute this value and compare it to proto->binding_token. A mismatch means the protocol was tampered with or the kernel is running on unexpected hardware.

The binding token is also used as a component of the ZXVL handshake nonce and the stack frame canary. See ZXVL Verification.