[Pkg-xen-devel] Bug#703586: Bug#703586: Xen fails to boot Linux dom0 under UEFI

John Keates john at keates.nl
Sun Sep 7 12:19:40 UTC 2014


As an addition to anyone having issues with booting but only getting 1 CPU and a ton of devices that misbehave,
check to see if you have an RSDP in Xen and Linux.

You should have both (I use xl and not xm):

sudo xl dmesg | grep RSDP
(XEN) ACPI: RSDP DDA4A000, 0024 (r2 SUPERM)

and

sudo dmesg | grep RSDP
[    0.000000] ACPI: RSDP 00000000000f0010 000024 (v02 SUPERM)

I’m running this on a Supermicro X10SL7-F to be a bit more precise.

If you can’t boot at all, it probably means some essential parts of your system will only with with ACPI.
For example, your GPU might not be found without ACPI. (I don’t really know if that is true, just thinking out loud)
Another reason why booting might not work is if you have the older e-801 issue.

Both are solved with running Xen without Grub, straight on UEFI.

John

On Sun, 7 Sep 2014 13:42:46 +0200 John Keates <john at keates.nl> wrote:
> Iíll explain whatís happening first, and list the steps after that.
> 
> First: pep is short for the Xen target x86_64-pep. Itís a target you can enable when configuring Xen to create an EFI binary.
> 
> What is happening with Xen on UEFI via Grub is that it doesnít give the kernel any info on the ACPI root pointer.
> Basically, this means that Linux wonít be able to do ACPI, and therefore a ton of hardware functionality is lost.
> The reason why this used to happen was the fact that Xen got a e-801 map from Grub for some reason.
> Not sure if that exact issue is still the source of this current issue, but Xen via Grub on EFI simply doesnít work.
> 
> But when you use Xen on UEFI via the EFI binary (xen.efi) it works just fine, the kernel gets to know about RSDP so it can do itís ACPI stuff.
> 
> Loading xen.efi can be done in different ways. The fastest way is to let efibootmgr know about it and booting it directly.
> Alternatively, you can simply test it by manually loading it from the UEFI shell, and as a third option, you can EFI chain load it from Grub.
> The chain loading pretty much means that grubx64.efi loads xen.efi just as you would from the shell or the bootmgr.
> 
> There is one small catch: Xen on native EFI doesnít give you a normal efivars system in dom0.
> This has to be fixed on a lower level in either Linux or Xen. From what Iíve found out so far, the efivars are passed in a different way to Linux,
> but Linux doesnít know about it and therefore cannot use it. This is the only downside to the whole thing. However, if you only want to boot using the EFI boot menu, this is not really a problem: you can still choose to boot xen.efi or grubx64.efi and when you boot grub and a non-Xen entry, you can use efivars (and efibootmgr) all you want.
> 
> Steps:
> 
> 1. Rebuild the debian package with a small change
> 
> Do your usual apt-sourcing and build-depping, but add the pep target to debian/rules:
> 
> (I put it right underneath include debian/rules.defs)
> 
> DEB_CONFIGURE_EXTRA_FLAGS  += --enable-targets=x86_64-pep
> 
> then do your usual binary run to produce the files needed.
> Youíll find xen.efi in ./debian/build/build-hypervisor_amd64_amd64/xen/xen.efi
> 
> 2. Allow UEFI to find your xen.efi
> 
> UEFI uses your ESP to launch the efi binaries, so thatís where it needs to go.
> Simply put (not symlink) xen.efi in /boot/efi/EFI/debian/
> 
> 3. Configure dom0 booting
> 
> In order for Xen to boot your dom0, youíll have to do two things:
> 
> - Get the kernel and initrd on the ESP as well
> - Configure Xen to load a specific kernel and initrd
> 
> The kernel and initrd are easy, just copy them from /boot/ to /boot/efi/EFI/debian/
> I used my most current kernel and initrd.
> 
> Xen.efi configuration is easy as well, since you only need to create a short ini-style cfg file.
> This configuration file needs to be on your ESP as well, with the kernel, initrd and xen.efi files.
> All in the same directory!
> 
> Xen.cfg is fairly straightforward, Iíll just put mine here:
> 
> [global]
> default=debian8
> 
> [debian8]
> options=console=vga,com1 com1=115200 loglvl=all noreboot
> kernel=vmlinuz-3.14-2-amd64 ignore_loglevel  root=/dev/mapper/clava-root ro quiet #earlyprintk=xen
> ramdisk=initrd.img-3.14-2-amd64


Met vriendelijke groet,

John Keates
Keates Creative Technology
06 52 633 813

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4124 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-xen-devel/attachments/20140907/2c868e28/attachment.bin>


More information about the Pkg-xen-devel mailing list