diff options
author | Jessica Clarke <jrtc27@FreeBSD.org> | 2020-12-18 15:07:14 +0000 |
---|---|---|
committer | Jessica Clarke <jrtc27@FreeBSD.org> | 2020-12-18 15:07:14 +0000 |
commit | 50a6b28a31a03bed650d8eb05b48b8268bac8d95 (patch) | |
tree | a963aa3d61a5f0871265c789c3213267be8aae68 /sys | |
parent | b62ae61446ee19ab524fea4a066f585cbd7aa727 (diff) | |
download | src-test2-50a6b28a31a03bed650d8eb05b48b8268bac8d95.tar.gz src-test2-50a6b28a31a03bed650d8eb05b48b8268bac8d95.zip |
virtio_mmio: Fix feature negotiation copy-paste issue in r361943
This caused us to write to the low half of the feature word twice, once with
the high bits and once with the low bits. Common legacy device implementations
seem to be fairly lenient about being able to write to the feature bits
multiple times, but Arm's models use a stricter implementation that will ignore
the second write. This fixes using vtnet(4) on those models.
Reported by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Pointy hat: jrtc27
Notes
Notes:
svn path=/head/; revision=368761
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/virtio/mmio/virtio_mmio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index a9c7b65741cd..348c82da3528 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -409,10 +409,10 @@ vtmmio_negotiate_features(device_t dev, uint64_t child_features) vtmmio_describe_features(sc, "negotiated", features); - vtmmio_write_config_4(sc, VIRTIO_MMIO_HOST_FEATURES_SEL, 1); + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_FEATURES_SEL, 1); vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_FEATURES, features >> 32); - vtmmio_write_config_4(sc, VIRTIO_MMIO_HOST_FEATURES_SEL, 0); + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_FEATURES_SEL, 0); vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_FEATURES, features); return (features); |