liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

arm-image-friendly-load-addr.patch (1409B)


      1 Loading kernel at offset 0x10000 works only for zImage, but not for Image,
      2 because the kernel expect the start of decompressed kernel (.head.text) to be
      3 at an address that's a distance that's 16MB aligned from  PAGE_OFFSET +
      4 TEXT_OFFSET (see vmlinux.lds.S). This check is enfornced in __fixup_pv_table in
      5 arch/arm/kernel/head.S TEXT_OFFSET is 0x00008000, so a 16MB alignment needs to
      6 have a "0x8000" in the lower 16 bits so that they cancel out. Currently the
      7 offset Qemu loads it at is 0x10000.
      8 
      9 With zImage, this need is met because zImage loads the uncompressed Image
     10 correctly, however when loading an Image and executing directly Qemu is
     11 required it to load it at the correct location. Doing so, doesn't break Qemu's
     12 zImage loading. With this patch, both zImage and Image work correctly.
     13 
     14 Original patch from https://patchwork.kernel.org/project/linux-arm-kernel/patch/1395718484-20424-1-git-send-email-joelf@ti.com/ was
     15 Signed-off-by: Joel Fernandes <joelf@ti.com>
     16 
     17 (Edited by Daniel Barlow to apply cleanly to more recent QEMU)
     18 
     19 diff --git a/hw/arm/boot.c b/hw/arm/boot.c
     20 index ada2717f76..18bcdd45d2 100644
     21 --- a/hw/arm/boot.c
     22 +++ b/hw/arm/boot.c
     23 @@ -32,7 +32,7 @@
     24   */
     25  #define KERNEL_ARGS_ADDR   0x100
     26  #define KERNEL_NOLOAD_ADDR 0x02000000
     27 -#define KERNEL_LOAD_ADDR   0x00010000
     28 +#define KERNEL_LOAD_ADDR   0x00008000
     29  #define KERNEL64_LOAD_ADDR 0x00080000
     30  
     31  #define ARM64_TEXT_OFFSET_OFFSET    8