kvm tools: add status notification hook to virtio-mmio

Patch e03b449cbddf (kvm tools: add status notification hook for
virtio) converted virtio-net to use a new notification mechanism,
but unfortunately left virtio-mmio behind.

The direct consequence is that both arm and arm64 guests are left
without any form of networking. Not good.

Bring virtio-mmio into this brave new notified world, and feel the
power of being able to ping again.

Acked-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Asias He <asias.hejun@gmail.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Marc Zyngier
2015-06-01 16:39:54 +01:00
committed by Will Deacon
parent bc0b99a2a7
commit e2b9812560
+6 -1
View File
@@ -144,16 +144,21 @@ static void virtio_mmio_config_out(u64 addr, void *data, u32 len,
struct virtio_device *vdev)
{
struct virtio_mmio *vmmio = vdev->virtio;
struct kvm *kvm = vmmio->kvm;
u32 val = 0;
switch (addr) {
case VIRTIO_MMIO_HOST_FEATURES_SEL:
case VIRTIO_MMIO_GUEST_FEATURES_SEL:
case VIRTIO_MMIO_QUEUE_SEL:
case VIRTIO_MMIO_STATUS:
val = ioport__read32(data);
*(u32 *)(((void *)&vmmio->hdr) + addr) = val;
break;
case VIRTIO_MMIO_STATUS:
vmmio->hdr.status = ioport__read32(data);
if (vdev->ops->notify_status)
vdev->ops->notify_status(kvm, vmmio->dev, vmmio->hdr.status);
break;
case VIRTIO_MMIO_GUEST_FEATURES:
if (vmmio->hdr.guest_features_sel == 0) {
val = ioport__read32(data);