summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-05-28 16:53:18 +0200
committerThomas Gleixner <tglx@linutronix.de>2020-06-11 15:15:25 +0200
commit5a2bafca1b0675a126143eea3610143130347783 (patch)
tree3af6afa5a8d1dab0ebc197dc3ca8bb8ae75656c4 /arch/x86
parentx86/idt: Add comments about early #PF handling (diff)
downloadlinux-5a2bafca1b0675a126143eea3610143130347783.tar.xz
linux-5a2bafca1b0675a126143eea3610143130347783.zip
x86/idt: Use proper constants for table size
Use the actual struct size to calculate the IDT table size instead of hardcoded values. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200528145522.898591501@linutronix.de
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/idt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 5ef82fcf333d..b6e1a87f0822 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -51,6 +51,7 @@ struct idt_data {
#define TSKG(_vector, _gdt) \
G(_vector, NULL, DEFAULT_STACK, GATE_TASK, DPL0, _gdt << 3)
+#define IDT_TABLE_SIZE (IDT_ENTRIES * sizeof(gate_desc))
static bool idt_setup_done __initdata;
@@ -168,7 +169,7 @@ static const __initconst struct idt_data early_pf_idts[] = {
gate_desc idt_table[IDT_ENTRIES] __page_aligned_bss;
struct desc_ptr idt_descr __ro_after_init = {
- .size = (IDT_ENTRIES * 2 * sizeof(unsigned long)) - 1,
+ .size = IDT_TABLE_SIZE - 1,
.address = (unsigned long) idt_table,
};