|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/arm: skip first 32 bytes of zimage32
Hi Stefano, On 20/03/2022 01:05, Stefano Stabellini wrote: From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx> The first 32 bytes of zImage32 are NOPs, not useful just there for compatibility. The reason is that some bootloaders skip the first 32 bytes when starting the kernel. See the comment in Linux arch/arm/boot/compressed/head.S. Please mention the Linux verson.
I have duplicated the comment and the instructions below:
@ This is a two-instruction NOP, which happens to bear the
@ PE/COFF signature "MZ" in the first two bytes, so the
kernel
@ is accepted as an EFI binary. Booting via the UEFI stub
@ will not execute those instructions, but the ARM/Linux
@ boot protocol does, so we need some NOPs here.
.inst MZ_MAGIC | (0xe225 << 16) @ eor r5, r5,
0x4d000
eor r5, r5, 0x4d000 @ undo previous
insn
I read this as they are NOPs and this change should not break the ARM/Linux boot protocol (we are using it in Xen). BTW, the instruction decoding is different compare to me. Which version of Linux are you using? See arch/arm/boot/compressed/efi-header.S. The new implementation doesn't work on Xen (at least on all versions of QEMU I tried). As I wrote above, they are NOPs. So why is this breaking?
This will need some explanation in the code. The code in the tools will also need to be updated. info->zimage.start = start;- info->zimage.len = end - start; + info->zimage.len = end - start - 32;info->load = kernel_zimage_load; Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |