All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "Nakajima, Jun" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>,
	"keir.xen@gmail.com" <keir.xen@gmail.com>,
	Jan Beulich <JBeulich@suse.com>,
	"Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xenhackthon] Virtualized APIC registers - virtual interrupt delivery.
Date: Mon, 3 Jun 2013 08:59:49 -0400	[thread overview]
Message-ID: <20130603125949.GH6893@phenom.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305291100150.4799@kaball.uk.xensource.com>

> > >>>>> OK, in which case Linux ~v2.6.32 (when the event callback mechanism was
> > >>>>> introduced for HVM guests) will _not_ take advantage of this, right?
> > >>>> Yes, event mechanism cannot benefit from it.
> > >>> 
> > >>> I think that Konrad was referring to the vector callback mechanism:
> > >> You are right. What I want to say is vector callback mechanism.
> > >> 
> > >>> 
> > >>> linux side  drivers/xen/events.c:xen_callback_vector
> > >>> xen side    xen/arch/x86/hvm/irq.c:hvm_set_callback_via
> > >>> 
> > >>> Also see:
> > >>> 
> > >>> commit e5fd1f6505c43440bc2450253c79c80174b693bc
> > >>> Author: Keir Fraser <keir.fraser@citrix.com>
> > >>> Date:   Tue May 25 11:28:58 2010 +0100
> > >>> 
> > >>>     x86 hvm: implement vector callback for evtchn delivery
> > >>>     
> > >>>     Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> > >>>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > >>>     Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
> > >>> From the guest point of view it looks like a normal vector callback
> > >>> (similar to an IPI).
> > >>> 
> > >>> 
> > >>>>> Is there a way to solve this so that they _will_ take advantage of this.
> > >>>> Perhaps not. virtual interrupt delivery relies on EOI logic to inject the
> > > pending
> > >>> interrupt. But event channel doesn't have such mechanism.
> > >>> 
> > >>> It's true that we don't do any EOIs with the vector callback mechanism,
> > >>> the same way the operating system doesn't do any EOIs when it receives
> > >>> an IPI.
> > >> IPI also need EOI.
> > > 
> > > Ooops, you are right.
> > > 
> > > Does guest EOI still cause a trap into Xen?
> > It depends on the bit in EOI exit bitmap. If it is set, then EOI still will cause vmexit(EOI-induced vmexit). Otherwise, no vmexit happened.
> > 
> > The following pseudocode details the behavior of EOI virtualization:
> > Vector ← SVI;
> > VISR[Vector] ← 0;
> > IF any bits set in VISR
> > THEN SVI ← highest index of bit set in VISR
> > ELSE SVI ← 0;
> > FI;
> > perform PPR virtualiation
> > IF EOI_exit_bitmap[Vector] = 1 
> > THEN cause EOI-induced VM exit with Vector as exit qualification;
> > ELSE evaluate pending virtual interrupts; 
> > FI;
> 
> Thanks for the explanation.
> 
> At this point I wonder: would vector callbacks, that doesn't do any
> guest EOIs, create any problems to this new virtual interrupt delivery
> mechanism?
> If the guest does not do any EOIs after receiving a vector callback,
> then other pending interrupts are never evaluated (the last ELSE
> condition in your pseudocode cannot happen), is that correct?
> 
> In any case we could consider introducing an ack_APIC_irq() call at the
> beginning of xen_evtchn_do_upcall, so that the vector callback mechanism
> can take advantage of posted interrupts too.

Or just split the mechanism. Meaning use the event callback for "legacy"
type events, and for PCI passthrough devices (where the host supports
posted interrupts) just use the baremetal implementation.

That would entail some form of hypercall to identify whether a PCIe device
is "posted-interrupt" candidate and if so don't use the event channel
mechanism for it.

> Of course we would do that only if posted interrupts are available.

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-06-03 12:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 16:21 [Xenhackthon] Virtualized APIC registers - virtual interrupt delivery Konrad Rzeszutek Wilk
2013-05-23  7:49 ` Jan Beulich
2013-05-23  8:25   ` Zhang, Yang Z
2013-05-24 14:31     ` Konrad Rzeszutek Wilk
2013-05-27  4:56       ` Zhang, Yang Z
2013-05-27 10:43         ` Stefano Stabellini
2013-05-28 10:51           ` Zhang, Yang Z
2013-05-28 13:22             ` Konrad Rzeszutek Wilk
2013-05-28 16:10             ` Stefano Stabellini
2013-05-29  0:40               ` Zhang, Yang Z
2013-05-29 10:07                 ` Stefano Stabellini
2013-06-03 12:59                   ` Konrad Rzeszutek Wilk [this message]
2013-06-03 15:22                     ` Stefano Stabellini
2013-06-05  0:37                       ` Zhang, Yang Z
2013-06-05 12:51                         ` Stefano Stabellini
2013-06-06  3:08                           ` Zhang, Yang Z
2013-06-06 13:02                             ` Konrad Rzeszutek Wilk
2013-07-15 14:54                             ` Konrad Rzeszutek Wilk
2013-07-16  2:12                               ` Zhang, Yang Z
2013-05-24 14:30   ` Konrad Rzeszutek Wilk

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=20130603125949.GH6893@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir.xen@gmail.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xiantao.zhang@intel.com \
    --cc=yang.z.zhang@intel.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.