NetBSD-Bugs archive

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

kern/57813: Support for non-Xen PVH boot on amd64



>Number:         57813
>Category:       kern
>Synopsis:       Support for non-Xen PVH boot on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 03 09:15:00 +0000 2024
>Originator:     Emile 'iMil' Heitor
>Release:        current
>Organization:
NetBSD
>Environment:
NetBSD netbsd 10.99.10 NetBSD 10.99.10 (MICROVM) #811: Wed Jan  3 09:30:48 CET 2024  imil@tatooine:/
home/imil/src/github.com/NetBSD-src/sys/arch/amd64/compile/obj/MICROVM amd64
>Description:
PVH mode, introduced by Xen in version 4.4, permits to boot and pass informations to a kernel using a structure named start_info instead of going through the typical boot process involving the BIOS and a bootloader, which makes PVH boot much faster.

PVH specification which can be read here https://xenbits.xen.org/docs/4.6-testing/misc/pvh.html
NetBSD/Xen is able to boot using the PVH boot mechanism, but can't boot using other hypervisors such as qemu or Firecracker which now support PVH booting.

This is due to the fact that locore.S/start_xen32 expects start_info being passed by the calling hypervisor on %ebx to be located at the end of the symbol table. Qemu and Firecracker don't follow this rule which is not part of the official Xen ABI.
The following patch makes memory mapping loops happy by copying the start_info structure where it's expected.
After that, memory locations and boot parameters are correctly found and
boot can proceed.
Of course, the hypervisor not being Xen, a lot of Xen-related code is
useless, hence the new VM_GUEST_GENPVH (for Generic PVH) vm_guest type.

What's been tested:

- PVH boot with qemu
- PVH boot with Firecracker
- Regular boot with qemu
- Standard Xen domU boot
>How-To-Repeat:
N/A
>Fix:
Apply this patch to NetBSD-current, tested until 10.99.10 https://imil.net/NetBSD/GENPVH.patch



Home | Main Index | Thread Index | Old Index