xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: backport requests for 4.x-testing
Date: Fri, 30 Mar 2012 09:23:10 +0100	[thread overview]
Message-ID: <CB9B2BFE.3D112%keir@xen.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1203291802320.15151@kaball-desktop>

On 29/03/2012 18:06, "Stefano Stabellini" <Stefano.Stabellini@eu.citrix.com>
wrote:

> On Thu, 29 Mar 2012, Jan Beulich wrote:
>>>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 03/29/12 1:54 PM >>>
>>> What about:
>>> 
>>> xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2
>>> 
>>> backport appended.
>>> 
>>> ---
>>> 
>>> linux/xen: support pirq_eoi_map
>> 
>> As the title says, this is a Linux patch that you provided, yet talk is about
>> Xen backports here.
> 
> Oops, I have appended the wrong patch. Now I am appending the right one.
> 
> Please note that the patch bumps __XEN_LATEST_INTERFACE_VERSION__ but it
> is not a requirement to get Linux kernels to work correctly with it.
> I would welcome opinions on whether we would need to backport that
> change too or not.

Let's not. Please re-spin the patch to unconditionally define
PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1, and don't touch
__XEN_LATEST_INTERFACE_VERSION__.

 Thanks,
 Keir

> 
> ---
> 
> xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2
> 
> PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
> In order to improve the interface this patch:
> 
> - renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;
> 
> - introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
>   PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
>   another hypercall;
> 
> - bump __XEN_LATEST_INTERFACE_VERSION__;
> 
> - #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1 or
>   PHYSDEVOP_pirq_eoi_gmfn_v2 depending on the __XEN_INTERFACE_VERSION.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ---
>  xen/arch/ia64/xen/domain.c      |    1 +
>  xen/arch/ia64/xen/hypercall.c   |    7 +++++--
>  xen/arch/x86/domain.c           |    1 +
>  xen/arch/x86/physdev.c          |    7 +++++--
>  xen/include/asm-ia64/domain.h   |    3 +++
>  xen/include/asm-x86/domain.h    |    3 +++
>  xen/include/public/physdev.h    |   16 +++++++++++++++-
>  xen/include/public/xen-compat.h |    2 +-
>  8 files changed, 34 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c
> index 271a744..7dd96bf 100644
> --- a/xen/arch/ia64/xen/domain.c
> +++ b/xen/arch/ia64/xen/domain.c
> @@ -1729,6 +1729,7 @@ int domain_relinquish_resources(struct domain *d)
> if (d->arch.pirq_eoi_map != NULL) {
> put_page(virt_to_page(d->arch.pirq_eoi_map));
> d->arch.pirq_eoi_map = NULL;
> +   d->arch.auto_unmask = 0;
> }
>  
> /* Tear down shadow mode stuff. */
> diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c
> index 6ea15c2..22b06ec 100644
> --- a/xen/arch/ia64/xen/hypercall.c
> +++ b/xen/arch/ia64/xen/hypercall.c
> @@ -65,7 +65,7 @@ static long __do_pirq_guest_eoi(struct domain *d, int pirq)
>  {
> if ( pirq < 0 || pirq >= NR_IRQS )
> return -EINVAL;
> - if ( d->arch.pirq_eoi_map )
> + if ( d->arch.auto_unmask ) {
> evtchn_unmask(d->pirq_to_evtchn[pirq]);
> return pirq_guest_eoi(d, pirq);
>  }
> @@ -504,7 +504,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>          break;
>      }
>  
> -    case PHYSDEVOP_pirq_eoi_gmfn: {
> +    case PHYSDEVOP_pirq_eoi_gmfn_v1:
> +    case PHYSDEVOP_pirq_eoi_gmfn_v2: {
>          struct physdev_pirq_eoi_gmfn info;
>          unsigned long mfn;
>  
> @@ -527,6 +528,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>          }
>  
>          current->domain->arch.pirq_eoi_map = mfn_to_virt(mfn);
> +        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
> +            current->domain->arch.auto_unmask = 1;
>          ret = 0;
>          break;
>      }
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index d432eb8..8472e30 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1935,6 +1935,7 @@ int domain_relinquish_resources(struct domain *d)
>              unmap_domain_page_global(d->arch.pirq_eoi_map);
>              put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn));
>              d->arch.pirq_eoi_map = NULL;
> +            d->arch.auto_unmask = 0;
>          }
>  
>          d->arch.relmem = RELMEM_xen;
> diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
> index 3454c03..53c2461 100644
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -264,7 +264,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>          ret = -EINVAL;
>          if ( eoi.irq >= v->domain->nr_pirqs )
>              break;
> -        if ( v->domain->arch.pirq_eoi_map )
> +        if ( v->domain->arch.auto_unmask )
>              evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
>          if ( !is_hvm_domain(v->domain) ||
>               domain_pirq_to_emuirq(v->domain, eoi.irq) == IRQ_PT )
> @@ -274,7 +274,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>          break;
>      }
>  
> -    case PHYSDEVOP_pirq_eoi_gmfn: {
> +    case PHYSDEVOP_pirq_eoi_gmfn_v2:
> +    case PHYSDEVOP_pirq_eoi_gmfn_v1: {
>          struct physdev_pirq_eoi_gmfn info;
>          unsigned long mfn;
>  
> @@ -304,6 +305,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>              ret = -ENOSPC;
>              break;
>          }
> +        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
> +            v->domain->arch.auto_unmask = 1;
>  
>          ret = 0;
>          break;
> diff --git a/xen/include/asm-ia64/domain.h b/xen/include/asm-ia64/domain.h
> index 14064ce..fc7b34f 100644
> --- a/xen/include/asm-ia64/domain.h
> +++ b/xen/include/asm-ia64/domain.h
> @@ -182,6 +182,9 @@ struct arch_domain {
>      /* Shared page for notifying that explicit PIRQ EOI is required. */
>      unsigned long *pirq_eoi_map;
>      unsigned long pirq_eoi_map_mfn;
> +    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
> +     * unmask the event channel */
> +    bool_t auto_unmask;
>  
>      /* Address of efi_runtime_services_t (placed in domain memory)  */
>      void *efi_runtime;
> diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
> index 8056559..75f2540 100644
> --- a/xen/include/asm-x86/domain.h
> +++ b/xen/include/asm-x86/domain.h
> @@ -268,6 +268,9 @@ struct arch_domain
>      /* Shared page for notifying that explicit PIRQ EOI is required. */
>      unsigned long *pirq_eoi_map;
>      unsigned long pirq_eoi_map_mfn;
> +    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
> +     * unmask the event channel */
> +    bool_t auto_unmask;
>  
>      /* Pseudophysical e820 map (XENMEM_memory_map).  */
>      struct e820entry e820[3];
> diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
> index 82602ca..2e0ee53 100644
> --- a/xen/include/public/physdev.h
> +++ b/xen/include/public/physdev.h
> @@ -49,7 +49,15 @@ DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
>   * will automatically get unmasked. The page registered is used as a bit
>   * array indexed by Xen's PIRQ value.
>   */
> -#define PHYSDEVOP_pirq_eoi_gmfn         17
> +#define PHYSDEVOP_pirq_eoi_gmfn_v1       17
> +/*
> + * Register a shared page for the hypervisor to indicate whether the
> + * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to
> + * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of
> + * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by
> + * Xen's PIRQ value.
> + */
> +#define PHYSDEVOP_pirq_eoi_gmfn_v2       28
>  struct physdev_pirq_eoi_gmfn {
>      /* IN */
>      xen_pfn_t gmfn;
> @@ -276,6 +284,12 @@ DEFINE_XEN_GUEST_HANDLE(physdev_get_free_pirq_t);
>  #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
>  #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
>  
> +#if __XEN_INTERFACE_VERSION < 0x00040200
> +#define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
> +#else
> +#define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v2
> +#endif
> +
>  #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
>  
>  /*
> diff --git a/xen/include/public/xen-compat.h b/xen/include/public/xen-compat.h
> index 2e38003..d8c55bf 100644
> --- a/xen/include/public/xen-compat.h
> +++ b/xen/include/public/xen-compat.h
> @@ -27,7 +27,7 @@
>  #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
>  #define __XEN_PUBLIC_XEN_COMPAT_H__
>  
> -#define __XEN_LATEST_INTERFACE_VERSION__ 0x0003020a
> +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040200
>  
>  #if defined(__XEN__) || defined(__XEN_TOOLS__)
>  /* Xen is built with matching headers and implements the latest interface. */

  reply	other threads:[~2012-03-30  8:23 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 10:13 backport requests for 4.x-testing Jan Beulich
2012-03-06 10:38 ` Keir Fraser
2012-03-06 11:04 ` Andrew Cooper
2012-03-07  7:25   ` Roderick Colenbrander
2012-03-07  9:43     ` Keir Fraser
2012-03-13 16:50     ` Ian Jackson
2012-03-13 17:25       ` Teck Choon Giam
2012-03-13 17:52         ` Teck Choon Giam
2012-03-13 18:23           ` Teck Choon Giam
2012-03-14 10:03             ` Ian Jackson
2012-03-14  9:58           ` Ian Jackson
2012-03-14 11:37         ` Ian Jackson
2012-03-14 23:08           ` Teck Choon Giam
2012-03-19 14:22             ` Teck Choon Giam
2012-04-03 15:04               ` Ian Jackson
2012-03-07  9:43   ` Keir Fraser
2012-03-07 10:44     ` Andrew Cooper
2012-03-07 10:59       ` Keir Fraser
2012-03-07 11:06         ` Jan Beulich
2012-03-07 11:08           ` Andrew Cooper
2012-03-07 19:38       ` Ian Campbell
2012-03-08 10:38         ` Andrew Cooper
2012-03-08 10:42           ` Keir Fraser
2012-03-13 16:52     ` Ian Jackson
2012-03-24 17:27   ` Konrad Rzeszutek Wilk
2012-03-29  9:22     ` Keir Fraser
2012-03-29 11:32       ` Teck Choon Giam
2012-03-29 11:42         ` Teck Choon Giam
2012-03-29 15:11         ` Konrad Rzeszutek Wilk
2012-03-29 15:26           ` Teck Choon Giam
2012-03-29 15:56             ` Konrad Rzeszutek Wilk
2012-03-29 16:20               ` Teck Choon Giam
2012-03-29 16:23                 ` Konrad Rzeszutek Wilk
2012-03-29 16:39                   ` Teck Choon Giam
2012-03-29 11:55     ` Stefano Stabellini
2012-03-29 15:31       ` Jan Beulich
2012-03-29 17:06         ` Stefano Stabellini
2012-03-30  8:23           ` Keir Fraser [this message]
2012-03-30  9:59             ` Stefano Stabellini
2012-04-03 15:08     ` Ian Jackson
2012-04-03 15:15       ` Teck Choon Giam
2012-04-03 16:58         ` Ian Jackson
2012-04-03 19:50           ` Teck Choon Giam
2012-04-03 20:02             ` Teck Choon Giam
2012-04-04 10:22               ` Ian Jackson
2012-04-04 12:54                 ` Teck Choon Giam
2012-04-04 15:09                   ` Ian Jackson
2012-03-07  9:18 ` Keir Fraser
2012-03-07 10:10   ` Jan Beulich
2012-03-08 10:00   ` Jan Beulich
2012-03-08 10:05     ` Keir Fraser
2012-03-08 10:45   ` Jan Beulich
2012-03-08 11:00     ` Keir Fraser

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=CB9B2BFE.3D112%keir@xen.org \
    --to=keir@xen.org \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).