bitkeeper revision 1.1159.223.74 (420757a9FtyPHOdlg42s6EIT2DD1zw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 7 Feb 2005 11:57:29 +0000 (11:57 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 7 Feb 2005 11:57:29 +0000 (11:57 +0000)
Pad Xen image to end on a page boundary. Avoids kexec bug.
Signed-off-by: keir.fraser@cl.cam.ac.uk
xen/arch/x86/boot/mkelf32.c

index e16756237b5e24ef809b1abe99aebc1094bd8e48..4f32a7c0557f8665ed7880c9432dc296e6d7ef65 100644 (file)
@@ -245,6 +245,12 @@ int main(int argc, char **argv)
         return 1;
     }
 
+    /*
+     * End the image on a page boundary. This gets round alignment bugs
+     * in the boot- or chain-loader (e.g., kexec on the XenoBoot CD).
+     */
+    mem_siz += -(loadbase + mem_siz) & 0xfff;
+
     out_ehdr.e_entry = loadbase;
     out_ehdr.e_shoff = RAW_OFFSET + dat_siz;