Index | Thread | Search

From:
Joel Knight <knight.joel@gmail.com>
Subject:
Probe xnf(4) and xbf(4) on Xen 4.17
To:
tech <tech@openbsd.org>
Date:
Wed, 13 Nov 2024 17:14:00 -0700

Download raw body.

Thread
Hi. As reported here[1], something changed between Xen 4.13 and 4.17
which causes xnf and xbf to no longer probe on boot. The culprit
appears to be XenStore advertising a "9pfs" device, which OpenBSD
doesn't support, so xen_probe_devices() aborts early. The 9pfs device
is first in the list of devices returned by XS.

The diff below results in xnf and xbf attaching again on 7.6.


.joel


1 - https://xcp-ng.org/forum/topic/9897/openbsd-xcp-ng-8-3-virtio-net-guesttools-no-longer-works

dmesg on -release:
OpenBSD 7.6 (GENERIC.MP) #338: Mon Sep 30 08:55:35 MDT 2024
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
bios0: vendor Xen version "4.17" date 10/02/2024
bios0: Xen HVM domU
pvbus0 at mainbus0: Xen 4.17
xen0 at pvbus0: features 0x112705, 64 grant table frames, event channel 3
xen0: failed to attach "device/9pfs/"
xspd0 at pci0 dev 3 function 0 "XenSource Platform Device" rev 0x02


dmesg with diff below:
OpenBSD 7.6-stable (GENERIC.MP) #6: Tue Nov 12 12:55:03 MST 2024
bios0: vendor Xen version "4.17" date 10/02/2024
bios0: Xen HVM domU
pvbus0 at mainbus0: Xen 4.17
xen0 at pvbus0: features 112705<PIRQ,PVCLOCK,CBVEC,AUTOPMAP,WPT>,
idtvec 112, 64 grant table frames, event channel 3
xbf0 at xen0 backend 0 channel 8: cdrom
xbf1 at xen0 backend 0 channel 8: disk
sd0 at scsibus1 targ 0 lun 0: <Xen, phy xvda 768, 0000>
xbf2 at xen0 backend 0 channel 9: disk
sd1 at scsibus2 targ 0 lun 0: <Xen, phy xvdb 832, 0000>
xnf0 at xen0 backend 0 channel 10: address 45:44:b4:f4:f4:94
xspd0 at pci0 dev 3 function 0 "XenSource Platform Device" rev 0x02


Index: sys/dev/pv/xen.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/xen.c,v
diff -p -u -r1.98 xen.c
--- sys/dev/pv/xen.c    24 May 2024 10:05:55 -0000      1.98
+++ sys/dev/pv/xen.c    13 Nov 2024 04:07:20 -0000
@@ -1405,6 +1405,8 @@ xen_probe_devices(struct xen_softc *sc)
        for (i = 0; i < iov1_cnt; i++) {
                if (strcmp("suspend", (char *)iovp1[i].iov_base) == 0)
                        continue;
+               if (strcmp("9pfs", (char *)iovp1[i].iov_base) == 0)
+                       continue;
                snprintf(path, sizeof(path), "device/%s",
                    (char *)iovp1[i].iov_base);
                if ((error = xs_cmd(&xst, XS_LIST, path, &iovp2,