[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 12/12] xen/events: use the FIFO-based ABI if available



On 19/03/13 22:04, David Vrabel wrote:
> From: David Vrabel <david.vrabel@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  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.


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.