NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/58335 (Kernel panic when shutting down a virtual machine with Virtio devices)



The following reply was made to PR kern/58335; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: =?UTF-8?Q?Roddy_Gonz=C3=A1lez?= <roddy.gonzalez.89%gmail.com@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, kern-bug-people%NetBSD.org@localhost,
	netbsd-bugs%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost
Subject: Re: kern/58335 (Kernel panic when shutting down a virtual machine
	with Virtio devices)
Date: Fri, 28 Jun 2024 18:29:24 +0000

 This is a multi-part message in MIME format.
 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1
 
 Oops, corrected patch attached -- this one should actually build.
 
 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1
 Content-Type: text/plain; charset="ISO-8859-1"; name="virtio_shutdown_printf_v2"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="virtio_shutdown_printf_v2.patch"
 
 diff --git a/sys/dev/pci/virtio_pci.c b/sys/dev/pci/virtio_pci.c
 index 88afdd5e6d33..9fb155454a72 100644
 --- a/sys/dev/pci/virtio_pci.c
 +++ b/sys/dev/pci/virtio_pci.c
 @@ -178,7 +178,7 @@ static bool	virtio_pci_msix_enabled(struct virtio_pci_s=
 oftc *);
 =20
  CFATTACH_DECL3_NEW(virtio_pci, sizeof(struct virtio_pci_softc),
      virtio_pci_match, virtio_pci_attach, virtio_pci_detach, NULL,
 -    virtio_pci_rescan, NULL, 0);
 +    virtio_pci_rescan, NULL, DVF_DETACH_SHUTDOWN);
 =20
  static const struct virtio_ops virtio_pci_ops_09 =3D {
  	.kick =3D virtio_pci_kick_09,
 @@ -374,12 +374,19 @@ virtio_pci_detach(device_t self, int flags)
  		for (i =3D 0; i < __arraycount(psc->sc_bars_iot); i++) {
  			if (psc->sc_bars_iosize[i] =3D=3D 0)
  				continue;
 +			printf("%s:%d: unmap space %p handle %p size %zu\n",
 +			    __func__, __LINE__, psc->sc_bars_iot[i],
 +			    (void *)psc->sc_bars_ioh[i],
 +			    psc->sc_bars_iosize[i]);
  			bus_space_unmap(psc->sc_bars_iot[i],
  			    psc->sc_bars_ioh[i], psc->sc_bars_iosize[i]);
  			psc->sc_bars_iosize[i] =3D 0;
  		}
  	} else {
  		if (psc->sc_iosize) {
 +			printf("%s:%d: unmap space %p handle %p size %zu\n",
 +			    __func__, __LINE__, psc->sc_iot,
 +			    (void *)psc->sc_ioh, psc->sc_iosize);
  			bus_space_unmap(psc->sc_iot, psc->sc_ioh,
  			    psc->sc_iosize);
  			psc->sc_iosize =3D 0;
 
 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1--
 


Home | Main Index | Thread Index | Old Index