>Submitter-Id: net
>Originator: Scott Blomenkamp <[email protected]>
>Synopsis: stock 8.0 panics attaching xbf0 as a Xen HVM guest started by
OvmfXen
>Severity: non-critical
>Priority: medium
>Category: kernel
>Class: sw-bug
>Release: 8.0
>Environment:
System : OpenBSD 8.0 GENERIC #82, stock install on GPT/UEFI
Architecture: OpenBSD.amd64
Machine : Xen 4.20 HVM guest (xl), bios = "ovmf" with
bios_path_override = an OVMF built from EDK2
OvmfPkg/OvmfXen.dsc (edk2-stable202608), 2 vCPUs
>Description:
The kernel panics while xbf0 attaches:

xen0 at pvbus0: features 0x1d2305, 64 grant table frames, event channel 1
xbf0 at xen0 backend 0 channel 6: disk
panic: page full, sc 0xffff80000002f900 gnt 0xffff800000100000 (4)
ge 0xffff800000100078
panic() at panic+0xc9
xen_grant_table_alloc() at xen_grant_table_alloc+0x2a5
xen_bus_dmamap_create() at xen_bus_dmamap_create+0xbb
xbf_alloc_ccbs() at xbf_alloc_ccbs+0x181

OVMF's own Xen PV drivers use the grant table before the OS
starts and leave non-zero entries behind. xen(4) treats an entry
with frame != 0 as in use, so the first table page looks full.
The same panic happens when OvmfXen boots a PVH domain. SeaBIOS
HVM is not affected (no firmware PV drivers).
>How-To-Repeat:
name = "obsd-hvm"
type = "hvm"
memory = 1024
vcpus = 2
bios = "ovmf"
bios_path_override = "/path/to/OVMFXEN.fd"
disk = [ "format=raw,vdev=xvda,access=rw,target=/path/to/openbsd80-gpt.raw"
]
serial = "pty"
Type "boot" at the loader prompt if it waits. The panic comes
about 40 s later.
>Fix:
None attached. Locally, clearing the grant entries that the OS
hasn't reserved when it maps a grant table frame got the guest to
login under both HVM and PVH with this firmware; xbf0 and xnf0
attach.

Disclosure: I found and analysed this with the help of an AI
assistant (Anthropic's Claude), in a lab on Xen 4.20. The panic and
trace above are from a real run with the stock 8.0 kernel. No
AI-written code is attached.

Reply via email to