From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQwNk-0000a5-S8 for qemu-devel@nongnu.org; Fri, 21 Mar 2014 06:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQwNb-00061r-V2 for qemu-devel@nongnu.org; Fri, 21 Mar 2014 06:08:56 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:53786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQwNb-00061l-M9 for qemu-devel@nongnu.org; Fri, 21 Mar 2014 06:08:47 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Mar 2014 10:08:46 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id C887F2190056 for ; Fri, 21 Mar 2014 10:08:38 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2LA8WP34063616 for ; Fri, 21 Mar 2014 10:08:32 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2LA8fVT006986 for ; Fri, 21 Mar 2014 04:08:43 -0600 Date: Fri, 21 Mar 2014 11:08:40 +0100 From: Cornelia Huck Message-ID: <20140321110840.1af6c078.cornelia.huck@de.ibm.com> In-Reply-To: <532C0713.7080208@de.ibm.com> References: <1395079899-29239-1-git-send-email-cornelia.huck@de.ibm.com> <1395079899-29239-5-git-send-email-cornelia.huck@de.ibm.com> <532C0713.7080208@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 4/5] KVM: s390: irq routing for adapter interrupts. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org, gleb@kernel.org, qemu-devel@nongnu.org, agraf@suse.de, pbonzini@redhat.com On Fri, 21 Mar 2014 10:32:03 +0100 Christian Borntraeger wrote: > On 17/03/14 19:11, Cornelia Huck wrote: > > Introduce a new interrupt class for s390 adapter interrupts and enable > > irqfds for s390. > > > > This is depending on a new s390 specific vm capability, KVM_CAP_S390_IRQCHIP, > > that needs to be enabled by userspace. > > > > Signed-off-by: Cornelia Huck > > --- > > Documentation/virtual/kvm/api.txt | 21 +++- > > Documentation/virtual/kvm/devices/s390_flic.txt | 6 +- > > arch/s390/include/asm/kvm_host.h | 10 ++ > > arch/s390/kvm/Kconfig | 2 + > > arch/s390/kvm/Makefile | 2 +- > > arch/s390/kvm/interrupt.c | 132 ++++++++++++++++++++++- > > arch/s390/kvm/irq.h | 22 ++++ > > arch/s390/kvm/kvm-s390.c | 17 +++ > > include/linux/kvm_host.h | 9 ++ > > include/uapi/linux/kvm.h | 11 ++ > > 10 files changed, 222 insertions(+), 10 deletions(-) > > create mode 100644 arch/s390/kvm/irq.h > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > > index 94b337e..8155bb4 100644 > > --- a/arch/s390/kvm/interrupt.c > > +++ b/arch/s390/kvm/interrupt.c > > @@ -13,6 +13,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -1118,8 +1119,13 @@ static int kvm_s390_adapter_map(struct kvm *kvm, unsigned int id, __u64 addr) > > goto out; > > } > > INIT_LIST_HEAD(&map->list); > > - map->addr = addr; > > - ret = get_user_pages_fast(addr, 1, 1, &map->page); > > + map->guest_addr = addr; > > + map->addr = gmap_translate(addr, kvm->arch.gmap); > > + if (map->addr == -EFAULT) { > > + ret = -EFAULT; > > + goto out; > > + } > > + ret = get_user_pages_fast(map->addr, 1, 1, &map->page); > > if (ret < 0) > > goto out; > > BUG_ON(ret != 1); > > @@ -1144,7 +1150,7 @@ static int kvm_s390_adapter_unmap(struct kvm *kvm, unsigned int id, __u64 addr) > > > > down_write(&adapter->maps_lock); > > list_for_each_entry_safe(map, tmp, &adapter->maps, list) { > > - if (map->addr == addr) { > > + if (map->guest_addr == addr) { > > found = 1; > > list_del(&map->list); > > put_page(map->page); > > > Can't these two hunks be merged into the previous patch? The guest_addr stuff should be in the previous patch, proably some rebasing fallout. Will fix. > > Otherwise: > Acked-by: Christian Borntraeger >