From owner-svn-src-all@freebsd.org Wed May 6 23:31:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37DD32E29D8; Wed, 6 May 2020 23:31:31 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HXsv0pKCz4MSk; Wed, 6 May 2020 23:31:31 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F3275C1; Wed, 6 May 2020 23:31:31 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 046NVUcX081641; Wed, 6 May 2020 23:31:30 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046NVUPW081638; Wed, 6 May 2020 23:31:30 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005062331.046NVUPW081638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 6 May 2020 23:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360723 - in head/sys/dev/virtio: balloon console random scsi X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/sys/dev/virtio: balloon console random scsi X-SVN-Commit-Revision: 360723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2020 23:31:31 -0000 Author: jrtc27 Date: Wed May 6 23:31:30 2020 New Revision: 360723 URL: https://svnweb.freebsd.org/changeset/base/360723 Log: virtio: Support MMIO bus for all devices The bus is independent of the device, so all devices can be attached to either a PCI bus or an MMIO bus. For example, QEMU's virtio-rng-device gives the MMIO variant of virtio-rng-pci, and is now detected. Reviewed by: andrew, br, brooks (mentor) Approved by: andrew, br, brooks (mentor) Differential Revision: https://reviews.freebsd.org/D24730 Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/console/virtio_console.c head/sys/dev/virtio/random/virtio_random.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Wed May 6 23:31:30 2020 (r360723) @@ -153,6 +153,8 @@ static driver_t vtballoon_driver = { }; static devclass_t vtballoon_devclass; +DRIVER_MODULE(virtio_balloon, virtio_mmio, vtballoon_driver, + vtballoon_devclass, 0, 0); DRIVER_MODULE(virtio_balloon, virtio_pci, vtballoon_driver, vtballoon_devclass, 0, 0); MODULE_VERSION(virtio_balloon, 1); @@ -160,6 +162,7 @@ MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_balloon, VIRTIO_ID_BALLOON, "VirtIO Balloon Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_balloon); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_balloon); static int Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/console/virtio_console.c Wed May 6 23:31:30 2020 (r360723) @@ -256,6 +256,8 @@ static driver_t vtcon_driver = { }; static devclass_t vtcon_devclass; +DRIVER_MODULE(virtio_console, virtio_mmio, vtcon_driver, vtcon_devclass, + vtcon_modevent, 0); DRIVER_MODULE(virtio_console, virtio_pci, vtcon_driver, vtcon_devclass, vtcon_modevent, 0); MODULE_VERSION(virtio_console, 1); @@ -263,6 +265,7 @@ MODULE_DEPEND(virtio_console, virtio, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_console, VIRTIO_ID_CONSOLE, "VirtIO Console Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_console); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_console); static int Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/random/virtio_random.c Wed May 6 23:31:30 2020 (r360723) @@ -96,6 +96,8 @@ static driver_t vtrnd_driver = { }; static devclass_t vtrnd_devclass; +DRIVER_MODULE(virtio_random, virtio_mmio, vtrnd_driver, vtrnd_devclass, + vtrnd_modevent, 0); DRIVER_MODULE(virtio_random, virtio_pci, vtrnd_driver, vtrnd_devclass, vtrnd_modevent, 0); MODULE_VERSION(virtio_random, 1); @@ -104,6 +106,7 @@ MODULE_DEPEND(virtio_random, random_device, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_random, VIRTIO_ID_ENTROPY, "VirtIO Entropy Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_random); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_random); static int Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Wed May 6 23:31:30 2020 (r360723) @@ -228,6 +228,8 @@ static driver_t vtscsi_driver = { }; static devclass_t vtscsi_devclass; +DRIVER_MODULE(virtio_scsi, virtio_mmio, vtscsi_driver, vtscsi_devclass, + vtscsi_modevent, 0); DRIVER_MODULE(virtio_scsi, virtio_pci, vtscsi_driver, vtscsi_devclass, vtscsi_modevent, 0); MODULE_VERSION(virtio_scsi, 1); @@ -235,6 +237,7 @@ MODULE_DEPEND(virtio_scsi, virtio, 1, 1, 1); MODULE_DEPEND(virtio_scsi, cam, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_scsi, VIRTIO_ID_SCSI, "VirtIO SCSI Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_scsi); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_scsi); static int