Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755149AbbHYHgd (ORCPT ); Tue, 25 Aug 2015 03:36:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40816 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbbHYHgc (ORCPT ); Tue, 25 Aug 2015 03:36:32 -0400 Message-ID: <55DC1AFA.7090100@redhat.com> Date: Tue, 25 Aug 2015 15:36:26 +0800 From: Jason Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Cornelia Huck CC: gleb@kernel.org, pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" Subject: Re: [PATCH 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses References: <1440144233-29748-1-git-send-email-jasowang@redhat.com> <1440144233-29748-2-git-send-email-jasowang@redhat.com> <20150821112946.64ae6f7b.cornelia.huck@de.ibm.com> <55DA8F99.106@redhat.com> <20150824160520.583c3a74.cornelia.huck@de.ibm.com> <55DBDB48.6060502@redhat.com> In-Reply-To: <55DBDB48.6060502@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1472 Lines: 34 On 08/25/2015 11:04 AM, Jason Wang wrote: [...] >>>>> @@ -900,10 +899,11 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) >>>>> >>>> if (!p->wildcard && p->datamatch != args->datamatch) >>>>> >>>> continue; >>>>> >>>> >>>>> >>>> - kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev); >>>>> >>>> if (!p->length) { >>>>> >>>> kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS, >>>>> >>>> &p->dev); >>>>> >>>> + } else { >>>>> >>>> + kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev); >>>>> >>>> } >>>> >>> Similar comments here... do you want to check for bus_idx == >>>> >>> KVM_MMIO_BUS as well? >>> >> Good catch. I think keep the original code as is will be also ok to >>> >> solve this. (with changing the bus_idx to KVM_FAST_MMIO_BUS during >>> >> registering if it was an wildcard mmio). >> > Do you need to handle the ioeventfd_count changes on the fast mmio bus >> > as well? > Yes. So actually, it needs some changes: checking the return value of > kvm_io_bus_unregister_dev() and decide which bus does the device belongs to. > Looks like it will be more cleaner by just changing ioeventfd_bus_from_flags() to return KVM_FAST_MMIO_BUS accordingly. Will post V2 soon. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/