kvm tools: Ninja out support for VIRTIO_F_FEATURES_HIGH
PATCH 1/1 kvm tools: Ninja out support for VIRTIO_F_FEATURES_HIGH
Rusty has just removed it out of the spec. Since we probably the only ones who implemented support for it, we should remove it out of our code as well.
There is no issue with breaking anything since nothing else worked with it, so it's fully backwards compatible.
--- tools/kvm/include/kvm/virtio.h | 3 +-- tools/kvm/virtio/core.c | 9 +-------- tools/kvm/virtio/pci.c | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-)
tools/kvm/include/kvm/virtio.h +1 -2
@@ -14,7 +14,6 @@#define VIRTIO_PCI_O_CONFIG 0#define VIRTIO_PCI_O_MSIX 1 -#define VIRTIO_PCI_O_FEATURES 2struct virt_queue {struct vring vring;
@@ -63,6 +62,6 @@ u16 virt_queue__get_head_iov(struct virt_queue *vq, struct iovec iov[], u16 *outu16 virt_queue__get_inout_iov (struct kvm *kvm,struct virt_queue *queue,struct iovec in_iov[],struct iovec out_iov[],u16 *in,u16 *out); -int virtio__get_dev_specific_field (int offset,bool msix,bool features_hi,u32 *config_off); +int virtio__get_dev_specific_field (int offset,bool msix,u32 *config_off);#endif /* KVM__VIRTIO_H */
tools/kvm/virtio/core.c +1 -8
@@ -128,7 +128,7 @@ u16 virt_queue__get_inout_iov(struct kvm *kvm, struct virt_queue *queue,return head; } -int virtio__get_dev_specific_field (int offset,bool msix,bool features_hi,u32 *config_off) +int virtio__get_dev_specific_field (int offset,bool msix,u32 *config_off) {if (msix) {if (offset <4 )
@@ -137,13 +137,6 @@ int virtio__get_dev_specific_field(int offset, bool msix, bool features_hi, u32 offset -=4 ; } -if (features_hi) { -if (offset <4 ) -return VIRTIO_PCI_O_FEATURES ; -else - offset -=4 ; - } - *config_off = offset;return VIRTIO_PCI_O_CONFIG ;
tools/kvm/virtio/pci.c +2 -2
@@ -69,7 +69,7 @@ static bool virtio_pci__specific_io_in(struct kvm *kvm, struct virtio_trans *vtrstruct virtio_pci *vpci = vtrans->virtio;int type =virtio__get_dev_specific_field (offset -20 ,virtio_pci__msix_enabled (vpci), -0 , &config_offset); + &config_offset);if (type ==VIRTIO_PCI_O_MSIX ) {switch (offset) {case VIRTIO_MSI_CONFIG_VECTOR :
@@ -140,7 +140,7 @@ static bool virtio_pci__specific_io_out(struct kvm *kvm, struct virtio_trans *vtstruct virtio_pci *vpci = vtrans->virtio;u32 config_offset, gsi, vec;int type =virtio__get_dev_specific_field (offset -20 ,virtio_pci__msix_enabled (vpci), -0 , &config_offset); + &config_offset);if (type ==VIRTIO_PCI_O_MSIX ) {switch (offset) {case VIRTIO_MSI_CONFIG_VECTOR :
Signature · 1 line
1.7.8
Pekka Enberg
AppliedQuoted 8 lines · Sasha Levin
Rusty has just removed it out of the spec. Since we probably the only ones who implemented support for it, we should remove it out of our code as well.
There is no issue with breaking anything since nothing else worked with it, so it's fully backwards compatible.
Cc Rusty Russell <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Applied, thanks!
How is this going to work going forward? Should I ask Rusty for an ACK before merging code that implements some (new) part of the virtio spec? I like the fact that we're bleeding edge but it's pointless for everyone involved if we implement something that's known to be half-baked in the spec.
Pekka
Quoted 10 lines · Pekka Enberg
Quoted 8 lines · Sasha Levin
Rusty has just removed it out of the spec. Since we probably the only ones who implemented support for it, we should remove it out of our code as well.
There is no issue with breaking anything since nothing else worked with it, so it's fully backwards compatible.
Cc Rusty Russell <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 7 lines
Applied, thanks!
How is this going to work going forward? Should I ask Rusty for an ACK before merging code that implements some (new) part of the virtio spec? I like the fact that we're bleeding edge but it's pointless for everyone involved if we implement something that's known to be half-baked in the spec.
There was a little cheating involved here since the spec basically broke backwards compatibility by removing 64 bit features, so it's a special case and probably won't happen (too many times) again.
Half baked features usually don't go into the spec as well, Rusty usually insists on having a working code besides just spec updates, so again - this was one of those rare special cases.
If Rusty or Michael could ACK our virtio patches it would be awesome.
Signature · 1 line
Sasha.
Rusty Russell
Acked-byQuoted 23 lines · Sasha Levin
Quoted 10 lines · Pekka Enberg
Quoted 8 lines · Sasha Levin
Rusty has just removed it out of the spec. Since we probably the only ones who implemented support for it, we should remove it out of our code as well.
There is no issue with breaking anything since nothing else worked with it, so it's fully backwards compatible.
Cc Rusty Russell <[email protected]>Signed-off-by Sasha Levin <[email protected]>Quoted 7 lines
Applied, thanks!
How is this going to work going forward? Should I ask Rusty for an ACK before merging code that implements some (new) part of the virtio spec? I like the fact that we're bleeding edge but it's pointless for everyone involved if we implement something that's known to be half-baked in the spec.
There was a little cheating involved here since the spec basically broke backwards compatibility by removing 64 bit features, so it's a special case and probably won't happen (too many times) again.
Quoted 5 lines
Half baked features usually don't go into the spec as well, Rusty usually insists on having a working code besides just spec updates, so again - this was one of those rare special cases.
If Rusty or Michael could ACK our virtio patches it would be awesome.
TLDR version: I shouldn't have put it in the spec until we needed it. The spec revert broke no guests, because no guest ever implemented high feature bits (both because it wasn't in the draft spec long, and no device defined > 32 features yet, so no guest needed to).
It also broke no hosts, since it was up to the host to offer the high feature bits. No host did, since no device needed those high bits. kvmtool guys are just enthusiasts, so they put in the infrastructure, but didn't use it.
If I'm wrong, then when we use bit 31 for something else, a new guest may break. It may happen, but we're going to 64 bits in a different manner, so we can avoid using bit 31 for a long time.
It's very unusual for me to un-spec things, but in this very limited case it fairly safe.
Cheers,
Rusty.