From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925AbdH2LVB (ORCPT ); Tue, 29 Aug 2017 07:21:01 -0400 Received: from terminus.zytor.com ([65.50.211.136]:50581 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbdH2LU7 (ORCPT ); Tue, 29 Aug 2017 07:20:59 -0400 Date: Tue, 29 Aug 2017 04:15:10 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, rostedt@goodmis.org, mingo@kernel.org, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, torvalds@linux-foundation.org, peterz@infradead.org, jpoimboe@redhat.com, luto@kernel.org, brgerst@gmail.com, hpa@zytor.com, bp@alien8.de Reply-To: dvlasenk@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, rostedt@goodmis.org, tglx@linutronix.de, torvalds@linux-foundation.org, jpoimboe@redhat.com, peterz@infradead.org, bp@alien8.de, hpa@zytor.com, brgerst@gmail.com, luto@kernel.org In-Reply-To: <20170828064958.367081121@linutronix.de> References: <20170828064958.367081121@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/idt: Create file for IDT related code Git-Commit-ID: d8ed9d48266a27ab02a4bbcb81e755d63aec108a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d8ed9d48266a27ab02a4bbcb81e755d63aec108a Gitweb: http://git.kernel.org/tip/d8ed9d48266a27ab02a4bbcb81e755d63aec108a Author: Thomas Gleixner AuthorDate: Mon, 28 Aug 2017 08:47:43 +0200 Committer: Ingo Molnar CommitDate: Tue, 29 Aug 2017 12:07:25 +0200 x86/idt: Create file for IDT related code IDT related code lives scattered around in various places. Create a new source file in arch/x86/kernel/idt.c to hold it. Move the idt_tables and descriptors to it for a start. Follow up patches will gradually move more code over. Signed-off-by: Thomas Gleixner Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/20170828064958.367081121@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/Makefile | 2 +- arch/x86/kernel/cpu/common.c | 9 --------- arch/x86/kernel/idt.c | 26 ++++++++++++++++++++++++++ arch/x86/kernel/traps.c | 6 ------ 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 6ab5fbf..fd0a789 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -42,7 +42,7 @@ CFLAGS_irq.o := -I$(src)/../include/asm/trace obj-y := process_$(BITS).o signal.o obj-$(CONFIG_COMPAT) += signal_compat.o -obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o +obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o obj-y += time.o ioport.o dumpstack.o nmi.o obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o obj-y += setup.o x86_init.o i8259.o irqinit.o jump_label.o diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c8b3987..71ab8a4 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1289,15 +1289,6 @@ static __init int setup_disablecpuid(char *arg) __setup("clearcpuid=", setup_disablecpuid); #ifdef CONFIG_X86_64 -struct desc_ptr idt_descr __ro_after_init = { - .size = NR_VECTORS * 16 - 1, - .address = (unsigned long) idt_table, -}; -const struct desc_ptr debug_idt_descr = { - .size = NR_VECTORS * 16 - 1, - .address = (unsigned long) debug_idt_table, -}; - DEFINE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union) __aligned(PAGE_SIZE) __visible; diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c new file mode 100644 index 0000000..3d19cad --- /dev/null +++ b/arch/x86/kernel/idt.c @@ -0,0 +1,26 @@ +/* + * Interrupt descriptor table related code + * + * This file is licensed under the GPL V2 + */ +#include + +#include + +/* Must be page-aligned because the real IDT is used in a fixmap. */ +gate_desc idt_table[IDT_ENTRIES] __page_aligned_bss; + +#ifdef CONFIG_X86_64 +/* No need to be aligned, but done to keep all IDTs defined the same way. */ +gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss; + +struct desc_ptr idt_descr __ro_after_init = { + .size = IDT_ENTRIES * 16 - 1, + .address = (unsigned long) idt_table, +}; + +const struct desc_ptr debug_idt_descr = { + .size = IDT_ENTRIES * 16 - 1, + .address = (unsigned long) debug_idt_table, +}; +#endif diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 36c5836..41f4cd3 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -65,18 +65,12 @@ #include #include #include - -/* No need to be aligned, but done to keep all IDTs defined the same way. */ -gate_desc debug_idt_table[NR_VECTORS] __page_aligned_bss; #else #include #include #include #endif -/* Must be page-aligned because the real IDT is used in a fixmap. */ -gate_desc idt_table[NR_VECTORS] __page_aligned_bss; - DECLARE_BITMAP(used_vectors, NR_VECTORS); static inline void cond_local_irq_enable(struct pt_regs *regs)