]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand/multiboot: adjust the protocol between loader and kernel
authorRoger Pau Monné <royger@FreeBSD.org>
Wed, 27 Jan 2021 10:12:07 +0000 (11:12 +0100)
committerRoger Pau Monné <royger@FreeBSD.org>
Fri, 29 Jan 2021 14:23:26 +0000 (15:23 +0100)
commitb6d85a5f51e4147452b35d76478fb9e191b7734b
tree323a0961a71676a12d634d2ec3717b165f3f1f39
parentebc61c86b5567f2e5a3c5f452e86879b558b376b
stand/multiboot: adjust the protocol between loader and kernel

There's a currently ad-hoc protocol to hand off the FreeBSD kernel
payload between the loader and the kernel itself when Xen is in the
middle of the picture. Such protocol wasn't very resilient to changes
to the loader itself, because it relied on moving metadata around to
package it using a certain layout. This has proven to be fragile, so
replace it with a more robust version.

The new protocol requires using a xen_header structure that will be
used to pass data between the FreeBSD loader and the FreeBSD kernel
when booting in dom0 mode. At the moment the only data conveyed is the
offset of the start of the module metadata relative to the start of the
module itself.

This is a slightly disruptive change since it also requires a change
to the kernel which is contained in this patch. In order to update
with this change the kernel must be updated before updating the
loader, as described in the handbook. Note this is only required when
booting a FreeBSD/Xen dom0. This change doesn't affect the normal
FreeBSD boot protocol.

This fixes booting FreeBSD/Xen in dom0 mode after
3630506b9daec9167a89bc4525638ea45a00769e.

Sponsored by: Citrix Systems R&D
MFC after: 3 days
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D28411
stand/i386/libi386/multiboot.c
sys/x86/include/metadata.h
sys/x86/xen/pv.c