Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2020 15:07:14 +0000 (UTC)
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368761 - head/sys/dev/virtio/mmio
Message-ID:  <202012181507.0BIF7ERX004930@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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-philippe@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012181507.0BIF7ERX004930>