From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn6-0003W4-SZ for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYn4-0003VW-6i for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:49:08 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:52500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn3-0003Up-TR for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:49:06 -0400 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Oct 2015 09:49:03 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id E416317D8062 for ; Mon, 12 Oct 2015 09:48:59 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9C8mtfp35848272 for ; Mon, 12 Oct 2015 08:48:55 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9C8mrBR026633 for ; Mon, 12 Oct 2015 02:48:55 -0600 Date: Mon, 12 Oct 2015 10:48:48 +0200 From: Cornelia Huck Message-ID: <20151012104848.396407b9.cornelia.huck@de.ibm.com> In-Reply-To: <561B6741.8080309@de.ibm.com> References: <1444397988-20167-1-git-send-email-den@openvz.org> <1444397988-20167-2-git-send-email-den@openvz.org> <5617D259.8070101@redhat.com> <561B6741.8080309@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] kvm/x86: Hyper-V synthetic interrupt controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Gleb Natapov , qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, Jens Freimann , rkagan@virtuozzo.com, "Denis V. Lunev" , Andrey Smetanin , Paolo Bonzini , Vitaly Kuznetsov , "K. Y. Srinivasan" On Mon, 12 Oct 2015 09:54:41 +0200 Christian Borntraeger wrote: > Am 09.10.2015 um 16:42 schrieb Paolo Bonzini: > > Christian, the question for you is towards the end... > > > > [....] > > > >> --- a/virt/kvm/irqchip.c > >> +++ b/virt/kvm/irqchip.c > >> @@ -144,11 +144,13 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt, > >> > >> /* > >> * Do not allow GSI to be mapped to the same irqchip more than once. > >> - * Allow only one to one mapping between GSI and MSI. > >> + * Allow only one to one mapping between GSI and MSI/Hyper-V SINT. > >> */ > >> hlist_for_each_entry(ei, &rt->map[ue->gsi], link) > >> if (ei->type == KVM_IRQ_ROUTING_MSI || > >> ue->type == KVM_IRQ_ROUTING_MSI || > >> + ei->type == KVM_IRQ_ROUTING_HV_SINT || > >> + ue->type == KVM_IRQ_ROUTING_HV_SINT || > >> ue->u.irqchip.irqchip == ei->irqchip.irqchip) > >> return r; > > > > Christian, what's the desired behavior for s390 adapter interrupts here? > > Should this actually become > > > > if (ei->type != KVM_IRQ_ROUTING_IRQCHIP || > > ue->type != KVM_IRQ_ROUTING_IRQCHIP || > > ue->u.irqchip.irqchip == ei->irqchip.irqchip) > > Hmm, this is the failure path if we already have one routing entry, Right? > This will work with virtio ccw as we only setup one route, but I am not > sure about the upcoming PCI irqfd support which might add a 2nd adapter > route. > > Adding Conny, Jens,Not sure about PC, > As soon as we wire up the PCI irgfd, we want to register a 2nd route for > the same irqchip via flic, which will also be of type > KVM_IRQ_ROUTING_S390_ADAPTER. Correct? It's a bit different. The kernel basically does not see msi routes for s390 pci at all, as qemu already transforms the msi route into an adapter route before registering it (see kvm_arch_fixup_msi_route() in qemu's target-s390x/kvm.c). So, in the end, all s390 kernels end up using adapter routes, and none of them are duplicate (just one irqchip). Going back to Paolo's original question, I think changing the check to !KVM_IRQ_ROUTING_IRQCHIP makes sense, if I understand the code correctly. They seem to be the only special one. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 1/2] kvm/x86: Hyper-V synthetic interrupt controller Date: Mon, 12 Oct 2015 10:48:48 +0200 Message-ID: <20151012104848.396407b9.cornelia.huck@de.ibm.com> References: <1444397988-20167-1-git-send-email-den@openvz.org> <1444397988-20167-2-git-send-email-den@openvz.org> <5617D259.8070101@redhat.com> <561B6741.8080309@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <561B6741.8080309@de.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Christian Borntraeger Cc: Gleb Natapov , qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, rkagan@virtuozzo.com, "Denis V. Lunev" , Andrey Smetanin , Paolo Bonzini , Vitaly Kuznetsov List-Id: virtualization@lists.linuxfoundation.org On Mon, 12 Oct 2015 09:54:41 +0200 Christian Borntraeger wrote: > Am 09.10.2015 um 16:42 schrieb Paolo Bonzini: > > Christian, the question for you is towards the end... > > > > [....] > > > >> --- a/virt/kvm/irqchip.c > >> +++ b/virt/kvm/irqchip.c > >> @@ -144,11 +144,13 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt, > >> > >> /* > >> * Do not allow GSI to be mapped to the same irqchip more than once. > >> - * Allow only one to one mapping between GSI and MSI. > >> + * Allow only one to one mapping between GSI and MSI/Hyper-V SINT. > >> */ > >> hlist_for_each_entry(ei, &rt->map[ue->gsi], link) > >> if (ei->type == KVM_IRQ_ROUTING_MSI || > >> ue->type == KVM_IRQ_ROUTING_MSI || > >> + ei->type == KVM_IRQ_ROUTING_HV_SINT || > >> + ue->type == KVM_IRQ_ROUTING_HV_SINT || > >> ue->u.irqchip.irqchip == ei->irqchip.irqchip) > >> return r; > > > > Christian, what's the desired behavior for s390 adapter interrupts here? > > Should this actually become > > > > if (ei->type != KVM_IRQ_ROUTING_IRQCHIP || > > ue->type != KVM_IRQ_ROUTING_IRQCHIP || > > ue->u.irqchip.irqchip == ei->irqchip.irqchip) > > Hmm, this is the failure path if we already have one routing entry, Right? > This will work with virtio ccw as we only setup one route, but I am not > sure about the upcoming PCI irqfd support which might add a 2nd adapter > route. > > Adding Conny, Jens,Not sure about PC, > As soon as we wire up the PCI irgfd, we want to register a 2nd route for > the same irqchip via flic, which will also be of type > KVM_IRQ_ROUTING_S390_ADAPTER. Correct? It's a bit different. The kernel basically does not see msi routes for s390 pci at all, as qemu already transforms the msi route into an adapter route before registering it (see kvm_arch_fixup_msi_route() in qemu's target-s390x/kvm.c). So, in the end, all s390 kernels end up using adapter routes, and none of them are duplicate (just one irqchip). Going back to Paolo's original question, I think changing the check to !KVM_IRQ_ROUTING_IRQCHIP makes sense, if I understand the code correctly. They seem to be the only special one.