Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Xen EFI bootstrap



Hello

Booting Xen from EFI requires the multiboot 2 protocol, which I 
implemented (but not yet commited) for our bootx64.efi. I have
xen and a netbsd dom0 kernal starting up, but the netbsd kernel
panics.

The reason is there:

mainbus0 (root)
ACPI BIOS Error (bug): A valid RSDP was not found (20170303/tbxfroot-261)
acpi_probe: failed to initialize tables

ACPI RSDP is supposed to be discovered in sys/sarch/x86/acpi/acpi_machdep.c
There are two methods:
1) #ifndef XENPV, get it from EFI SystemTable
2) Otherwise search BIOS extended memory E0000-FFFFF

Second method will not work with EFI boot, since E0000-FFFFF is not
even mapped. The RSDP is somewhere else, and the EFI kernel is
supposed to discover it from EFI system table. I can see that xen
does find it:
(XEN) System RAM: 252MB (258252kB)
(XEN) ACPI: RSDP 0FBFA014, 0024 (r2 BOCHS )

Hence we need to use first method, which means removing this #ifndef XENPV
and building EFI code that let us access EFI SystemTable, in 
src/sys/arch/x86/x86/efi.c:efi_getsystblpa()

The physical address of the EFI SystemTable is obtained from bootinfo
BTINFO_EFI, which is filled by bootx64.efi when booting NetBSD without
Xen, but Xen does not provides it to the dom0.

I assume there must be a way to ask the hypervisor about SystemTable
address, but how? Any hint? 












-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index