NetBSD-Bugs archive

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

kern/56390: vioif config error on evbarm/aarch64/Parallels Desktop for M1 Mac 17



>Number:         56390
>Category:       kern
>Synopsis:       vioif config error on evbarm/aarch64/Parallels Desktop for M1 Mac 17
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 06 09:10:00 +0000 2021
>Originator:     Yoshihisa Kawamoto
>Release:        NetBSD 9.99.88
>Organization:
>Environment:
System: NetBSD white.tenjin.org 9.99.88 NetBSD 9.99.88 (GENERIC64) #10: Sun Sep 5 10:17:02 UTC 2021 kawamoto%white.tenjin.org@localhost:/usr/obj/obj.aarch64/sys/arch/evbarm/compile/GENERIC64 evbarm
Architecture: aarch64
Machine: evbarm
>Description:
NetBSD-current works as an evbarm/aarch64 VM on Parallels Desktop for M1 Mac 17,
but a virtio network driver(vioif) has a configuration error and does not work.
> virtio0 at pci0 dev 5 function 0
> virtio0: network device (rev. 0x00)
> pci_io_find: expected type i/o, found mem
> virtio0: autoconfiguration error: can't map i/o space
> virtio0: autoconfiguration error: cannot attach (5)
In virtio_pci.c:virtio_pci_attach_09(), the code requests a port-mapped I/O,
but there are no port-mapped I/O in arm afaik, so that fails.

>How-To-Repeat:
Boot NetBSD-current on Parallels Desktop for Mac with M1 Mac.
>Fix:
I attached a quick patch and this works well. This calls also requesting
a memory-mapped I/O after failing an original request.
But I wonder if this is a right way to fix this issue or not.

Index: virtio_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/virtio_pci.c,v
retrieving revision 1.30
diff -u -r1.30 virtio_pci.c
--- virtio_pci.c	7 Aug 2021 16:19:14 -0000	1.30
+++ virtio_pci.c	5 Sep 2021 11:40:40 -0000
@@ -337,6 +337,8 @@
 
 	/* complete IO region */
 	if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
+			   &psc->sc_iot, &psc->sc_ioh, NULL, &psc->sc_iosize) &&
+	    pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM, 0,
 			   &psc->sc_iot, &psc->sc_ioh, NULL, &psc->sc_iosize)) {
 		aprint_error_dev(self, "can't map i/o space\n");
 		return EIO;



Home | Main Index | Thread Index | Old Index