File tree Expand file tree Collapse file tree 4 files changed +16
-16
lines changed Expand file tree Collapse file tree 4 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -503,4 +503,7 @@ static inline void load_current_idt(void)
503
503
else
504
504
load_idt ((const struct desc_ptr * )& idt_descr );
505
505
}
506
+
507
+ extern void idt_invalidate (void * addr );
508
+
506
509
#endif /* _ASM_X86_DESC_H */
Original file line number Diff line number Diff line change @@ -24,3 +24,14 @@ const struct desc_ptr debug_idt_descr = {
24
24
.address = (unsigned long ) debug_idt_table ,
25
25
};
26
26
#endif
27
+
28
+ /**
29
+ * idt_invalidate - Invalidate interrupt descriptor table
30
+ * @addr: The virtual address of the 'invalid' IDT
31
+ */
32
+ void idt_invalidate (void * addr )
33
+ {
34
+ struct desc_ptr idt = { .address = (unsigned long ) addr , .size = 0 };
35
+
36
+ load_idt (& idt );
37
+ }
Original file line number Diff line number Diff line change 26
26
#include <asm/set_memory.h>
27
27
#include <asm/debugreg.h>
28
28
29
- static void set_idt (void * newidt , __u16 limit )
30
- {
31
- struct desc_ptr curidt ;
32
-
33
- /* ia32 supports unaliged loads & stores */
34
- curidt .size = limit ;
35
- curidt .address = (unsigned long )newidt ;
36
-
37
- load_idt (& curidt );
38
- }
39
-
40
-
41
29
static void set_gdt (void * newgdt , __u16 limit )
42
30
{
43
31
struct desc_ptr curgdt ;
@@ -245,7 +233,7 @@ void machine_kexec(struct kimage *image)
245
233
* If you want to load them you must set up your own idt & gdt.
246
234
*/
247
235
set_gdt (phys_to_virt (0 ), 0 );
248
- set_idt (phys_to_virt (0 ), 0 );
236
+ idt_invalidate (phys_to_virt (0 ));
249
237
250
238
/* now call it */
251
239
image -> start = relocate_kernel_ptr ((unsigned long )image -> head ,
Original file line number Diff line number Diff line change 38
38
void (* pm_power_off )(void );
39
39
EXPORT_SYMBOL (pm_power_off );
40
40
41
- static const struct desc_ptr no_idt = {};
42
-
43
41
/*
44
42
* This is set if we need to go through the 'emergency' path.
45
43
* When machine_emergency_restart() is called, we may be on
@@ -638,7 +636,7 @@ static void native_machine_emergency_restart(void)
638
636
break ;
639
637
640
638
case BOOT_TRIPLE :
641
- load_idt ( & no_idt );
639
+ idt_invalidate ( NULL );
642
640
__asm__ __volatile__("int3" );
643
641
644
642
/* We're probably dead after this, but... */
You can’t perform that action at this time.
0 commit comments