* Re: [RFC PATCH 23/35] Increase x86 interrupt vector range
@ 2006-05-13 17:44 Chuck Ebbert
2006-05-14 7:52 ` Keir Fraser
2006-05-15 21:57 ` Chris Wright
0 siblings, 2 replies; 5+ messages in thread
From: Chuck Ebbert @ 2006-05-13 17:44 UTC (permalink / raw)
To: Chris Wright
Cc: linux-kernel, virtualization, Xen-devel, Ian Pratt,
Christian Limpach, Andi Kleen, Andrew Morton
In-Reply-To: <20060509085157.070289000@sous-sol.org>
On Tue, 09 May 2006 00:00:23 -0700, Chris Wright wrote:
> Remove the limit of 256 interrupt vectors by changing the value
> stored in orig_{e,r}ax to be the negated interrupt vector.
> The orig_{e,r}ax needs to be < 0 to allow the signal code to
> distinguish between return from interrupt and return from syscall.
> With this change applied, NR_IRQS can be > 256.
>
> Xen extends the IRQ numbering space to include room for dynamically
> allocated virtual interrupts (in the range 256-511), which requires a
> more permissive interface to do_IRQ.
>
> 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>
> ---
AFAIC this could go in anytime. It's simple, self-contained and makes
sense even without Xen.
One minor nit: the IRQ value isn't negated, it's complemented. The
comments need to be fixed.
Original patch:
arch/i386/kernel/entry.S | 4 ++--
arch/i386/kernel/irq.c | 4 ++--
arch/x86_64/kernel/entry.S | 2 +-
arch/x86_64/kernel/irq.c | 4 ++--
arch/x86_64/kernel/smp.c | 4 ++--
include/asm-x86_64/hw_irq.h | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
--- linus-2.6.orig/arch/i386/kernel/entry.S
+++ linus-2.6/arch/i386/kernel/entry.S
@@ -464,7 +464,7 @@ vector=0
ENTRY(irq_entries_start)
.rept NR_IRQS
ALIGN
-1: pushl $vector-256
+1: pushl $~(vector)
jmp common_interrupt
.data
.long 1b
@@ -481,7 +481,7 @@ common_interrupt:
#define BUILD_INTERRUPT(name, nr) \
ENTRY(name) \
- pushl $nr-256; \
+ pushl $~(nr); \
SAVE_ALL \
movl %esp,%eax; \
call smp_/**/name; \
--- linus-2.6.orig/arch/i386/kernel/irq.c
+++ linus-2.6/arch/i386/kernel/irq.c
@@ -53,8 +53,8 @@ static union irq_ctx *softirq_ctx[NR_CPU
*/
fastcall unsigned int do_IRQ(struct pt_regs *regs)
{
- /* high bits used in ret_from_ code */
- int irq = regs->orig_eax & 0xff;
+ /* high bit used in ret_from_ code */
+ int irq = ~regs->orig_eax;
#ifdef CONFIG_4KSTACKS
union irq_ctx *curctx, *irqctx;
u32 *isp;
--- linus-2.6.orig/arch/x86_64/kernel/entry.S
+++ linus-2.6/arch/x86_64/kernel/entry.S
@@ -601,7 +601,7 @@ retint_kernel:
*/
.macro apicinterrupt num,func
INTR_FRAME
- pushq $\num-256
+ pushq $~(\num)
CFI_ADJUST_CFA_OFFSET 8
interrupt \func
jmp ret_from_intr
--- linus-2.6.orig/arch/x86_64/kernel/irq.c
+++ linus-2.6/arch/x86_64/kernel/irq.c
@@ -91,8 +91,8 @@ skip:
*/
asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
{
- /* high bits used in ret_from_ code */
- unsigned irq = regs->orig_rax & 0xff;
+ /* high bit used in ret_from_ code */
+ unsigned irq = ~regs->orig_rax;
exit_idle();
irq_enter();
--- linus-2.6.orig/arch/x86_64/kernel/smp.c
+++ linus-2.6/arch/x86_64/kernel/smp.c
@@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt
cpu = smp_processor_id();
/*
- * orig_rax contains the interrupt vector - 256.
+ * orig_rax contains the negated interrupt vector.
* Use that to determine where the sender put the data.
*/
- sender = regs->orig_rax + 256 - INVALIDATE_TLB_VECTOR_START;
+ sender = ~regs->orig_rax - INVALIDATE_TLB_VECTOR_START;
f = &per_cpu(flush_state, sender);
if (!cpu_isset(cpu, f->flush_cpumask))
--- linus-2.6.orig/include/asm-x86_64/hw_irq.h
+++ linus-2.6/include/asm-x86_64/hw_irq.h
@@ -127,7 +127,7 @@ asmlinkage void IRQ_NAME(nr); \
__asm__( \
"\n.p2align\n" \
"IRQ" #nr "_interrupt:\n\t" \
- "push $" #nr "-256 ; " \
+ "push $~(" #nr ") ; " \
"jmp common_interrupt");
#if defined(CONFIG_X86_IO_APIC)
--
Chuck
"The x86 isn't all that complex -- it just doesn't make a lot of sense."
-- Mike Johnson
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC PATCH 23/35] Increase x86 interrupt vector range
2006-05-13 17:44 [RFC PATCH 23/35] Increase x86 interrupt vector range Chuck Ebbert
@ 2006-05-14 7:52 ` Keir Fraser
2006-05-14 17:08 ` Ingo Oeser
2006-05-15 21:57 ` Chris Wright
1 sibling, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2006-05-14 7:52 UTC (permalink / raw)
To: Chuck Ebbert
Cc: Ian Pratt, linux-kernel, Xen-devel, virtualization, Chris Wright
On 13 May 2006, at 18:44, Chuck Ebbert wrote:
> AFAIC this could go in anytime. It's simple, self-contained and makes
> sense even without Xen.
>
> One minor nit: the IRQ value isn't negated, it's complemented. The
> comments need to be fixed.
If we really want it disambiguated then we should call it something
like 'bitwise-negated' or 'ones-complemented'. 'Complemented' alone is
worse than 'negated' imo, since negation is at least the usual name for
the tilde operator in C while complementation is an ambiguous term
unless you know the base/radix.
-- Keir
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 23/35] Increase x86 interrupt vector range
2006-05-14 7:52 ` Keir Fraser
@ 2006-05-14 17:08 ` Ingo Oeser
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Oeser @ 2006-05-14 17:08 UTC (permalink / raw)
To: Keir Fraser
Cc: Chuck Ebbert, Ian Pratt, linux-kernel, Xen-devel, virtualization,
Chris Wright
On Sunday, 14. May 2006 09:52, Keir Fraser wrote:
> If we really want it disambiguated then we should call it something
> like 'bitwise-negated' or 'ones-complemented'. 'Complemented' alone is
> worse than 'negated' imo, since negation is at least the usual name for
> the tilde operator in C while complementation is an ambiguous term
> unless you know the base/radix.
Not really.
I've seen "negate" only be used to mean "twos complement"
and "invert" only be seen with "ones complement".
So if you like to be clear, just use "negate" vs. "invert".
Regards
Ingo Oeser
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 23/35] Increase x86 interrupt vector range
2006-05-13 17:44 [RFC PATCH 23/35] Increase x86 interrupt vector range Chuck Ebbert
2006-05-14 7:52 ` Keir Fraser
@ 2006-05-15 21:57 ` Chris Wright
1 sibling, 0 replies; 5+ messages in thread
From: Chris Wright @ 2006-05-15 21:57 UTC (permalink / raw)
To: Chuck Ebbert
Cc: Chris Wright, linux-kernel, virtualization, Xen-devel, Ian Pratt,
Christian Limpach, Andi Kleen, Andrew Morton
* Chuck Ebbert (76306.1226@compuserve.com) wrote:
> In-Reply-To: <20060509085157.070289000@sous-sol.org>
>
> On Tue, 09 May 2006 00:00:23 -0700, Chris Wright wrote:
>
> > Remove the limit of 256 interrupt vectors by changing the value
> > stored in orig_{e,r}ax to be the negated interrupt vector.
> > The orig_{e,r}ax needs to be < 0 to allow the signal code to
> > distinguish between return from interrupt and return from syscall.
> > With this change applied, NR_IRQS can be > 256.
> >
> > Xen extends the IRQ numbering space to include room for dynamically
> > allocated virtual interrupts (in the range 256-511), which requires a
> > more permissive interface to do_IRQ.
> >
> > 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>
> > ---
>
> AFAIC this could go in anytime. It's simple, self-contained and makes
> sense even without Xen.
The plan is to split out things like this and push them ahead of the
rest of the batch.
> One minor nit: the IRQ value isn't negated, it's complemented. The
> comments need to be fixed.
OK, bitwise negated.
thanks,
-chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 00/35] Xen i386 paravirtualization support
@ 2006-05-09 8:49 Chris Wright
2006-05-09 7:00 ` [RFC PATCH 23/35] Increase x86 interrupt vector range Chris Wright
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wright @ 2006-05-09 8:49 UTC (permalink / raw)
To: linux-kernel; +Cc: virtualization, xen-devel
Unlike full virtualization in which the virtual machine provides
the same platform interface as running natively on the hardware,
paravirtualization requires modification to the guest operating system
to work with the platform interface provided by the hypervisor.
Xen was designed with performance in mind. Calls to the hypervisor
are minimized, batched if necessary, and non-critical codepaths are left
unmodified in the case where the privileged instruction can be trapped and
emulated by the hypervisor. The Xen API is designed to be OS agnostic and
has had Linux, NetBSD, FreeBSD, Solaris, Plan9 and Netware ported to it.
Xen also provides support for running directly on native hardware.
The following patch series provides the minimal support required to
launch Xen paravirtual guests on standard x86 hardware running the Xen
hypervisor. These patches effectively port the Linux kernel to run on the
platform interface provided by Xen. This port is done as an i386 subarch.
In the future, we will break this patchset up to place the general
infrastrcture and subarch bits that may have common users at the
beginning of the series, ripe for picking off and pushing upstream.
With these patches you will be able to launch an unprivileged guest
running the modified Linux kernel and unmodified userspace. This guest
is x86, UP only, runs in shadow translated mode, and has no direct access
to hardware. This simplifies the patchset to the minimum functionality
needed to support a paravirtualized guest. It's worth noting that
a fair amount of this patchset deals with paravirtualizing I/O, not
just CPU-only. The additional missing functionality is primarily about
full SMP support, optimizations such as direct writable page tables,
and the management interface.
At a high-level, the patches provide the following:
- Kconfig and Makefile changes required to support Xen
- subarch changes to allow more platform functionality to be
implemented by an i386 subarch
- Xen subarch implementation
- start of day code for running in the hypervisor provided environment (paging
enabled)
- basic Xen drivers to provide a fully functional guest
The Xen platform API encapsulates the following types of requirements:
- idt, gdt, ldt (descriptor table handling)
- cr2, fpu_taskswitch, debug registers (privileged register handling)
- mmu (page table, tlb, and cache handling)
- memory reservations
- time and timer
- vcpu (init, up/down vcpu)
- schedule (processor yield, shutdown, etc)
- event channel (generalized virtual interrupt handling)
- grant table (shared memory interface for high speed interdomain communication)
- block device I/O
- network device I/O
- console device I/O
- Xen feature map
- Xen version info
Thanks to all have reviewed earlier versions of these patches.
-chris
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 23/35] Increase x86 interrupt vector range
2006-05-09 8:49 [RFC PATCH 00/35] Xen i386 paravirtualization support Chris Wright
@ 2006-05-09 7:00 ` Chris Wright
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wright @ 2006-05-09 7:00 UTC (permalink / raw)
To: linux-kernel; +Cc: virtualization, xen-devel, Ian Pratt, Christian Limpach
[-- Attachment #1: x86-increase-interrupt-vector-range --]
[-- Type: text/plain, Size: 3302 bytes --]
Remove the limit of 256 interrupt vectors by changing the value
stored in orig_{e,r}ax to be the negated interrupt vector.
The orig_{e,r}ax needs to be < 0 to allow the signal code to
distinguish between return from interrupt and return from syscall.
With this change applied, NR_IRQS can be > 256.
Xen extends the IRQ numbering space to include room for dynamically
allocated virtual interrupts (in the range 256-511), which requires a
more permissive interface to do_IRQ.
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/entry.S | 4 ++--
arch/i386/kernel/irq.c | 4 ++--
arch/x86_64/kernel/entry.S | 2 +-
arch/x86_64/kernel/irq.c | 4 ++--
arch/x86_64/kernel/smp.c | 4 ++--
include/asm-x86_64/hw_irq.h | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
--- linus-2.6.orig/arch/i386/kernel/entry.S
+++ linus-2.6/arch/i386/kernel/entry.S
@@ -464,7 +464,7 @@ vector=0
ENTRY(irq_entries_start)
.rept NR_IRQS
ALIGN
-1: pushl $vector-256
+1: pushl $~(vector)
jmp common_interrupt
.data
.long 1b
@@ -481,7 +481,7 @@ common_interrupt:
#define BUILD_INTERRUPT(name, nr) \
ENTRY(name) \
- pushl $nr-256; \
+ pushl $~(nr); \
SAVE_ALL \
movl %esp,%eax; \
call smp_/**/name; \
--- linus-2.6.orig/arch/i386/kernel/irq.c
+++ linus-2.6/arch/i386/kernel/irq.c
@@ -53,8 +53,8 @@ static union irq_ctx *softirq_ctx[NR_CPU
*/
fastcall unsigned int do_IRQ(struct pt_regs *regs)
{
- /* high bits used in ret_from_ code */
- int irq = regs->orig_eax & 0xff;
+ /* high bit used in ret_from_ code */
+ int irq = ~regs->orig_eax;
#ifdef CONFIG_4KSTACKS
union irq_ctx *curctx, *irqctx;
u32 *isp;
--- linus-2.6.orig/arch/x86_64/kernel/entry.S
+++ linus-2.6/arch/x86_64/kernel/entry.S
@@ -601,7 +601,7 @@ retint_kernel:
*/
.macro apicinterrupt num,func
INTR_FRAME
- pushq $\num-256
+ pushq $~(\num)
CFI_ADJUST_CFA_OFFSET 8
interrupt \func
jmp ret_from_intr
--- linus-2.6.orig/arch/x86_64/kernel/irq.c
+++ linus-2.6/arch/x86_64/kernel/irq.c
@@ -91,8 +91,8 @@ skip:
*/
asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
{
- /* high bits used in ret_from_ code */
- unsigned irq = regs->orig_rax & 0xff;
+ /* high bit used in ret_from_ code */
+ unsigned irq = ~regs->orig_rax;
exit_idle();
irq_enter();
--- linus-2.6.orig/arch/x86_64/kernel/smp.c
+++ linus-2.6/arch/x86_64/kernel/smp.c
@@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt
cpu = smp_processor_id();
/*
- * orig_rax contains the interrupt vector - 256.
+ * orig_rax contains the negated interrupt vector.
* Use that to determine where the sender put the data.
*/
- sender = regs->orig_rax + 256 - INVALIDATE_TLB_VECTOR_START;
+ sender = ~regs->orig_rax - INVALIDATE_TLB_VECTOR_START;
f = &per_cpu(flush_state, sender);
if (!cpu_isset(cpu, f->flush_cpumask))
--- linus-2.6.orig/include/asm-x86_64/hw_irq.h
+++ linus-2.6/include/asm-x86_64/hw_irq.h
@@ -127,7 +127,7 @@ asmlinkage void IRQ_NAME(nr); \
__asm__( \
"\n.p2align\n" \
"IRQ" #nr "_interrupt:\n\t" \
- "push $" #nr "-256 ; " \
+ "push $~(" #nr ") ; " \
"jmp common_interrupt");
#if defined(CONFIG_X86_IO_APIC)
--
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-15 21:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-13 17:44 [RFC PATCH 23/35] Increase x86 interrupt vector range Chuck Ebbert
2006-05-14 7:52 ` Keir Fraser
2006-05-14 17:08 ` Ingo Oeser
2006-05-15 21:57 ` Chris Wright
-- strict thread matches above, loose matches on Subject: below --
2006-05-09 8:49 [RFC PATCH 00/35] Xen i386 paravirtualization support Chris Wright
2006-05-09 7:00 ` [RFC PATCH 23/35] Increase x86 interrupt vector range Chris Wright
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®