mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Chris Wright <chrisw@sous-sol.org>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.osdl.org,
	Ian Pratt <ian.pratt@xensource.com>,
	Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Subject: Re: [RFC PATCH 23/35] Add support for Xen event channels.
Date: Wed, 22 Mar 2006 09:36:47 +0100	[thread overview]
Message-ID: <1143016607.2955.14.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20060322063758.453555000@sorel.sous-sol.org>

On Tue, 2006-03-21 at 22:31 -0800, Chris Wright wrote:
> plain text document attachment (22-evtchn)
> Support Xen event channels instead of the i8259 PIC.
> 
> Event channels are used to inject events into the kernel, either from
> the hypervisor or from another VM.  The injected events are mapped to
> interrupts.
> 
> If an event needs to be injected, the hypervisor causes an upcall into
> the kernel.  The upcall handler then scans the event pending bitmap
> and calls do_IRQ for each pending event.
> 
> Signed-off-by: Ian Pratt <ian.pratt@xensource.com>
> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
>  arch/i386/kernel/Makefile               |    6 
>  arch/i386/mach-xen/evtchn.c             |  844 ++++++++++++++++++++++++++++++++
>  drivers/xen/core/Makefile               |    2 
>  include/asm-i386/hw_irq.h               |    4 
>  include/asm-i386/mach-xen/irq_vectors.h |  126 ++++
>  include/xen/evtchn.h                    |  113 ++++
>  6 files changed, 1093 insertions(+), 2 deletions(-)
> 
> --- xen-subarch-2.6.orig/arch/i386/kernel/Makefile
> +++ xen-subarch-2.6/arch/i386/kernel/Makefile
> @@ -5,7 +5,7 @@
>  extra-y := head.o init_task.o vmlinux.lds
>  
>  obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o \
> -		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
> +		ptrace.o time.o ioport.o ldt.o setup.o hw_irq.o sys_i386.o \
>  		pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
>  		quirks.o i8237.o topology.o
>  
> @@ -42,6 +42,10 @@ EXTRA_AFLAGS   := -traditional
>  
>  obj-$(CONFIG_SCx200)		+= scx200.o
>  
> +hw_irq-y			:= i8259.o
> +
> +hw_irq-$(CONFIG_XEN)		:= ../mach-xen/evtchn.o
> +
>  # vsyscall.o contains the vsyscall DSO images as __initdata.
>  # We must build both images before we can assemble it.
>  # Note: kbuild does not track this dependency due to usage of .incbin
> --- xen-subarch-2.6.orig/include/asm-i386/hw_irq.h
> +++ xen-subarch-2.6/include/asm-i386/hw_irq.h
> @@ -68,7 +68,9 @@ extern atomic_t irq_mis_count;
>  
>  #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
>  
> -#if defined(CONFIG_X86_IO_APIC)
> +#if defined(CONFIG_X86_XEN)
> +extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i);
> +#elif defined(CONFIG_X86_IO_APIC)
>  static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
>  {
>  	if (IO_APIC_IRQ(i))
> --- /dev/null
> +++ xen-subarch-2.6/arch/i386/mach-xen/evtchn.c
> @@ -0,0 +1,844 @@
> +/******************************************************************************
> + * evtchn.c
> + * 
> + * Communication via Xen event channels.
> + * 
> + * Copyright (c) 2002-2005, K A Fraser
> + * 
> + * This file may be distributed separately from the Linux kernel, or
> + * incorporated into other software packages, subject to the following license:
> + * 


again no allowance for use inside the kernel


> + */
> +
> +#include <linux/config.h>
> +#include <linux/module.h>
> +#include <linux/irq.h>
> +#include <linux/interrupt.h>
> +#include <linux/sched.h>
> +#include <linux/kernel_stat.h>
> +#include <linux/version.h>

this highly looks that it's not possible to be used outside the linux
kernel so the license is odd

> +/* Convenient shorthand for packed representation of an unbound IRQ. */
> +#define IRQ_UNBOUND	mk_irq_info(IRQT_UNBOUND, 0, 0)
> +/* Accessor macros for packed IRQ information. */
> +#define evtchn_from_irq(irq) ((u16)(irq_info[irq]))
> +#define index_from_irq(irq)  ((u8)(irq_info[irq] >> 16))
> +#define type_from_irq(irq)   ((u8)(irq_info[irq] >> 24))

static inlines please

> +#ifdef CONFIG_XEN_EVTCHN_DEVICE
> +				evtchn_device_upcall(port);
> +#else
> +				mask_evtchn(port);
> +#endif

why this ifdef ?

> +static int find_unbound_irq(void)
> +{
> +	int irq;
> +
> +	for (irq = 0; irq < NR_IRQS; irq++)
> +		if (irq_bindcount[irq] == 0)
> +			break;
> +
> +	if (irq == NR_IRQS) {
> +		printk(KERN_ERR "No available IRQ to bind to: increase NR_IRQS!\n");

there is no way to share interrupts? A shame


> +EXPORT_SYMBOL(bind_virq_to_irqhandler);

this is highly low level interfact, please make this and the others a
_GPL export




  reply	other threads:[~2006-03-22  8:36 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-22  6:30 [RFC PATCH 00/35] Xen i386 paravirtualization support Chris Wright
2006-03-22  6:30 ` [RFC PATCH 01/35] Add XEN config options and disable unsupported config options Chris Wright
2006-03-22  6:30 ` [RFC PATCH 02/35] Makefile support to build Xen subarch Chris Wright
2006-03-22  6:30 ` [RFC PATCH 03/35] Add Xen interface header files Chris Wright
2006-03-22  6:30 ` [RFC PATCH 04/35] Hypervisor " Chris Wright
2006-03-22  8:28   ` Arjan van de Ven
2006-03-22  9:31     ` Keir Fraser
2006-03-22  9:46       ` Arjan van de Ven
2006-03-22 11:32       ` David Schwartz
2006-03-22 14:29         ` Keir Fraser
2006-03-22  6:30 ` [RFC PATCH 05/35] Add sync bitops Chris Wright
2006-03-22  6:30 ` [RFC PATCH 06/35] Add vmlinuz build target Chris Wright
2006-03-22  6:30 ` [RFC PATCH 07/35] Make LOAD_OFFSET defined by subarch Chris Wright
2006-03-22 22:57   ` Dan Hecht
2006-03-27  8:18     ` Gerd Hoffmann
2006-03-22  6:30 ` [RFC PATCH 08/35] Add Xen-specific memory management definitions Chris Wright
2006-03-22  6:30 ` [RFC PATCH 09/35] Change __FIXADDR_TOP to leave room for the hypervisor Chris Wright
2006-03-22 17:27   ` Anthony Liguori
2006-03-22 17:32     ` Chris Wright
2006-03-22  6:30 ` [RFC PATCH 10/35] Add a new head.S start-of-day file for booting on Xen Chris Wright
2006-03-22 13:43   ` Andi Kleen
2006-03-22 18:58     ` Chris Wright
2006-03-22 18:45       ` Andi Kleen
2006-03-22 19:26         ` Chris Wright
2006-03-22  6:30 ` [RFC PATCH 11/35] Add support for Xen to entry.S Chris Wright
2006-03-22 13:55   ` Andi Kleen
2006-03-22 17:24     ` [Xen-devel] " Zachary Amsden
2006-03-22  6:30 ` [RFC PATCH 12/35] Add start-of-day setup hooks to subarch Chris Wright
2006-03-22  6:30 ` [RFC PATCH 13/35] Support loading an initrd when running on Xen Chris Wright
2006-03-22 14:22   ` Andi Kleen
2006-03-22 19:20     ` Chris Wright
2006-03-22  6:30 ` [RFC PATCH 14/35] subarch modify CPU capabilities Chris Wright
2006-03-22  8:35   ` [Xen-devel] " Zachary Amsden
2006-03-22  9:33     ` Keir Fraser
2006-03-22 19:29       ` Chris Wright
2006-03-22  6:30 ` [RFC PATCH 15/35] subarch support for controlling interrupt delivery Chris Wright
2006-03-22  6:30 ` [RFC PATCH 16/35] subarch support for interrupt and exception gates Chris Wright
2006-03-22 13:45   ` Andi Kleen
2006-03-22 20:54     ` Chris Wright
2006-03-22  6:30 ` [RFC PATCH 17/35] Segment register changes for Xen Chris Wright
2006-03-22 14:24   ` Andi Kleen
2006-03-22 19:33     ` Chris Wright
2006-03-23  0:16   ` Zachary Amsden
2006-03-22  6:30 ` [RFC PATCH 18/35] Support gdt/idt/ldt handling on Xen Chris Wright
2006-03-22 14:30   ` Andi Kleen
2006-03-22 17:51     ` [Xen-devel] " Zachary Amsden
2006-03-22 17:36       ` Andi Kleen
2006-03-22  6:30 ` [RFC PATCH 19/35] subarch support for control register accesses Chris Wright
2006-03-22  8:55   ` Zachary Amsden
2006-03-22 21:45     ` Chris Wright
2006-03-22  6:31 ` [RFC PATCH 20/35] subarch stack pointer update Chris Wright
2006-03-22  6:31 ` [RFC PATCH 21/35] subarch TLB support Chris Wright
2006-03-22  6:31 ` [RFC PATCH 22/35] subarch suport for idle loop (NO_IDLE_HZ for Xen) Chris Wright
2006-03-22  6:31 ` [RFC PATCH 23/35] Add support for Xen event channels Chris Wright
2006-03-22  8:36   ` Arjan van de Ven [this message]
2006-03-22 11:30     ` Keir Fraser
2006-03-22 14:07   ` Andi Kleen
2006-03-22  6:31 ` [RFC PATCH 24/35] subarch support for mask value for irq nubmers Chris Wright
2006-03-22  6:31 ` [RFC PATCH 25/35] Add Xen time abstractions Chris Wright
2006-03-22  8:38   ` Arjan van de Ven
2006-03-22 19:37     ` Chris Wright
2006-03-22 22:26       ` [Xen-devel] " Dan Hecht
2006-03-23  3:23   ` [Xen-devel] " Eli Collins
2006-03-23  6:47     ` Chris Wright
2006-03-22  6:31 ` [RFC PATCH 26/35] Add Xen subarch reboot support Chris Wright
2006-03-22  8:40   ` Arjan van de Ven
2006-03-22 10:22     ` Keir Fraser
2006-03-22 10:39       ` Arjan van de Ven
2006-03-22 10:52         ` Keir Fraser
2006-03-22 14:21   ` Andi Kleen
2006-03-22 20:59     ` Pavel Machek
2006-03-22  6:31 ` [RFC PATCH 27/35] Add nosegneg capability to the vsyscall page notes Chris Wright
2006-03-22  6:31 ` [RFC PATCH 28/35] add support for Xen feature queries Chris Wright
2006-03-22  8:42   ` Arjan van de Ven
2006-03-22  6:31 ` [RFC PATCH 29/35] Add the Xen virtual console driver Chris Wright
2006-03-22  8:43   ` Arjan van de Ven
2006-03-22  9:29     ` Keir Fraser
2006-03-22 14:17   ` Andi Kleen
2006-03-22 16:00   ` Anthony Liguori
2006-03-22 16:07     ` Keir Fraser
2006-03-22 16:14       ` Anthony Liguori
2006-03-22  6:31 ` [RFC PATCH 30/35] Add generic_page_range() function Chris Wright
2006-03-22  8:51   ` Zachary Amsden
2006-03-22  9:27     ` [Xen-devel] " Keir Fraser
2006-03-22 11:21   ` Nick Piggin
2006-03-22 14:33     ` Keir Fraser
2006-03-22 15:35       ` Keir Fraser
2006-03-23  0:15         ` Nick Piggin
2006-03-23  0:26       ` Nick Piggin
2006-03-22  6:31 ` [RFC PATCH 31/35] Add Xen grant table support Chris Wright
2006-03-22  8:45   ` Arjan van de Ven
2006-03-22 18:38     ` Chris Wright
2006-03-22  6:31 ` [RFC PATCH 32/35] Add Xen driver utility functions Chris Wright
2006-03-22 14:12   ` Andi Kleen
2006-03-22  6:31 ` [RFC PATCH 33/35] Add the Xenbus sysfs and virtual device hotplug driver Chris Wright
2006-03-22  8:53   ` Arjan van de Ven
2006-03-22 11:14     ` Keir Fraser
2006-03-22  6:31 ` [RFC PATCH 34/35] Add the Xen virtual network device driver Chris Wright
2006-03-22  8:59   ` Arjan van de Ven
2006-03-22 15:29   ` James Morris
2006-03-22 17:17   ` Stephen Hemminger
2006-03-22  6:31 ` [RFC PATCH 35/35] Add Xen virtual block " Chris Wright
2006-03-22 16:39   ` Anthony Liguori
2006-03-22 16:54     ` Christoph Hellwig
2006-03-27  8:42     ` Gerd Hoffmann
2006-03-22 17:15 ` [RFC PATCH 00/35] Xen i386 paravirtualization support Anthony Liguori
2006-03-22 17:27   ` Chris Wright
2006-03-22 17:50     ` Anthony Liguori

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=1143016607.2955.14.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=chrisw@sous-sol.org \
    --cc=ian.pratt@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®