Only write to VIRTIO_MMIO_GUEST_PAGE_SIZE with virtio mmio version 1
This register is only defined for the legacy v1 interface so only write to it when interacting with a legacy device. Sponsored by: Innovate UK
This commit is contained in:
parent
1238a28d15
commit
7377c1df84
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363390
@ -491,8 +491,10 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs,
|
|||||||
if (sc->vtmmio_vqs == NULL)
|
if (sc->vtmmio_vqs == NULL)
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
|
|
||||||
|
if (sc->vtmmio_version == 1) {
|
||||||
vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE,
|
vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE,
|
||||||
(1 << PAGE_SHIFT));
|
(1 << PAGE_SHIFT));
|
||||||
|
}
|
||||||
|
|
||||||
for (idx = 0; idx < nvqs; idx++) {
|
for (idx = 0; idx < nvqs; idx++) {
|
||||||
vqx = &sc->vtmmio_vqs[idx];
|
vqx = &sc->vtmmio_vqs[idx];
|
||||||
@ -564,8 +566,10 @@ vtmmio_reinit(device_t dev, uint64_t features)
|
|||||||
|
|
||||||
vtmmio_negotiate_features(dev, features);
|
vtmmio_negotiate_features(dev, features);
|
||||||
|
|
||||||
|
if (sc->vtmmio_version == 1) {
|
||||||
vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE,
|
vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE,
|
||||||
(1 << PAGE_SHIFT));
|
(1 << PAGE_SHIFT));
|
||||||
|
}
|
||||||
|
|
||||||
for (idx = 0; idx < sc->vtmmio_nvqs; idx++) {
|
for (idx = 0; idx < sc->vtmmio_nvqs; idx++) {
|
||||||
error = vtmmio_reinit_virtqueue(sc, idx);
|
error = vtmmio_reinit_virtqueue(sc, idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user