Skip to content

Commit

Permalink
x86/idt: remove address argument to idt_invalidate()
Browse files Browse the repository at this point in the history
There is no reason to specify any specific address to
idt_invalidate(). It looks mostly like an artifact of unifying code
done differently by accident.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
  • Loading branch information
H. Peter Anvin (Intel) authored and intel-lab-lkp committed May 11, 2021
1 parent 49f67af commit c9c68d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/desc.h
Expand Up @@ -427,6 +427,6 @@ static inline void idt_setup_early_pf(void) { }
static inline void idt_setup_ist_traps(void) { }
#endif

extern void idt_invalidate(void *addr);
extern void idt_invalidate(void);

#endif /* _ASM_X86_DESC_H */
5 changes: 2 additions & 3 deletions arch/x86/kernel/idt.c
Expand Up @@ -331,11 +331,10 @@ void __init idt_setup_early_handler(void)

/**
* idt_invalidate - Invalidate interrupt descriptor table
* @addr: The virtual address of the 'invalid' IDT
*/
void idt_invalidate(void *addr)
void idt_invalidate(void)
{
struct desc_ptr idt = { .address = (unsigned long) addr, .size = 0 };
struct desc_ptr idt = { .address = 0, .size = 0 };

load_idt(&idt);
}
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/machine_kexec_32.c
Expand Up @@ -232,8 +232,8 @@ void machine_kexec(struct kimage *image)
* The gdt & idt are now invalid.
* If you want to load them you must set up your own idt & gdt.
*/
idt_invalidate(phys_to_virt(0));
set_gdt(phys_to_virt(0), 0);
idt_invalidate();
set_gdt(0, 0);

/* now call it */
image->start = relocate_kernel_ptr((unsigned long)image->head,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/reboot.c
Expand Up @@ -669,7 +669,7 @@ static void native_machine_emergency_restart(void)
break;

case BOOT_TRIPLE:
idt_invalidate(NULL);
idt_invalidate();
__asm__ __volatile__("int3");

/* We're probably dead after this, but... */
Expand Down

0 comments on commit c9c68d8

Please sign in to comment.