All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	boris.ostrovsky@oracle.com, Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3.1 01/15] xen/x86: remove XENFEAT_hvm_pirqs for PVHv2 guests
Date: Thu, 3 Nov 2016 10:22:37 -0400	[thread overview]
Message-ID: <20161103142236.GG28691@localhost.localdomain> (raw)
In-Reply-To: <20161103123537.sywzd5xuzpdugebw@mac>

On Thu, Nov 03, 2016 at 01:35:37PM +0100, Roger Pau Monne wrote:
> On Mon, Oct 31, 2016 at 10:32:47AM -0600, Jan Beulich wrote:
> > >>> On 29.10.16 at 10:59, <roger.pau@citrix.com> wrote:
> > > PVHv2 guests, unlike HVM guests, won't have the option to route interrupts
> > > from physical or emulated devices over event channels using PIRQs. This
> > > applies to both DomU and Dom0 PVHv2 guests.
> > > 
> > > Introduce a new XEN_X86_EMU_USE_PIRQ to notify Xen whether a HVM guest can
> > > route physical interrupts (even from emulated devices) over event channels,
> > > and is thus allowed to use some of the PHYSDEV ops.
> > > 
> > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > 
> > The patch looks fine now for its purpose, but I'm hesitant to ack it
> > without us having settled on whether we indeed mean to hide all
> > those physdev ops from Dom0. In particular I don't recall this (and
> > the reasoning behind it) having got written down somewhere.
> 
> I'm planning to add the following doc update together with this commit:
> 
> diff --git a/docs/misc/hvmlite.markdown b/docs/misc/hvmlite.markdown
> index 946908e..4fc757f 100644
> --- a/docs/misc/hvmlite.markdown
> +++ b/docs/misc/hvmlite.markdown
> @@ -75,3 +75,38 @@ info structure that's passed at boot time (field rsdp_paddr).
>  
>  Description of paravirtualized devices will come from XenStore, just as it's
>  done for HVM guests.
> +
> +## Interrupts ##
> +
> +### Interrupts from physical devices ###
> +
> +Interrupts from physical devices are delivered using native methods, this is
> +done in order to take advantage of new hardware assisted virtualization
> +functions, like posted interrupts. This implies that PVHv2 guests with physical
> +devices will also have the necessary interrupt controllers in order to manage
> +the delivery of interrupts from those devices, using the same interfaces that
> +are available on native hardware.
> +
> +### Interrupts from paravirtualized devices ###
> +
> +Interrupts from paravirtualized devices are delivered using event channels, see
> +[Event Channel Internals][event_channels] for more detailed information about

Is this a must? This mechanism was designed before vAPIC was present -
and has the inherent disadvantage that:

 1) It can't use vAPIC (it actually has to disable this as it needs to
    turn on VMX interrupt window to do this).

 2) It is hackish. It completly bypasses the APIC and it uses the
    VM_ENTRY_INTR_INFO (suppose to be used for traps).

 3) It is also racy for events that are more than 64 values apart (with
    the old 2 level one). That is you can have this callback vector
    being injected couple of times - as the OS interrupt handler does not
    mask the events.

 4) It causes the guest an VMEXIT (to stop it so that we can tweak
    the VM_ENTRY_INTR_INFO).

If we really want to use it, could we instead use the per-vector
that Paul added? HVMOP_set_evtchn_upcall_vector?

Or perhaps just add events -> MSI-X mechanism and then we can also
do this under normal HVM guests?

Either option would require changes in Linux/FreeBSD to deal with this.
> +event channels. In order to inject interrupts into the guest an IDT vector is
> +used. This is the same mechanism used on PVHVM guests, and allows having
> +per-cpu interrupts that can be also used to deliver timers or IPIs if desired.
> +
> +In order to register the callback IDT vector the `HVMOP_set_param` hypercall
> +is used with the following values:
> +
> +    domid = DOMID_SELF
> +    index = HVM_PARAM_CALLBACK_IRQ
> +    value = (0x2 << 56) | vector_value
> +
> +The OS has to program the IDT for the `vector_value` using the baremetal
> +mechanism.
> +
> +In order to know which event channel has fired, we need to look into the
> +information provided in the `shared_info` structure. The `evtchn_pending`
> +array is used as a bitmap in order to find out which event channel has
> +fired. Event channels can also be masked by setting it's port value in the
> +`shared_info->evtchn_mask` bitmap.

.. Well that is for the 2-level, but the FIFO is a bit different.
> 

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

  parent reply	other threads:[~2016-11-03 14:22 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  8:59 [PATCH v3.1 00/15] Initial PVHv2 Dom0 support Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 01/15] xen/x86: remove XENFEAT_hvm_pirqs for PVHv2 guests Roger Pau Monne
2016-10-31 16:32   ` Jan Beulich
2016-11-03 12:35     ` Roger Pau Monne
2016-11-03 12:52       ` Jan Beulich
2016-11-03 14:25         ` Konrad Rzeszutek Wilk
2016-11-03 15:05         ` Roger Pau Monne
2016-11-03 14:22       ` Konrad Rzeszutek Wilk [this message]
2016-11-03 15:01         ` Roger Pau Monne
2016-11-03 15:43         ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 02/15] xen/x86: fix return value of *_set_allocation functions Roger Pau Monne
2016-10-29 22:11   ` Tim Deegan
2016-10-29  8:59 ` [PATCH v3.1 03/15] xen/x86: allow calling {sh/hap}_set_allocation with the idle domain Roger Pau Monne
2016-10-31 16:34   ` Jan Beulich
2016-11-01 10:45     ` Tim Deegan
2016-11-02 17:14       ` Roger Pau Monne
2016-11-03 10:20         ` Roger Pau Monne
2016-11-03 10:33           ` Tim Deegan
2016-11-03 11:31           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 04/15] xen/x86: assert that local_events_need_delivery is not called by " Roger Pau Monne
2016-10-31 16:37   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 05/15] x86/paging: introduce paging_set_allocation Roger Pau Monne
2016-10-31 16:42   ` Jan Beulich
2016-11-01 10:29     ` Tim Deegan
2016-10-29  8:59 ` [PATCH v3.1 06/15] xen/x86: split the setup of Dom0 permissions to a function Roger Pau Monne
2016-10-31 16:44   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 07/15] xen/x86: do the PCI scan unconditionally Roger Pau Monne
2016-10-31 16:47   ` Jan Beulich
2016-11-03 10:58     ` Roger Pau Monne
2016-11-03 11:35       ` Jan Beulich
2016-11-03 11:54         ` Boris Ostrovsky
2016-11-29 12:33           ` Roger Pau Monne
2016-11-29 12:47             ` Jan Beulich
2016-11-29 12:57               ` Roger Pau Monne
2016-11-30  5:53                 ` Tian, Kevin
2016-11-30  9:02                   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 08/15] x86/vtd: fix mapping of RMRR regions Roger Pau Monne
2016-11-04  9:16   ` Jan Beulich
2016-11-04  9:45     ` Roger Pau Monne
2016-11-04 10:34       ` Jan Beulich
2016-11-04 12:25         ` Roger Pau Monne
2016-11-04 12:53           ` Jan Beulich
2016-11-04 13:03             ` Roger Pau Monne
2016-11-04 13:16               ` Jan Beulich
2016-11-04 15:33                 ` Roger Pau Monne
2016-11-04 16:13                   ` Jan Beulich
2016-11-04 16:19                     ` Roger Pau Monne
2016-11-04 17:08                       ` Jan Beulich
2016-11-04 17:25                         ` Roger Pau Monne
2016-11-07  8:36                           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 09/15] xen/x86: allow the emulated APICs to be enabled for the hardware domain Roger Pau Monne
2016-11-04  9:19   ` Jan Beulich
2016-11-04  9:47     ` Roger Pau Monne
2016-11-04 10:21       ` Jan Beulich
2016-11-04 12:09         ` Roger Pau Monne
2016-11-04 12:50           ` Jan Beulich
2016-11-04 13:06             ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 10/15] xen/x86: split Dom0 build into PV and PVHv2 Roger Pau Monne
2016-11-11 16:53   ` Jan Beulich
2016-11-16 18:02     ` Roger Pau Monne
2016-11-17 10:49       ` Jan Beulich
2016-11-28 17:49         ` Roger Pau Monne
2016-11-29  9:34           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 11/15] xen/mm: introduce a function to map large chunks of MMIO Roger Pau Monne
2016-11-11 16:58   ` Jan Beulich
2016-11-29 12:41     ` Roger Pau Monne
2016-11-29 13:00       ` Jan Beulich
2016-11-29 15:32         ` Roger Pau Monne
2016-11-11 20:17   ` Konrad Rzeszutek Wilk
2016-10-29  8:59 ` [PATCH v3.1 12/15] xen/x86: populate PVHv2 Dom0 physical memory map Roger Pau Monne
2016-11-11 17:16   ` Jan Beulich
2016-11-28 11:26     ` Roger Pau Monne
2016-11-28 11:41       ` Jan Beulich
2016-11-28 13:30         ` Roger Pau Monne
2016-11-28 13:49           ` Jan Beulich
2016-11-28 16:02             ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 13/15] xen/x86: parse Dom0 kernel for PVHv2 Roger Pau Monne
2016-11-11 20:30   ` Konrad Rzeszutek Wilk
2016-11-28 12:14     ` Roger Pau Monne
2016-10-29  9:00 ` [PATCH v3.1 14/15] xen/x86: hack to setup PVHv2 Dom0 CPUs Roger Pau Monne
2016-10-29  9:00 ` [PATCH v3.1 15/15] xen/x86: setup PVHv2 Dom0 ACPI tables Roger Pau Monne
2016-11-14 16:15   ` Jan Beulich
2016-11-30 12:40     ` Roger Pau Monne
2016-11-30 14:09       ` Jan Beulich
2016-11-30 14:23         ` Roger Pau Monne
2016-11-30 16:38           ` Jan Beulich
2016-10-31 14:35 ` [PATCH v3.1 00/15] Initial PVHv2 Dom0 support Boris Ostrovsky
2016-10-31 14:43   ` Andrew Cooper
2016-10-31 16:35     ` Roger Pau Monne

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=20161103142236.GG28691@localhost.localdomain \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.