From 39a1c2fddc674f4ce550baeeb9f144d0798d1214 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 3 Sep 2021 14:04:35 +0000 Subject: [PATCH] Make virtio(4) less restrictive on the type of BAR it supports for legacy versions. The current version of Parallels on M1 seems to not provide the I/O BAR that we expect, and reducing our expectations seems to be help. ok kettenis@ --- sys/dev/pci/virtio_pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/virtio_pci.c b/sys/dev/pci/virtio_pci.c index c99f50136cd..c3b1f2275b1 100644 --- a/sys/dev/pci/virtio_pci.c +++ b/sys/dev/pci/virtio_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio_pci.c,v 1.29 2021/06/12 13:08:30 kettenis Exp $ */ +/* $OpenBSD: virtio_pci.c,v 1.30 2021/09/03 14:04:35 patrick Exp $ */ /* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */ /* @@ -508,7 +508,10 @@ int virtio_pci_attach_09(struct virtio_pci_softc *sc, struct pci_attach_args *pa) { struct virtio_softc *vsc = &sc->sc_sc; - if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0, + pcireg_t type; + + type = pci_mapreg_type(pa->pa_pc, pa->pa_tag, PCI_MAPREG_START); + if (pci_mapreg_map(pa, PCI_MAPREG_START, type, 0, &sc->sc_iot, &sc->sc_ioh, NULL, &sc->sc_iosize, 0)) { printf("%s: can't map i/o space\n", vsc->sc_dev.dv_xname); return EIO; -- 2.20.1