While testing OpenBSD with XCP-ng (https://xcp-ng.org/), I noticed changing the
virtual interface state (connecting/disconnecting) was leading to a panic.

The following diff fixes the problem on my test host.
(this is kind of "backported" from OpenBSD 6.1...)

If you are using OpenBSD on a Xen-based hypervisor, can you try and check if
this do not introduce a problem ?

Thank you.
Denis

Index: dev/pv/xen.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/xen.c,v
retrieving revision 1.97
diff -u -p -r1.97 xen.c
--- dev/pv/xen.c        29 Jun 2020 06:50:52 -0000      1.97
+++ dev/pv/xen.c        15 Oct 2021 16:30:38 -0000
@@ -1203,7 +1205,7 @@ xen_grant_table_remove(struct xen_softc 
            (ge->ge_table[ref].domid << 16);
        loop = 0;
        while (atomic_cas_uint(ptr, flags, GTF_invalid) != flags) {
-               if (loop++ > 10) {
+               if (loop++ > 10000000) {
                        panic("grant table reference %u is held "
                            "by domain %d: frame %#x flags %#x",
                            ref + ge->ge_start, ge->ge_table[ref].domid,

Reply via email to