Incorrect feature negotiation for vhost-vdpa netdevice
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
QEMU cmdline:
=============
./x86_64-
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_
void vhost_net_
{
net->
vhost_
}
The vhost_ack_
void vhost_ack_
{ const int *bit = feature_bits;
while (*bit != VHOST_INVALID_
uint64_t bit_mask = (1ULL << *bit);
if (features & bit_mask)
bit++;
}
}
Because of this hdev->acked_
static int vhost_dev_
{
uint64_t *features = dev->acked_
.....
r = dev->vhost_
}
QEMU version: 5.1.0