Page MenuHomeFreeBSD

PVH: Set bootmethod to XEN or PVH appropriately
ClosedPublic

Authored by cperciva on Aug 13 2022, 12:57 AM.

Details

Summary

Now that we can PVH boot on a non-Xen hypervisor, we shouldn't set
machdep.bootmethod to "XEN" unconditionally. Instead, set it to
"XEN" if we're running under Xen and "PVH" otherwise.

Diff Detail

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

Event Timeline

I'm assuming that the whole issue of overloading boot method with what bios interface is available isn't made worse by this :)

This revision is now accepted and ready to land.Aug 13 2022, 3:12 PM
In D36191#821464, @imp wrote:

I'm assuming that the whole issue of overloading boot method with what bios interface is available isn't made worse by this :)

Right, in this case we're not really booting with PC BIOS *or* UEFI.

I don't think it really matters here, but it caught my eye when I ran sysctl -a | grep -i xen so I figured I might as well fix it. In the longer term I expect this file to move to sys/x86/x86/pvh.c so we can more fully separate "PVH" and "Xen PVH", so this code will be churned later anyway.

I think I would prefer setting it to PVH in both cases, we have other ways to expose the underlying hypervisor, and the boot entry point is the same for Xen or KVM PVH.

Set bootmethod to "PVH" even when we're PVH-booting from Xen, per royger's comment.

This revision now requires review to proceed.Aug 17 2022, 12:18 AM

LGTM, the commit/revision title needs updating AFAICT.

This revision is now accepted and ready to land.Sep 23 2022, 1:53 PM
This revision was automatically updated to reflect the committed changes.