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

From: Jason Wang
Date: Tue Aug 25 2015 - 05:06:45 EST




On 08/25/2015 04:20 PM, Cornelia Huck wrote:
> 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>
>

Thanks for the review. V3 posted :)
--
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/