WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 30 of 38] xen: implement io_apic_ops

To: Ingo Molnar <mingo@xxxxxxx>
Subject: [Xen-devel] Re: [PATCH 30 of 38] xen: implement io_apic_ops
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 20 Nov 2008 09:00:41 -0800
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Yinghai Lu <yinghai@xxxxxxxxxx>
Delivery-date: Thu, 20 Nov 2008 09:01:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081120093506.GB6885@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1226603398@xxxxxxxxxxxxxxxxx> <d103c0da2fa147ac31af.1226603428@xxxxxxxxxxxxxxxxx> <20081120093506.GB6885@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.17 (X11/20081009)
Ingo Molnar wrote:
* Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:

Writes to the IO APIC are paravirtualized via hypercalls, so implement
the appropriate operations.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 arch/x86/xen/Makefile    |    3 +-
 arch/x86/xen/apic.c      |   66 ++++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/xen/enlighten.c |    2 +
 arch/x86/xen/xen-ops.h   |    2 +
 4 files changed, 72 insertions(+), 1 deletion(-)

hm, why is the ioapic used as the API here, and not an irqchip?

In essence, the purpose of the series is to break the 1:1 relationship between Linux irqs and hardware GSIs. This allows me to have my own irq allocator, which in turn allows me to intermix "physical" irqs (ie, a Linux irq number bound to a real hardware interrupt source) with the various software/virtual irqs the Xen system needs.

Once a physical irq has been mapped onto a gsi interrupt source, the mechanisms for handing the ioapic side of things are more or less the same. There's the same procedure of finding the ioapic/pin for a gsi and programming the appropriate vector.

(Presumably once I implement MSI support, all references to "gsi" will become "gsi/msi/etc".)

So, there's an awkward tradeoff. I could just completely duplicate the whole irq/vector/ioapic management code and hide it under my own irqchip, but it would end up duplicating a lot of the existing code. My alternative was to try to open out the existing code into something like a thin ioapic library, which I can call into as needed. The only low-level difference is that the Xen ioapics need to be programmed via a hypercall rather than register writes.

If the x86 interrupt layer in general decouples irqs from GSIs, then I can probably make use of that to clean things up. A general irq allocator along with some way of attaching interrupt-source-specific information to each irq would get me a long way, I think. I'd still need hooks to paravirtualize the actual ioapic writes, but at least I wouldn't need to have quite so much delicate hooking.

Thanks,
   J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>