All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Gleb Natapov <gleb@kernel.org>,
	qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	rkagan@virtuozzo.com, "Denis V. Lunev" <den@openvz.org>,
	Andrey Smetanin <asmetanin@virtuozzo.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] kvm/x86: Hyper-V synthetic interrupt controller
Date: Mon, 12 Oct 2015 10:48:48 +0200	[thread overview]
Message-ID: <20151012104848.396407b9.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <561B6741.8080309@de.ibm.com>

On Mon, 12 Oct 2015 09:54:41 +0200
Christian Borntraeger <borntraeger@de.ibm.com> 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.

WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Gleb Natapov <gleb@kernel.org>,
	qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
	rkagan@virtuozzo.com, "Denis V. Lunev" <den@openvz.org>,
	Andrey Smetanin <asmetanin@virtuozzo.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH 1/2] kvm/x86: Hyper-V synthetic interrupt controller
Date: Mon, 12 Oct 2015 10:48:48 +0200	[thread overview]
Message-ID: <20151012104848.396407b9.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <561B6741.8080309@de.ibm.com>

On Mon, 12 Oct 2015 09:54:41 +0200
Christian Borntraeger <borntraeger@de.ibm.com> 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.

  reply	other threads:[~2015-10-12  8:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 13:39 [Qemu-devel] [PATCH 0/2] Hyper-V synthetic interrupt controller Denis V. Lunev
2015-10-09 13:39 ` Denis V. Lunev
2015-10-09 13:39 ` [Qemu-devel] [PATCH 1/2] kvm/x86: " Denis V. Lunev
2015-10-09 13:39   ` Denis V. Lunev
2015-10-09 14:42   ` [Qemu-devel] " Paolo Bonzini
2015-10-09 14:42     ` Paolo Bonzini
2015-10-09 15:53     ` [Qemu-devel] " Roman Kagan
2015-10-09 15:58       ` Paolo Bonzini
2015-10-09 15:58         ` Paolo Bonzini
2015-10-09 15:53     ` Roman Kagan
2015-10-12  7:54     ` [Qemu-devel] " Christian Borntraeger
2015-10-12  7:54       ` Christian Borntraeger
2015-10-12  8:48       ` Cornelia Huck [this message]
2015-10-12  8:48         ` Cornelia Huck
2015-10-12  8:58         ` [Qemu-devel] " Paolo Bonzini
2015-10-12  8:58           ` Paolo Bonzini
2015-10-12 11:05           ` Roman Kagan
2015-10-12 11:05           ` [Qemu-devel] " Roman Kagan
2015-10-09 13:39 ` [Qemu-devel] [PATCH 2/2] kvm/x86: Hyper-V kvm exit Denis V. Lunev
2015-10-09 13:39   ` Denis V. Lunev
2015-10-09 14:41   ` [Qemu-devel] " Paolo Bonzini
2015-10-09 14:41     ` Paolo Bonzini
2015-10-09 14:53     ` [Qemu-devel] " Roman Kagan
2015-10-09 14:57       ` Paolo Bonzini
2015-10-09 14:57         ` Paolo Bonzini
2015-10-09 14:53     ` Roman Kagan
2015-10-12 13:42   ` [Qemu-devel] " Eric Blake
2015-10-12 13:42     ` Eric Blake
2015-10-12 13:44     ` Eric Blake
2015-10-12 13:44       ` Eric Blake
2015-10-12 13:46     ` Paolo Bonzini
2015-10-12 13:46       ` Paolo Bonzini
2015-10-12 13:46     ` Denis V. Lunev
2015-10-12 13:46       ` Denis V. Lunev
2015-10-12 22:21       ` KY Srinivasan
2015-10-12 22:21         ` KY Srinivasan
2015-10-12 13:52     ` Roman Kagan
2015-10-12 13:52       ` Roman Kagan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151012104848.396407b9.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=asmetanin@virtuozzo.com \
    --cc=borntraeger@de.ibm.com \
    --cc=den@openvz.org \
    --cc=gleb@kernel.org \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kys@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.