svn commit: r368761 - head/sys/dev/virtio/mmio

Jessica Clarke <[email protected]> Fri, 18 Dec 2020 15:07:14 +0000 (UTC)
Newsgroups gmane.os.freebsd.devel.cvs
Message-ID <202012181507.0BIF7ERX004930__3264.95721690065$1608304041$gmane$org@repo.freebsd.org>
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 <[email protected]>
  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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"