diff options
| author | Andrew Turner <andrew@FreeBSD.org> | 2020-07-21 14:25:36 +0000 |
|---|---|---|
| committer | Andrew Turner <andrew@FreeBSD.org> | 2020-07-21 14:25:36 +0000 |
| commit | 7377c1df84c21ab95cf19f56c56c8404427421b6 (patch) | |
| tree | 626ac2b1e9663850fedf96c8b95bb5c4947cf813 /sys/dev/virtio | |
| parent | 1238a28d152e19b4d0ad0ad98a464e83278c494f (diff) | |
Notes
Diffstat (limited to 'sys/dev/virtio')
| -rw-r--r-- | sys/dev/virtio/mmio/virtio_mmio.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index 0414706fb990..a9c7b65741cd 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -491,8 +491,10 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs, if (sc->vtmmio_vqs == NULL) return (ENOMEM); - vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, - (1 << PAGE_SHIFT)); + if (sc->vtmmio_version == 1) { + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); + } for (idx = 0; idx < nvqs; idx++) { vqx = &sc->vtmmio_vqs[idx]; @@ -564,8 +566,10 @@ vtmmio_reinit(device_t dev, uint64_t features) vtmmio_negotiate_features(dev, features); - vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, - (1 << PAGE_SHIFT)); + if (sc->vtmmio_version == 1) { + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); + } for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { error = vtmmio_reinit_virtqueue(sc, idx); |
