xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 12/12] xen/events: use the FIFO-based ABI if available
Date: Wed, 20 Mar 2013 10:38:19 +0100	[thread overview]
Message-ID: <5149838B.7050707@citrix.com> (raw)
In-Reply-To: <1363727099-25519-13-git-send-email-david.vrabel@citrix.com>

On 19/03/13 22:04, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
> 
> If the hypervisor supports the FIFO-based ABI, enable it by
> initializing the control block for the boot VCPU and subsequent VCPUs
> as they a brought up.  The event array is expanded as required when
> event ports are setup.
> 
> This implementation has some known limitations:
> 
> - The number of event channels is not raised above 4096 as this
>   requires changing the way some internal structures were allocated.
> 
> - Migration will not work as the control blocks or event arrays are
>   not remapped by Xen at the destination.
> 
> - The timer VIRQ which previously was treated as the highest priority
>   event has the default priority.
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
>  drivers/xen/events/Kbuild            |    1 +
>  drivers/xen/events/events.c          |    7 +-
>  drivers/xen/events/events_internal.h |    2 +
>  drivers/xen/events/fifo.c            |  312 ++++++++++++++++++++++++++++++++++
>  4 files changed, 321 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/xen/events/fifo.c
> 
> diff --git a/drivers/xen/events/Kbuild b/drivers/xen/events/Kbuild
> index aea331e..74644d0 100644
> --- a/drivers/xen/events/Kbuild
> +++ b/drivers/xen/events/Kbuild
> @@ -1,2 +1,3 @@
>  obj-y += events.o
> +obj-y += fifo.o
>  obj-y += n-level.o
> diff --git a/drivers/xen/events/events.c b/drivers/xen/events/events.c
> index e6895b9..a7124f8 100644
> --- a/drivers/xen/events/events.c
> +++ b/drivers/xen/events/events.c
> @@ -1512,8 +1512,13 @@ void xen_callback_vector(void) {}
>  void __init xen_init_IRQ(void)
>  {
>         int i;
> +       int ret;
> 
> -       evtchn_ops = evtchn_ops_nlevel;
> +       ret = xen_evtchn_init_fifo_based();
> +       if (ret < 0) {
> +               printk(KERN_INFO "xen: falling back to n-level event channels");
> +               evtchn_ops = evtchn_ops_nlevel;
> +       }
> 
>         evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq),
>                                     GFP_KERNEL);
> diff --git a/drivers/xen/events/events_internal.h b/drivers/xen/events/events_internal.h
> index 1c71a5d..d6bedb6 100644
> --- a/drivers/xen/events/events_internal.h
> +++ b/drivers/xen/events/events_internal.h
> @@ -124,4 +124,6 @@ static inline void xen_evtchn_handle_events(int cpu)
>         return evtchn_ops.handle_events(cpu);
>  }
> 
> +int xen_evtchn_init_fifo_based(void);
> +
>  #endif /* #ifndef __EVENTS_INTERNAL_H__ */
> diff --git a/drivers/xen/events/fifo.c b/drivers/xen/events/fifo.c
> new file mode 100644
> index 0000000..8f8e390
> --- /dev/null
> +++ b/drivers/xen/events/fifo.c
> @@ -0,0 +1,312 @@
> +/*
> + * Xen event channels (FIFO-based ABI)
> + *
> + * Copyright (C) 2013 Citrix Systems R&D ltd.
> + *
> + * This source code is licensed under the GNU General Public License,
> + * Version 2 or later.  See the file COPYING for more details.
> + */

I know this is still only a RFC, but could this code be licensed under 
something similar to what other parts of the xen related linux kernel 
code use (dual license):

/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation; or, when distributed
 * separately from the Linux kernel or incorporated into other
 * software packages, subject to the following license:
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this source file (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy, modify,
 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

So it can be imported into other OSes that are not under the GPL.

  reply	other threads:[~2013-03-20  9:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 21:04 [PATCH RFC 0/12] Linux: FIFO-based event channel ABI David Vrabel
2013-03-19 21:04 ` [PATCH 01/12] xen/events: avoid race with raising an event in unmask_evtchn() David Vrabel
2013-03-19 21:04 ` [PATCH 02/12] xen/events: refactor retrigger_dynirq() and resend_irq_on_evtchn() David Vrabel
2013-03-20 11:06   ` Jan Beulich
2013-03-19 21:04 ` [PATCH 03/12] xen/events: remove unnecessary init_evtchn_cpu_bindings() David Vrabel
2013-03-20 11:09   ` Jan Beulich
2013-03-20 13:20     ` David Vrabel
2013-03-20 13:40       ` Jan Beulich
2013-03-19 21:04 ` [PATCH 04/12] xen/events: introduce test_and_set_mask David Vrabel
2013-03-19 21:04 ` [PATCH 05/12] xen/events: replace raw bit ops with functions David Vrabel
2013-03-19 21:04 ` [PATCH 06/12] xen/events: move drivers/xen/events.c into drivers/xen/events/ David Vrabel
2013-03-19 21:04 ` [PATCH 07/12] xen/events: move 2-level specific code into its own file David Vrabel
2013-03-19 21:04 ` [PATCH 08/12] xen/events: add struct evtchn_ops for the low-level port operations David Vrabel
2013-03-20 11:12   ` Jan Beulich
2013-03-19 21:04 ` [PATCH 09/12] xen/events: allow setup of irq_info to fail David Vrabel
2013-03-19 21:04 ` [PATCH 10/12] xen/events: add a evtchn_op for port setup David Vrabel
2013-03-19 21:04 ` [PATCH 11/12] xen/events: Add the hypervisor interface for the FIFO-based event channels David Vrabel
2013-03-20 14:03   ` Wei Liu
2013-03-20 14:18     ` David Vrabel
2013-03-20 14:36       ` Wei Liu
2013-03-19 21:04 ` [PATCH 12/12] xen/events: use the FIFO-based ABI if available David Vrabel
2013-03-20  9:38   ` Roger Pau Monné [this message]
     [not found] ` <1363727099-25519-2-git-send-email-david.vrabel@citrix.com>
2013-03-20 11:00   ` [PATCH 01/12] xen/events: avoid race with raising an event in unmask_evtchn() Stefano Stabellini
     [not found]   ` <alpine.DEB.2.02.1303201052280.17662@kaball.uk.xensource.com>
2013-03-20 12:20     ` David Vrabel
2013-03-20 12:21       ` Stefano Stabellini
2013-05-06 19:51 ` [PATCH RFC 0/12] Linux: FIFO-based event channel ABI Konrad Rzeszutek Wilk
2013-05-07 12:26   ` David Vrabel
  -- strict thread matches above, loose matches on Subject: below --
2013-08-09 18:15 [RFC PATCHv2 00/12] " David Vrabel
2013-08-09 18:15 ` [PATCH 12/12] xen/events: use the FIFO-based ABI if available David Vrabel
2013-08-16 17:47   ` Wei Liu
2013-08-19 11:55     ` David Vrabel

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=5149838B.7050707@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=keir@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=wei.liu2@citrix.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).