Author: jrtc27
Date: Fri Dec 18 15:07:14 2020
New Revision: 368761
URL: https://svnweb.freebsd.org/changeset/base/368761

Log:
  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-phili...@linaro.org>
  Pointy hat:   jrtc27

Modified:
  head/sys/dev/virtio/mmio/virtio_mmio.c

Modified: head/sys/dev/virtio/mmio/virtio_mmio.c
==============================================================================
--- head/sys/dev/virtio/mmio/virtio_mmio.c      Fri Dec 18 12:40:19 2020        
(r368760)
+++ head/sys/dev/virtio/mmio/virtio_mmio.c      Fri Dec 18 15:07:14 2020        
(r368761)
@@ -409,10 +409,10 @@ vtmmio_negotiate_features(device_t dev, uint64_t child
 
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to