[CFT] ELF Relocatable x86 and x86_64 bzImages




I have spent some time and have gotten my relocatable kernel patches
working against the latest kernels. I intend to push this upstream
shortly.

Could all of the people who care take a look and test this out
to make certain that it doesn't just work on my test box?

My approach is to extend bzImage so that it is an ET_DYN ELF executable
(we have what used to be a bootsector where we can put the header).
Boot loaders are explicitly not expected to process relocations.

The x86_64 kernel is simply built to live at a fixed virtual address
and the boot page tables are relocated. The i386 kernel is built
to process relocates generated with --embedded-relocs (after vmlinux.lds.S)
has been fixed up to sort out static and dynamic relocations.

Currently there are 33 patches in my tree to do this.

The weirdest symptom I have had so far is that page faults did not
trigger the early exception handler on x86_64 (instead I got a reboot).

The code should be available shortly at:
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-reloc.git#reloc-v2.6.18-rc3

If all goes well with the testing I will push the patches to Andrew in the next couple
of days.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Patch to reorder functions in the vmlinux to a defined order
    ... to let the bootloader know it was possible though. ... With the linker able to generate the relocations you can ... do it outside of most of the kernel where we have the decompressor. ... I only haven't submitted the patches because I was too busy stabilizing ...
    (Linux-Kernel)
  • [RFC][PATCH 0/12] ELF Relocatable x86 bzImage (V2)
    ... Eric biederman implemented the relocatable kernel support for x86 and x86_64 ... We have been testing the patches in RHEL kernels since then and things are ... The i386 kernel is built to process relocations generated with --emit-relocs ...
    (Linux-Kernel)
  • Re: [RFC] ELF Relocatable x86 and x86_64 bzImages
    ... The bzImage format ... can't even represent loading a kernel at other than it's default address. ... generally need to be as simple and as fixed as possible because bootloaders ... Beyond that if you look at head.S the code to process the relocations ...
    (Linux-Kernel)
  • Re: 2.6.21-rc5-mm3 - no boot, "address not 2M aligned"
    ... One can argue that now people should use a relocatable kernel ... would one specify an address to a boot-loader to load image at? ... I thought this was important for vmlinux and Xen? ... Performing relocations in vmlinux will be interesting. ...
    (Linux-Kernel)
  • Re: 2.6.21-rc5-mm3 - no boot, "address not 2M aligned"
    ... One can argue that now people should use a relocatable kernel ... I thought this was important for vmlinux and Xen? ... I guess at this point the easy case is that we modify /sbin/kexec to support ... a little cleverness we can move the code that processes relocations into ...
    (Linux-Kernel)