Re: [PATCH V2 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses

From: Cornelia Huck
Date: Tue Aug 25 2015 - 04:25:06 EST


On Tue, 25 Aug 2015 15:47:14 +0800
Jason Wang <jasowang@xxxxxxxxxx> wrote:

> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 9ff4193..95f2901 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -762,13 +762,15 @@ ioeventfd_check_collision(struct kvm *kvm, struct _ioeventfd *p)
> return false;
> }
>
> -static enum kvm_bus ioeventfd_bus_from_flags(__u32 flags)
> +static enum kvm_bus ioeventfd_bus_from_flags(struct kvm_ioeventfd *args)

ioeventfd_bus_from_args()? But _from_flags() is not wrong either :)

> {
> - if (flags & KVM_IOEVENTFD_FLAG_PIO)
> + if (args->flags & KVM_IOEVENTFD_FLAG_PIO)
> return KVM_PIO_BUS;
> - if (flags & KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY)
> + if (args->flags & KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY)
> return KVM_VIRTIO_CCW_NOTIFY_BUS;
> - return KVM_MMIO_BUS;
> + if (args->len)
> + return KVM_MMIO_BUS;
> + return KVM_FAST_MMIO_BUS;

Hm...

/* When length is ignored, MMIO is put on a separate bus, for
* faster lookups.
*/
return args->len ? KVM_MMIO_BUS : KVM_FAST_MMIO_BUS;

> }
>
> static int

This version of the patch looks nice and compact. Regardless whether
you want to follow my (minor) style suggestions, consider this patch

Acked-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/