summary refs log tree commit diff stats
path: root/results/scraper/launchpad-without-comments/1924603
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-06-30 12:24:58 +0000
committerChristian Krinitsin <mail@krinitsin.com>2025-06-30 12:27:06 +0000
commit33606b41d35115f887ea688b1a16f2ff85bf2fe4 (patch)
tree406b2c7b19a087ba437c68f3dbf0b589fa1d6150 /results/scraper/launchpad-without-comments/1924603
parentadedf8771bc4de3113041ca21bd4d0d1c0014b6a (diff)
downloademulator-bug-study-33606b41d35115f887ea688b1a16f2ff85bf2fe4.tar.gz
emulator-bug-study-33606b41d35115f887ea688b1a16f2ff85bf2fe4.zip
add launchpad bug reports without comments
Diffstat (limited to 'results/scraper/launchpad-without-comments/1924603')
-rw-r--r--results/scraper/launchpad-without-comments/192460351
1 files changed, 51 insertions, 0 deletions
diff --git a/results/scraper/launchpad-without-comments/1924603 b/results/scraper/launchpad-without-comments/1924603
new file mode 100644
index 00000000..54247ff7
--- /dev/null
+++ b/results/scraper/launchpad-without-comments/1924603
@@ -0,0 +1,51 @@
+Incorrect feature negotiation for vhost-vdpa netdevice
+
+QEMU cmdline:
+=============
+./x86_64-softmmu/qemu-system-x86_64 -machine accel=kvm -m 2G -hda  /gautam/centos75_1.qcow2 -name gautam,process=gautam -enable-kvm -netdev vhost-vdpa,id=mynet0,vhostdev=/dev/vhost-vdpa-0 -device virtio-net-pci,netdev=mynet0,mac=02:AA:BB:DD:00:20,disable-modern=off,page-per-vq=on -cpu host --nographic
+
+Host OS:
+========
+Linux kernel 5.11 running on x86 host
+
+Guest OS:
+==========
+CentOS 7.5
+
+Root cause analysis:
+=====================
+
+For vhost-vdpa netdevice, the feature negotiation results in sending the superset of features received from device in call to get_features vdpa ops callback.
+
+During the feature-negotiation phase, the acknowledged feature bits are initialized with backend_features  and then checked for supported feature bits in vhost_ack_features():
+
+void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
+{
+  net->dev.acked_features = net->dev.backend_features;
+  vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net), features);
+}
+
+ 
+The vhost_ack_features() function just builds up on the dev.acked_features and never trims it down:
+
+void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features)
+{     const int *bit = feature_bits;
+
+      while (*bit != VHOST_INVALID_FEATURE_BIT) {
+           uint64_t bit_mask = (1ULL << *bit);      
+
+            if (features & bit_mask)
+                 hdev->acked_features |= bit_mask;
+
+            bit++;
+       }
+}
+
+Because of this hdev->acked_features is always minimally equal to the value of device features and this is the value that is passed to the device in set_features callback:
+
+static int vhost_dev_set_features(struct vhost_dev *dev, bool enable_log)
+{
+       uint64_t *features = dev->acked_features;
+       .....
+       r = dev->vhost_ops->*vhost_set_features*(dev, features);
+}
\ No newline at end of file