hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/x86/kernel/dumpstack_32.c
....@@ -29,19 +29,22 @@
2929 if (type == STACK_TYPE_ENTRY)
3030 return "ENTRY_TRAMPOLINE";
3131
32
+ if (type == STACK_TYPE_EXCEPTION)
33
+ return "#DF";
34
+
3235 return NULL;
3336 }
3437
3538 static bool in_hardirq_stack(unsigned long *stack, struct stack_info *info)
3639 {
37
- unsigned long *begin = (unsigned long *)this_cpu_read(hardirq_stack);
40
+ unsigned long *begin = (unsigned long *)this_cpu_read(hardirq_stack_ptr);
3841 unsigned long *end = begin + (THREAD_SIZE / sizeof(long));
3942
4043 /*
4144 * This is a software stack, so 'end' can be a valid stack pointer.
4245 * It just means the stack is empty.
4346 */
44
- if (stack <= begin || stack > end)
47
+ if (stack < begin || stack > end)
4548 return false;
4649
4750 info->type = STACK_TYPE_IRQ;
....@@ -59,14 +62,14 @@
5962
6063 static bool in_softirq_stack(unsigned long *stack, struct stack_info *info)
6164 {
62
- unsigned long *begin = (unsigned long *)this_cpu_read(softirq_stack);
65
+ unsigned long *begin = (unsigned long *)this_cpu_read(softirq_stack_ptr);
6366 unsigned long *end = begin + (THREAD_SIZE / sizeof(long));
6467
6568 /*
6669 * This is a software stack, so 'end' can be a valid stack pointer.
6770 * It just means the stack is empty.
6871 */
69
- if (stack <= begin || stack > end)
72
+ if (stack < begin || stack > end)
7073 return false;
7174
7275 info->type = STACK_TYPE_SOFTIRQ;
....@@ -81,6 +84,26 @@
8184
8285 return true;
8386 }
87
+
88
+static bool in_doublefault_stack(unsigned long *stack, struct stack_info *info)
89
+{
90
+ struct cpu_entry_area *cea = get_cpu_entry_area(raw_smp_processor_id());
91
+ struct doublefault_stack *ss = &cea->doublefault_stack;
92
+
93
+ void *begin = ss->stack;
94
+ void *end = begin + sizeof(ss->stack);
95
+
96
+ if ((void *)stack < begin || (void *)stack >= end)
97
+ return false;
98
+
99
+ info->type = STACK_TYPE_EXCEPTION;
100
+ info->begin = begin;
101
+ info->end = end;
102
+ info->next_sp = (unsigned long *)this_cpu_read(cpu_tss_rw.x86_tss.sp);
103
+
104
+ return true;
105
+}
106
+
84107
85108 int get_stack_info(unsigned long *stack, struct task_struct *task,
86109 struct stack_info *info, unsigned long *visit_mask)
....@@ -105,6 +128,9 @@
105128 if (in_softirq_stack(stack, info))
106129 goto recursion_check;
107130
131
+ if (in_doublefault_stack(stack, info))
132
+ goto recursion_check;
133
+
108134 goto unknown;
109135
110136 recursion_check: