File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 1717
1818static volatile int int_handler_executed ;
1919
20+ extern uint8_t _nmi_stack [];
21+ extern uint8_t _nmi_stack1 [];
22+ extern uint8_t _nmi_stack2 [];
23+ extern uint8_t _nmi_stack3 [];
24+
25+ uint8_t * nmi_stacks [] = {
26+ _nmi_stack ,
27+ #if CONFIG_MP_NUM_CPUS > 1
28+ _nmi_stack1 ,
29+ #if CONFIG_MP_NUM_CPUS > 2
30+ _nmi_stack2 ,
31+ #if CONFIG_MP_NUM_CPUS > 3
32+ _nmi_stack3
33+ #endif
34+ #endif
35+ #endif
36+ };
37+
2038bool z_x86_do_kernel_nmi (const z_arch_esf_t * esf )
2139{
40+ uint64_t stack ;
41+
42+ _get_esp (stack );
43+
44+ TC_PRINT ("ESP: 0x%llx CPU %d nmi_stack %p\n" , stack ,
45+ arch_curr_cpu ()-> id , nmi_stacks [arch_curr_cpu ()-> id ]);
46+
47+ zassert_true (stack > (uint64_t )nmi_stacks [arch_curr_cpu ()-> id ] &&
48+ stack < (uint64_t )nmi_stacks [arch_curr_cpu ()-> id ] +
49+ CONFIG_X86_EXCEPTION_STACK_SIZE , "Incorrect stack" );
50+
2251 int_handler_executed ++ ;
2352
2453 return true;
Original file line number Diff line number Diff line change 1515
1616#define _trigger_isr_handler (irq ) __asm__ volatile("int %0" : : "i" (irq) : "memory")
1717
18+ #define _get_esp (x ) __asm__("movq %%rsp, %0" : "=r" (x))
19+
1820#endif /* _TEST_ASM_INLINE_GCC_H */
Original file line number Diff line number Diff line change 1+ common :
2+ arch_allow : x86
3+ filter : CONFIG_X86_64
4+ tags : interrupt nmi
15tests :
26 arch.interrupt.nmi :
3- arch_allow : x86
4- platform_allow : qemu_x86_64
5- tags : interrupt
7+ extra_configs :
8+ - CONFIG_USERSPACE=n
9+ arch.interrupt.nmi.kpti :
10+ extra_configs :
11+ - CONFIG_USERSPACE=y
You can’t perform that action at this time.
0 commit comments