@@ -248,4 +248,6 @@ void virtio_set_guest_features(struct kvm *kvm, struct virtio_device *vdev,
void virtio_notify_status(struct kvm *kvm, struct virtio_device *vdev,
void *dev, u8 status);
+u64 virtio_dev_get_host_features(struct virtio_device *vdev, struct kvm *kvm, void *dev);
+
#endif /* KVM__VIRTIO_H */
@@ -283,6 +283,11 @@ void virtio_notify_status(struct kvm *kvm, struct virtio_device *vdev,
vdev->ops->notify_status(kvm, dev, ext_status);
}
+u64 virtio_dev_get_host_features(struct virtio_device *vdev, struct kvm *kvm, void *dev)
+{
+ return vdev->ops->get_host_features(kvm, dev);
+}
+
bool virtio_access_config(struct kvm *kvm, struct virtio_device *vdev,
void *dev, unsigned long offset, void *data,
size_t size, bool is_write)
@@ -26,7 +26,7 @@ static void virtio_mmio_config_in(struct kvm_cpu *vcpu,
break;
case VIRTIO_MMIO_DEVICE_FEATURES:
if (vmmio->hdr.host_features_sel == 0)
- val = vdev->ops->get_host_features(vmmio->kvm,
+ val = virtio_dev_get_host_features(vdev, vmmio->kvm,
vmmio->dev);
ioport__write32(data, val);
break;
@@ -26,7 +26,7 @@ static void virtio_mmio_config_in(struct kvm_cpu *vcpu,
case VIRTIO_MMIO_DEVICE_FEATURES:
if (vmmio->hdr.host_features_sel > 1)
break;
- features |= vdev->ops->get_host_features(vmmio->kvm, vmmio->dev);
+ features |= virtio_dev_get_host_features(vdev, vmmio->kvm, vmmio->dev);
val = features >> (32 * vmmio->hdr.host_features_sel);
break;
case VIRTIO_MMIO_QUEUE_NUM_MAX:
@@ -44,7 +44,7 @@ static bool virtio_pci__data_in(struct kvm_cpu *vcpu, struct virtio_device *vdev
switch (offset) {
case VIRTIO_PCI_HOST_FEATURES:
- val = vdev->ops->get_host_features(kvm, vpci->dev);
+ val = virtio_dev_get_host_features(vdev, kvm, vpci->dev);
ioport__write32(data, val);
break;
case VIRTIO_PCI_QUEUE_PFN:
@@ -158,7 +158,7 @@ static bool virtio_pci__common_read(struct virtio_device *vdev,
case VIRTIO_PCI_COMMON_DF:
if (vpci->device_features_sel > 1)
break;
- features |= vdev->ops->get_host_features(vpci->kvm, vpci->dev);
+ features |= virtio_dev_get_host_features(vdev, vpci->kvm, vpci->dev);
val = features >> (32 * vpci->device_features_sel);
ioport__write32(data, val);
break;