diff --git a/layout.ld b/layout.ld index 582826da..2cd98d62 100644 --- a/layout.ld +++ b/layout.ld @@ -32,7 +32,7 @@ SECTIONS bss_size = . - bss_start; } - /* Our stack grows down and is page-algined. TODO: Add stack guard pages. */ + /* Our stack grows down and is page-aligned. TODO: Add stack guard pages. */ .stack (NOLOAD) : ALIGN(4K) { . += 64K; } stack_start = .; /* ram32.s only maps the first 2 MiB, and that must include the stack. */ diff --git a/src/pvh.rs b/src/pvh.rs index cad11ef6..22a661be 100644 --- a/src/pvh.rs +++ b/src/pvh.rs @@ -67,6 +67,8 @@ const XEN_ELFNOTE_PHYS32_ENTRY: u32 = 18; type Name = [u8; 4]; type Desc = unsafe extern "C" fn(); +// We make sure our ELF Note has an alignment of 4 for maximum compatibility. +// Some software (QEMU) calculates padding incorectly if alignment != 4. #[repr(C, packed(4))] struct Note { name_size: u32,