Skip to contentSkip to conversation

i386 per cpu IDT (2.6.12-rc1-mm1)

PATCH Chuck Ebbert 2 participants 2 messages Sep 27, 2005

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 25 lines · Zwane Mwaikambo
arch/i386/kernel/entry.S 25 Sep 2005 05:15:29 -0000 renamed from arch/i386/kernel/entry.S 24 Sep 2005 18:26:49 -0000 1.1.1.1 +4 -11
@@ -410,27 +410,18 @@ syscall_badsys:
      FIXUP_ESPFIX_STACK \
 28:  popl %eax;
 
-/*
- * Build the entry stubs and pointer table with
- * some assembler magic.
- */
-.data
-ENTRY(interrupt)
-.text
-
+/* Build the IRQ entry stubs */
 vector=0
-ENTRY(irq_entries_start)
+     .align IRQ_STUB_SIZE,0x90
+ENTRY(interrupt)
 .rept NR_IRQS
      ALIGN     <===================================
-1:   pushl $vector-256
+     pushl $vector-0x10000
      jmp common_interrupt
-.data

arch/i386/kernel/entry.S 25 Sep 2005 05:15:29 -0000 syscall_badsys: · line 427

Quoted 10 lines
arch/i386/kernel/entry.S 25 Sep 2005 05:15:29 -0000 renamed from arch/i386/kernel/entry.S 24 Sep 2005 18:26:49 -0000 1.1.1.1 +1 -3
-     .long 1b
-.text
+     .align IRQ_STUB_SIZE,0x90
 vector=vector+1
 .endr
 
-     ALIGN
 common_interrupt:
      SAVE_ALL
      movl %esp,%eax

That ALIGN could cause problems if someone changed default i386 alignment to
something larger than IRQ_STUB_SIZE. Why is it there?

Quoted 23 lines
include/asm-i386/mach-default/irq_vectors_limits.h 25 Sep 2005 05:15:35 -0000 renamed from include/asm-i386/mach-default/irq_vectors_limits.h 24 Sep 2005 18:27:12 -0000 1.1.1.1 +5 -1
@@ -2,11 +2,15 @@
 #define _ASM_IRQ_VECTORS_LIMITS_H
 
 #ifdef CONFIG_PCI_MSI
-#define NR_IRQS FIRST_SYSTEM_VECTOR
+#define NR_IRQS 224
+#define IRQ_STUB_SIZE 16
 #define NR_IRQ_VECTORS NR_IRQS
+#define NR_IRQ_NODES MAX_NUMNODES
 #else
 #ifdef CONFIG_X86_IO_APIC
 #define NR_IRQS 224
+#define IRQ_STUB_SIZE 16
+#define NR_IRQ_NODES MAX_NUMNODES
 # if (224 >= 32 * NR_CPUS)
 # define NR_IRQ_VECTORS NR_IRQS
 # else
@@ -14,8 +18,13 @@
 # endif
 #else
 #define NR_IRQS 16

include/asm-i386/mach-default/irq_vectors_limits.h 25 Sep 2005 05:15:35 -0000 line 30

Quoted 10 lines
include/asm-i386/mach-default/irq_vectors_limits.h 25 Sep 2005 05:15:35 -0000 renamed from include/asm-i386/mach-default/irq_vectors_limits.h 24 Sep 2005 18:27:12 -0000 1.1.1.1 +5 -0
+#define IRQ_STUB_SIZE 16        <=================================
+#define NR_IRQ_NODES 1
 #define NR_IRQ_VECTORS NR_IRQS
 #endif
 #endif
 
+/* number of vectors available for external interrupts in Linux */
+#define NR_DEVICE_VECTORS    190
+
 #endif /* _ASM_IRQ_VECTORS_LIMITS_H */

Can't these be 8 bytes when there are only 16 IRQs?

And is there any way to special-case kernels built with max of two CPUs so there are
only 24 IRQs allocated? That seems to be the maximum for that case.

__
Chuck

#1 lore raw

Hello Chuck,

Quoted 11 lines · Chuck Ebbert

In-Reply-To: <[email protected]>

Review

Quoted 7 lines
(quoted diff) +3 -1
+/* Build the IRQ entry stubs */
 vector=0
-ENTRY(irq_entries_start)
+     .align IRQ_STUB_SIZE,0x90
+ENTRY(interrupt)
 .rept NR_IRQS
      ALIGN     <===================================

That ALIGN could cause problems if someone changed default i386 alignment to
something larger than IRQ_STUB_SIZE. Why is it there?

Yep, that's dead code and should go.

Quoted 6 lines
Quoted 6 lines
(quoted diff) +2 -0
+#define IRQ_STUB_SIZE 16        <=================================
+#define NR_IRQ_NODES 1
 #define NR_IRQ_VECTORS NR_IRQS
 #endif
 #endif
Quoted 6 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+/* number of vectors available for external interrupts in Linux */
+#define NR_DEVICE_VECTORS    190
+
 #endif /* _ASM_IRQ_VECTORS_LIMITS_H */

Can't these be 8 bytes when there are only 16 IRQs?

It actually should be constant regardless of IRQ count since it's used to provide a 'size' for the code (since it's indexed via C and an array).

Quoted 2 lines

And is there any way to special-case kernels built with max of two CPUs so there are
only 24 IRQs allocated? That seems to be the maximum for that case.

My 2 processor Xeon(HT) has 3 IOAPICs and currently has IRQ48 in use;

CPU0 CPU1 CPU2 CPU3

  0:   30914980   30909270   30971083   30937399    IO-APIC-edge  timer
  1:      85361      88979      71974     119655    IO-APIC-edge  i8042
  8:      15080      10142      18495      20252    IO-APIC-edge  rtc
  9:          0          0          0          0   IO-APIC-level  acpi
 12:     559735     572493     467452     687913    IO-APIC-edge  i8042
 14:    3921063    2503225     767373    5974789    IO-APIC-edge  ide0
 15:     959112     612792     354578    1413090    IO-APIC-edge  ide1
 16:        657       2755        611       3090   IO-APIC-level  uhci_hcd
 19:    1088213   26750060    1845615       4948   IO-APIC-level  uhci_hcd, eth0
 20:      69658      19831     472397      55840   IO-APIC-level  eth3
 22:     239568     115070      53537     307576   IO-APIC-level  ide2, ide3
 23:      19206      70661      46499     481665   IO-APIC-level  eth4
 24:       1247      99474      43945     517674   IO-APIC-level  eth1
 28:    3950153    1827325    3359121    2111991   IO-APIC-level  EMU10K1
 48:     129473          0     616272      37889   IO-APIC-level  eth2

Thanks for all the feedback, i'll incorporate your suggestions.

Zwane