Skip to content

Commit 16bc18d

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
x86/idt: Move 32-bit idt_descr to C code
32-bit kernels have the idt_descr defined in the low level assembly entry code, but there is no good reason for that. Move it into the C file and use the 64-bit version of it. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent d8ed9d4 commit 16bc18d

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

arch/x86/kernel/head_32.S

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ int_msg:
622622

623623
.data
624624
.globl boot_gdt_descr
625-
.globl idt_descr
626625

627626
ALIGN
628627
# early boot GDT descriptor (must use 1:1 address mapping)
@@ -631,11 +630,6 @@ boot_gdt_descr:
631630
.word __BOOT_DS+7
632631
.long boot_gdt - __PAGE_OFFSET
633632

634-
.word 0 # 32-bit align idt_desc.address
635-
idt_descr:
636-
.word IDT_ENTRIES*8-1 # idt contains 256 entries
637-
.long idt_table
638-
639633
# boot GDT descriptor (later on used by CPU#0):
640634
.word 0 # 32 bit align gdt_desc.address
641635
ENTRY(early_gdt_descr)

arch/x86/kernel/idt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
/* Must be page-aligned because the real IDT is used in a fixmap. */
1111
gate_desc idt_table[IDT_ENTRIES] __page_aligned_bss;
1212

13-
#ifdef CONFIG_X86_64
14-
/* No need to be aligned, but done to keep all IDTs defined the same way. */
15-
gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss;
16-
1713
struct desc_ptr idt_descr __ro_after_init = {
18-
.size = IDT_ENTRIES * 16 - 1,
14+
.size = (IDT_ENTRIES * 2 * sizeof(unsigned long)) - 1,
1915
.address = (unsigned long) idt_table,
2016
};
2117

18+
#ifdef CONFIG_X86_64
19+
/* No need to be aligned, but done to keep all IDTs defined the same way. */
20+
gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss;
21+
2222
const struct desc_ptr debug_idt_descr = {
2323
.size = IDT_ENTRIES * 16 - 1,
2424
.address = (unsigned long) debug_idt_table,

0 commit comments

Comments
 (0)