[coreboot] kexec of Xen hypervisor from a Linux payload

Trammell Hudson hudson at trmm.net
Tue Jul 26 17:37:20 CEST 2016


On Mon, Jul 25, 2016 at 03:56:22PM -0600, Trammell Hudson wrote:
> # There seems to be a regression with regard to kexec'ing into
> # a Xen kernel between Xen 3.1.0 (confirmed working) and 3.1.3
> # (confirmed not working).

I was able to reproduce this in qemu, which allowed me to debug
it much faster.  The problem is that 3.1.3 is making BIOS calls
to try to initialize the VGA console in xen/arch/x86/boot/video.S,
while 3.1.0 had much of it hard coded in the xen/drivers/video/vga.c
file.

I nop'ed out the calls to do the real mode stuff in
trampoline_boot_cpu_entry, which avoids lots of things like:

# Set the 80x25 mode. If already set, do nothing.
set_80x25:
        movw    $0x5019, bootsym(force_size)  # Override possibly broken BIOS
use_80x25:
        movw    $0x1202, %ax            # Force 400 scan lines
        movb    $0x30, %bl
        int     $0x10
        movw    $0x0003, %ax            # Mode 3
        int     $0x10
        stc
        ret

I also replaced vga.c with the one from the 3.1.0 Xen tree to hardcode
the text mode 3 configuration.  Now it is able to kexec the Xen 3.1.3
kernel from my Coreboot+Linux payload with no BIOS.

Unfortunately 3.1.3 is ancient; I'm going to build the more modern
Xen 4.6.x to see if I can repeat these fixes to boot into Qubes.

-- 
Trammell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xen-3.1.3.png
Type: image/png
Size: 16155 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20160726/1b187e0e/attachment.png>


More information about the coreboot mailing list