linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] x86/idt: Simplify the idt_setup_apic_and_irq_gates()
@ 2018-05-23  2:35 Dou Liyang
  2018-06-06 11:43 ` [tip:x86/urgent] " tip-bot for Dou Liyang
  0 siblings, 1 reply; 2+ messages in thread
From: Dou Liyang @ 2018-05-23  2:35 UTC (permalink / raw)
  To: linux-kernel, x86; +Cc: tglx, Dou Liyang

The idt_setup_apic_and_irq_gates() sets the gates from
FIRST_EXTERNAL_VECTOR up to FIRST_SYSTEM_VECTOR first. then secondly,
from FIRST_SYSTEM_VECTOR to NR_VECTORS, it takes both APIC=y and APIC=n
into account.

But for APIC=n, the FIRST_SYSTEM_VECTOR is equal to NR_VECTORS, all
vectors has been set at the first step.

Simplify the second step, make it just work for APIC=y.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/idt.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 2c3a1b4294eb..74383a3780dc 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -317,15 +317,12 @@ void __init idt_setup_apic_and_irq_gates(void)
 		set_intr_gate(i, entry);
 	}
 
-	for_each_clear_bit_from(i, system_vectors, NR_VECTORS) {
 #ifdef CONFIG_X86_LOCAL_APIC
+	for_each_clear_bit_from(i, system_vectors, NR_VECTORS) {
 		set_bit(i, system_vectors);
 		set_intr_gate(i, spurious_interrupt);
-#else
-		entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
-		set_intr_gate(i, entry);
-#endif
 	}
+#endif
 }
 
 /**
-- 
2.14.3

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

* [tip:x86/urgent] x86/idt: Simplify the idt_setup_apic_and_irq_gates()
  2018-05-23  2:35 [PATCH v2] x86/idt: Simplify the idt_setup_apic_and_irq_gates() Dou Liyang
@ 2018-06-06 11:43 ` tip-bot for Dou Liyang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Dou Liyang @ 2018-06-06 11:43 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: douly.fnst, tglx, linux-kernel, hpa, mingo

Commit-ID:  336628128826a9acb045571a960e32e4414ccb61
Gitweb:     https://git.kernel.org/tip/336628128826a9acb045571a960e32e4414ccb61
Author:     Dou Liyang <douly.fnst@cn.fujitsu.com>
AuthorDate: Wed, 23 May 2018 10:35:55 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 6 Jun 2018 13:38:01 +0200

x86/idt: Simplify the idt_setup_apic_and_irq_gates()

The idt_setup_apic_and_irq_gates() sets the gates from
FIRST_EXTERNAL_VECTOR up to FIRST_SYSTEM_VECTOR first. then secondly, from
FIRST_SYSTEM_VECTOR to NR_VECTORS, it takes both APIC=y and APIC=n into
account.

But for APIC=n, the FIRST_SYSTEM_VECTOR is equal to NR_VECTORS, all
vectors has been set at the first step.

Simplify the second step, make it just work for APIC=y.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20180523023555.2933-1-douly.fnst@cn.fujitsu.com

---
 arch/x86/kernel/idt.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 2c3a1b4294eb..74383a3780dc 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -317,15 +317,12 @@ void __init idt_setup_apic_and_irq_gates(void)
 		set_intr_gate(i, entry);
 	}
 
-	for_each_clear_bit_from(i, system_vectors, NR_VECTORS) {
 #ifdef CONFIG_X86_LOCAL_APIC
+	for_each_clear_bit_from(i, system_vectors, NR_VECTORS) {
 		set_bit(i, system_vectors);
 		set_intr_gate(i, spurious_interrupt);
-#else
-		entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
-		set_intr_gate(i, entry);
-#endif
 	}
+#endif
 }
 
 /**

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

end of thread, other threads:[~2018-06-06 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23  2:35 [PATCH v2] x86/idt: Simplify the idt_setup_apic_and_irq_gates() Dou Liyang
2018-06-06 11:43 ` [tip:x86/urgent] " tip-bot for Dou Liyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).