Page MenuHomeFreeBSD

stand/multiboot: adjust the protocol between loader and kernel
ClosedPublic

Authored by royger on Jan 29 2021, 11:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 1:26 AM
Unknown Object (File)
Mar 19 2024, 8:30 AM
Unknown Object (File)
Mar 7 2024, 2:11 PM
Unknown Object (File)
Jan 19 2024, 12:26 PM
Unknown Object (File)
Jan 15 2024, 10:57 AM
Unknown Object (File)
Dec 20 2023, 6:21 AM
Unknown Object (File)
Dec 18 2023, 11:13 AM
Unknown Object (File)
Dec 7 2023, 7:02 PM
Subscribers

Details

Summary

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 stat 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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

stand/i386/libi386/multiboot.c
298

strdup() can fail and return NULL.

303

we probably should use archsw.arch_copyin() but then again, this is i386 tree anyhow...

This revision is now accepted and ready to land.Jan 29 2021, 12:41 PM