summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/idt.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-08-28 08:47:55 +0200
committerIngo Molnar <mingo@kernel.org>2017-08-29 12:07:28 +0200
commitdc20b2d526539344d7175a2a83221337302596b8 (patch)
treeac6bdf663701c15711e4d9323d72e3c86595d030 /arch/x86/kernel/idt.c
parentx86/idt: Move APIC gate initialization to tables (diff)
downloadlinux-dc20b2d526539344d7175a2a83221337302596b8.tar.xz
linux-dc20b2d526539344d7175a2a83221337302596b8.zip
x86/idt: Move interrupt gate initialization to IDT code
Move the gate intialization from interrupt init to the IDT code so all IDT related operations are at a single place. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20170828064959.340209198@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/idt.c')
-rw-r--r--arch/x86/kernel/idt.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 4327104f5af8..99f93a6fb92a 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -286,7 +286,25 @@ void __init idt_setup_debugidt_traps(void)
*/
void __init idt_setup_apic_and_irq_gates(void)
{
+ int i = FIRST_EXTERNAL_VECTOR;
+ void *entry;
+
idt_setup_from_table(idt_table, apic_idts, ARRAY_SIZE(apic_idts));
+
+ for_each_clear_bit_from(i, used_vectors, FIRST_SYSTEM_VECTOR) {
+ entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
+ set_intr_gate(i, entry);
+ }
+
+ for_each_clear_bit_from(i, used_vectors, NR_VECTORS) {
+#ifdef CONFIG_X86_LOCAL_APIC
+ set_bit(i, used_vectors);
+ set_intr_gate(i, spurious_interrupt);
+#else
+ entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
+ set_intr_gate(i, entry);
+#endif
+ }
}
/**