Index | Thread | Search

From:
Jonathan Gray <jsg@jsg.id.au>
Subject:
Re: Probe xnf(4) and xbf(4) on Xen 4.17
To:
Joel Knight <knight.joel@gmail.com>
Cc:
tech <tech@openbsd.org>
Date:
Wed, 20 Nov 2024 16:18:11 +1100

Download raw body.

Thread
On Wed, Nov 13, 2024 at 05:14:00PM -0700, Joel Knight wrote:
> 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

Why is a device not attaching fatal?

Could the below diff work instead?  I can't find a list of xen devices,
but that would avoid the same problem the next time another is added.

Index: sys/dev/pv/xen.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/xen.c,v
diff -u -p -U8 -r1.98 xen.c
--- sys/dev/pv/xen.c	24 May 2024 10:05:55 -0000	1.98
+++ sys/dev/pv/xen.c	20 Nov 2024 05:10:47 -0000
@@ -1421,17 +1421,17 @@ xen_probe_devices(struct xen_softc *sc)
 		for (j = 0; j < iov2_cnt; j++) {
 			error = xen_attach_device(sc, xdl,
 			    (const char *)iovp1[i].iov_base,
 			    (const char *)iovp2[j].iov_base);
 			if (error) {
 				printf("%s: failed to attach \"%s/%s\"\n",
 				    sc->sc_dev.dv_xname, path,
 				    (const char *)iovp2[j].iov_base);
-				goto out;
+				continue;
 			}
 		}
 		/* Setup a watch for every device subtree */
 		if (xs_watch(sc, "device", (char *)iovp1[i].iov_base,
 		    &xdl->dl_task, xen_hotplug, xdl))
 			printf("%s: failed to setup hotplug watch for \"%s\"\n",
 			    sc->sc_dev.dv_xname, (char *)iovp1[i].iov_base);
 		SLIST_INSERT_HEAD(&sc->sc_devlists, xdl, dl_entry);