public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
@ 2007-03-06  7:59 Yinghai Lu
  2007-03-07  3:43 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Yinghai Lu @ 2007-03-06  7:59 UTC (permalink / raw)
  To: ebiederm, Andrew Morton
  Cc: linux-kernel, Ingo Molnar, Andi Kleen, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 27 bytes --]

please check the patch

YH

[-- Attachment #2: 3_irq_20_30.patch --]
[-- Type: text/x-patch, Size: 3903 bytes --]

[PATCH] x86_64 irq: keep consistent for IRQ0_VECTOR from 0x20 to 0x30

FIRST_EXTERNAL_VECTOR is used for IRQ_MOVE_CLEANUP_VECTOR, and IRQ0 starting from FIRST_EXTERNAL_VECTOR + 0x10. So reduce interrupt array for IRQ.

Signed-off-by: Yinghai Lu <yinghai.lu@amd.com>

diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 21d95b7..ac6916e 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -45,7 +45,7 @@
 
 /*
  * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
- * (these are usually mapped to vectors 0x20-0x2f)
+ * (these are usually mapped to vectors 0x30-0x3f)
  */
 
 /*
@@ -58,7 +58,7 @@
  *
  * (these are usually mapped into the 0x30-0xff vector range)
  */
-				      BUILD_16_IRQS(0x2) BUILD_16_IRQS(0x3)
+							 BUILD_16_IRQS(0x3)
 BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7)
 BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
 BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BUILD_16_IRQS(0xe) BUILD_16_IRQS(0xf)
@@ -77,8 +77,8 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BUILD_16_IRQS(0xe) BUILD_16_IRQS(0xf)
 	IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
 /* for the irq vectors */
-static void (*interrupt[NR_VECTORS - FIRST_EXTERNAL_VECTOR])(void) = {
-					  IRQLIST_16(0x2), IRQLIST_16(0x3),
+static void (*interrupt[NR_VECTORS - IRQ0_VECTOR])(void) = {
+					  		   IRQLIST_16(0x3),
 	IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
 	IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
 	IRQLIST_16(0xc), IRQLIST_16(0xd), IRQLIST_16(0xe), IRQLIST_16(0xf)
@@ -299,7 +299,7 @@ void init_8259A(int auto_eoi)
 	 * outb_p - this has to work on a wide range of PC hardware.
 	 */
 	outb_p(0x11, 0x20);	/* ICW1: select 8259A-1 init */
-	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */
+	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */
 	outb_p(0x04, 0x21);	/* 8259A-1 (the master) has a slave on IR2 */
 	if (auto_eoi)
 		outb_p(0x03, 0x21);	/* master does Auto EOI */
@@ -307,7 +307,7 @@ void init_8259A(int auto_eoi)
 		outb_p(0x01, 0x21);	/* master expects normal EOI */
 
 	outb_p(0x11, 0xA0);	/* ICW1: select 8259A-2 init */
-	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */
+	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x38-0x3f */
 	outb_p(0x02, 0xA1);	/* 8259A-2 is a slave on master's IR2 */
 	outb_p(0x01, 0xA1);	/* (slave's support for AEOI in flat mode
 				    is to be investigated) */
@@ -513,8 +513,8 @@ void __init init_IRQ(void)
 	 * us. (some of these will be overridden and become
 	 * 'special' SMP interrupts)
 	 */
-	for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) {
-		int vector = FIRST_EXTERNAL_VECTOR + i;
+	for (i = 0; i < (NR_VECTORS - IRQ0_VECTOR); i++) {
+		int vector = IRQ0_VECTOR + i;
 		if (vector != IA32_SYSCALL_VECTOR)
 			set_intr_gate(vector, interrupt[i]);
 	}
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index c6a5bc7..1e1852c 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1371,7 +1371,7 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
 	irq_enter();
 
 	me = smp_processor_id();
-	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
+	for (vector = IRQ0_VECTOR; vector < NR_VECTORS; vector++) {
 		unsigned int irq;
 		struct irq_desc *desc;
 		struct irq_cfg *cfg;
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 2e4b7a5..6153ae5 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -38,7 +38,7 @@
 #define IRQ_MOVE_CLEANUP_VECTOR	FIRST_EXTERNAL_VECTOR
  
 /*
- * Vectors 0x20-0x2f are used for ISA interrupts.
+ * Vectors 0x30-0x3f are used for ISA interrupts.
  */
 #define IRQ0_VECTOR		FIRST_EXTERNAL_VECTOR + 0x10
 #define IRQ1_VECTOR		IRQ0_VECTOR + 1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
  2007-03-06  7:59 [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30 Yinghai Lu
@ 2007-03-07  3:43 ` Linus Torvalds
  2007-03-07 18:13   ` Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2007-03-07  3:43 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: ebiederm, Andrew Morton, linux-kernel, Ingo Molnar, Andi Kleen



On Mon, 5 Mar 2007, Yinghai Lu wrote:
>
> please check the patch

Hmm.. It doesn't look *wrong*, but could you please

 - split it up a bit (some of it is 100% obvious, ie the comment fixes)

 - write an explanation for the individually split up patches

 - not use attachments, but just make it inline. It's practically 
   impossible to reply and quote part of the patch now.

Eric/Ingo - did you go through and check the patch?

Thanks,

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
  2007-03-07  3:43 ` Linus Torvalds
@ 2007-03-07 18:13   ` Eric W. Biederman
  2007-03-29  4:48     ` Yinghai Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Eric W. Biederman @ 2007-03-07 18:13 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Yinghai Lu, Andrew Morton, linux-kernel, Ingo Molnar, Andi Kleen

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Mon, 5 Mar 2007, Yinghai Lu wrote:
>>
>> please check the patch
>
> Hmm.. It doesn't look *wrong*, but could you please
>
>  - split it up a bit (some of it is 100% obvious, ie the comment fixes)
>
>  - write an explanation for the individually split up patches
>
>  - not use attachments, but just make it inline. It's practically 
>    impossible to reply and quote part of the patch now.
>
> Eric/Ingo - did you go through and check the patch?

This patch will probably work but I'm against it, as is.

The comment fixes or some variation on them are needed.

But code that assumes we place IRQ0 at a particular place isn't
exactly bad but it is brittle.  If we are to reduce our array size
we can also shave a lot of entries off the top because we mostly use
the high end of the vector range for IPI's.

So if we were to introduce some set of defines of exactly which
vectors we can use and do a thorough job of this I think there may
be something reasonable we can do here.

Unless this makes the code clearer I don't think there is much point
in reducing a fixed sized array from 224 entries to 191 entries, and
it has the potential to make this much less pleasant if we goof up
elsewhere.

Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
  2007-03-07 18:13   ` Eric W. Biederman
@ 2007-03-29  4:48     ` Yinghai Lu
  2007-03-29  5:10       ` Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Yinghai Lu @ 2007-03-29  4:48 UTC (permalink / raw)
  To: Eric W. Biederman, Andrew Morton
  Cc: Linus Torvalds, linux-kernel, Ingo Molnar, Andi Kleen

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

On 3/7/07, Eric W. Biederman <ebiederm@xmission.com> wrote:
> The comment fixes or some variation on them are needed.

Please check the patch about comment.

YH

[-- Attachment #2: 3x_irq_20_30.patch --]
[-- Type: text/x-patch, Size: 1990 bytes --]

[PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30

FIRST_EXTERNAL_VECTOR is used for IRQ_MOVE_CLEANUP_VECTOR, and IRQ0 starting from FIRST_EXTERNAL_VECTOR + 0x10.

Signed-off-by: Yinghai Lu <yinghai.lu@amd.com>

diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 21d95b7..4894266 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -45,7 +45,7 @@
 
 /*
  * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
- * (these are usually mapped to vectors 0x20-0x2f)
+ * (these are usually mapped to vectors 0x30-0x3f)
  */
 
 /*
@@ -299,7 +299,7 @@ void init_8259A(int auto_eoi)
 	 * outb_p - this has to work on a wide range of PC hardware.
 	 */
 	outb_p(0x11, 0x20);	/* ICW1: select 8259A-1 init */
-	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */
+	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */
 	outb_p(0x04, 0x21);	/* 8259A-1 (the master) has a slave on IR2 */
 	if (auto_eoi)
 		outb_p(0x03, 0x21);	/* master does Auto EOI */
@@ -307,7 +307,7 @@ void init_8259A(int auto_eoi)
 		outb_p(0x01, 0x21);	/* master expects normal EOI */
 
 	outb_p(0x11, 0xA0);	/* ICW1: select 8259A-2 init */
-	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */
+	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x38-0x3f */
 	outb_p(0x02, 0xA1);	/* 8259A-2 is a slave on master's IR2 */
 	outb_p(0x01, 0xA1);	/* (slave's support for AEOI in flat mode
 				    is to be investigated) */
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 2e4b7a5..6153ae5 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -38,7 +38,7 @@
 #define IRQ_MOVE_CLEANUP_VECTOR	FIRST_EXTERNAL_VECTOR
  
 /*
- * Vectors 0x20-0x2f are used for ISA interrupts.
+ * Vectors 0x30-0x3f are used for ISA interrupts.
  */
 #define IRQ0_VECTOR		FIRST_EXTERNAL_VECTOR + 0x10
 #define IRQ1_VECTOR		IRQ0_VECTOR + 1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
  2007-03-29  4:48     ` Yinghai Lu
@ 2007-03-29  5:10       ` Eric W. Biederman
  2007-03-29 10:13         ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric W. Biederman @ 2007-03-29  5:10 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Andrew Morton, Linus Torvalds, linux-kernel, Ingo Molnar,
	Andi Kleen

"Yinghai Lu" <yinghai.lu@amd.com> writes:

> On 3/7/07, Eric W. Biederman <ebiederm@xmission.com> wrote:
>> The comment fixes or some variation on them are needed.
>
> Please check the patch about comment.
>
> YH
>

Looks good to me.  I've cleaned up the description and placed the patch inline
for easier consumption.  Everything this patch touches is a comment.  So
it is as safe as they come.  And the patch appears to apply to the Linus's
latest tree.

---
From: Yinghai Lu <yinghai.lu@amd.com>
Subject: x86_64 irq: Fix comments after changing IRQ0_VECTOR from 0x20 to 0x30

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Yinghai Lu <yinghai.lu@amd.com>

diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 21d95b7..4894266 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -45,7 +45,7 @@
 
 /*
  * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
- * (these are usually mapped to vectors 0x20-0x2f)
+ * (these are usually mapped to vectors 0x30-0x3f)
  */
 
 /*
@@ -299,7 +299,7 @@ void init_8259A(int auto_eoi)
 	 * outb_p - this has to work on a wide range of PC hardware.
 	 */
 	outb_p(0x11, 0x20);	/* ICW1: select 8259A-1 init */
-	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */
+	outb_p(IRQ0_VECTOR, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */
 	outb_p(0x04, 0x21);	/* 8259A-1 (the master) has a slave on IR2 */
 	if (auto_eoi)
 		outb_p(0x03, 0x21);	/* master does Auto EOI */
@@ -307,7 +307,7 @@ void init_8259A(int auto_eoi)
 		outb_p(0x01, 0x21);	/* master expects normal EOI */
 
 	outb_p(0x11, 0xA0);	/* ICW1: select 8259A-2 init */
-	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */
+	outb_p(IRQ8_VECTOR, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x38-0x3f */
 	outb_p(0x02, 0xA1);	/* 8259A-2 is a slave on master's IR2 */
 	outb_p(0x01, 0xA1);	/* (slave's support for AEOI in flat mode
 				    is to be investigated) */
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 2e4b7a5..6153ae5 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -38,7 +38,7 @@
 #define IRQ_MOVE_CLEANUP_VECTOR	FIRST_EXTERNAL_VECTOR
  
 /*
- * Vectors 0x20-0x2f are used for ISA interrupts.
+ * Vectors 0x30-0x3f are used for ISA interrupts.
  */
 #define IRQ0_VECTOR		FIRST_EXTERNAL_VECTOR + 0x10
 #define IRQ1_VECTOR		IRQ0_VECTOR + 1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30
  2007-03-29  5:10       ` Eric W. Biederman
@ 2007-03-29 10:13         ` Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2007-03-29 10:13 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Yinghai Lu, Andrew Morton, Linus Torvalds, linux-kernel,
	Ingo Molnar


> ---
> From: Yinghai Lu <yinghai.lu@amd.com>
> Subject: x86_64 irq: Fix comments after changing IRQ0_VECTOR from 0x20 to 0x30

applied thanks

-Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-29 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06  7:59 [PATCH] x86_64 irq: keep consistent for changing IRQ0_VECTOR from 0x20 to 0x30 Yinghai Lu
2007-03-07  3:43 ` Linus Torvalds
2007-03-07 18:13   ` Eric W. Biederman
2007-03-29  4:48     ` Yinghai Lu
2007-03-29  5:10       ` Eric W. Biederman
2007-03-29 10:13         ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox