Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1526e2c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Remove stack unwinder for now



It has caused more problems than it ever really solved, and is
apparently not getting cleaned up and fixed.  We can put it back when
it's stable and isn't likely to make warning or bug events worse.

In the meantime, enable frame pointers for more readable stack traces.

Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d1998ef3
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -496,11 +496,6 @@ else
CFLAGS		+= -fomit-frame-pointer
endif

ifdef CONFIG_UNWIND_INFO
CFLAGS		+= -fasynchronous-unwind-tables
LDFLAGS_vmlinux	+= --eh-frame-hdr
endif

ifdef CONFIG_DEBUG_INFO
CFLAGS		+= -g
endif
+0 −2
Original line number Diff line number Diff line
@@ -1493,8 +1493,6 @@ CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_FRAME_POINTER is not set
CONFIG_UNWIND_INFO=y
CONFIG_STACK_UNWIND=y
# CONFIG_FORCED_INLINING is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_RCU_TORTURE_TEST is not set
+0 −32
Original line number Diff line number Diff line
@@ -979,38 +979,6 @@ ENTRY(spurious_interrupt_bug)
	jmp error_code
	CFI_ENDPROC

#ifdef CONFIG_STACK_UNWIND
ENTRY(arch_unwind_init_running)
	CFI_STARTPROC
	movl	4(%esp), %edx
	movl	(%esp), %ecx
	leal	4(%esp), %eax
	movl	%ebx, PT_EBX(%edx)
	xorl	%ebx, %ebx
	movl	%ebx, PT_ECX(%edx)
	movl	%ebx, PT_EDX(%edx)
	movl	%esi, PT_ESI(%edx)
	movl	%edi, PT_EDI(%edx)
	movl	%ebp, PT_EBP(%edx)
	movl	%ebx, PT_EAX(%edx)
	movl	$__USER_DS, PT_DS(%edx)
	movl	$__USER_DS, PT_ES(%edx)
	movl	$0, PT_GS(%edx)
	movl	%ebx, PT_ORIG_EAX(%edx)
	movl	%ecx, PT_EIP(%edx)
	movl	12(%esp), %ecx
	movl	$__KERNEL_CS, PT_CS(%edx)
	movl	%ebx, PT_EFLAGS(%edx)
	movl	%eax, PT_OLDESP(%edx)
	movl	8(%esp), %eax
	movl	%ecx, 8(%esp)
	movl	PT_EBX(%edx), %ebx
	movl	$__KERNEL_DS, PT_OLDSS(%edx)
	jmpl	*%eax
	CFI_ENDPROC
ENDPROC(arch_unwind_init_running)
#endif

ENTRY(kernel_thread_helper)
	pushl $0		# fake return address for unwinder
	CFI_STARTPROC
+0 −83
Original line number Diff line number Diff line
@@ -94,11 +94,6 @@ asmlinkage void spurious_interrupt_bug(void);
asmlinkage void machine_check(void);

int kstack_depth_to_print = 24;
#ifdef CONFIG_STACK_UNWIND
static int call_trace = 1;
#else
#define call_trace (-1)
#endif
ATOMIC_NOTIFIER_HEAD(i386die_chain);

int register_die_notifier(struct notifier_block *nb)
@@ -152,33 +147,6 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
	return ebp;
}

struct ops_and_data {
	struct stacktrace_ops *ops;
	void *data;
};

static asmlinkage int
dump_trace_unwind(struct unwind_frame_info *info, void *data)
{
	struct ops_and_data *oad = (struct ops_and_data *)data;
	int n = 0;
	unsigned long sp = UNW_SP(info);

	if (arch_unw_user_mode(info))
		return -1;
	while (unwind(info) == 0 && UNW_PC(info)) {
		n++;
		oad->ops->address(oad->data, UNW_PC(info));
		if (arch_unw_user_mode(info))
			break;
		if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1))
		    && sp > UNW_SP(info))
			break;
		sp = UNW_SP(info);
	}
	return n;
}

#define MSG(msg) ops->warning(data, msg)

void dump_trace(struct task_struct *task, struct pt_regs *regs,
@@ -190,41 +158,6 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
	if (!task)
		task = current;

	if (call_trace >= 0) {
		int unw_ret = 0;
		struct unwind_frame_info info;
		struct ops_and_data oad = { .ops = ops, .data = data };

		if (regs) {
			if (unwind_init_frame_info(&info, task, regs) == 0)
				unw_ret = dump_trace_unwind(&info, &oad);
		} else if (task == current)
			unw_ret = unwind_init_running(&info, dump_trace_unwind,
						      &oad);
		else {
			if (unwind_init_blocked(&info, task) == 0)
				unw_ret = dump_trace_unwind(&info, &oad);
		}
		if (unw_ret > 0) {
			if (call_trace == 1 && !arch_unw_user_mode(&info)) {
				ops->warning_symbol(data,
					     "DWARF2 unwinder stuck at %s",
					     UNW_PC(&info));
				if (UNW_SP(&info) >= PAGE_OFFSET) {
					MSG("Leftover inexact backtrace:");
					stack = (void *)UNW_SP(&info);
					if (!stack)
						return;
					ebp = UNW_FP(&info);
				} else
					MSG("Full inexact backtrace again:");
			} else if (call_trace >= 1)
				return;
			else
				MSG("Full inexact backtrace again:");
		} else
			MSG("Inexact backtrace:");
	}
	if (!stack) {
		unsigned long dummy;
		stack = &dummy;
@@ -1258,19 +1191,3 @@ static int __init kstack_setup(char *s)
	return 1;
}
__setup("kstack=", kstack_setup);

#ifdef CONFIG_STACK_UNWIND
static int __init call_trace_setup(char *s)
{
	if (strcmp(s, "old") == 0)
		call_trace = -1;
	else if (strcmp(s, "both") == 0)
		call_trace = 0;
	else if (strcmp(s, "newfallback") == 0)
		call_trace = 1;
	else if (strcmp(s, "new") == 2)
		call_trace = 2;
	return 1;
}
__setup("call_trace=", call_trace_setup);
#endif
+0 −2
Original line number Diff line number Diff line
@@ -45,9 +45,7 @@ cflags-kernel-$(CONFIG_REORDER) += -ffunction-sections
# actually it makes the kernel smaller too.
cflags-y += -fno-reorder-blocks
cflags-y += -Wno-sign-compare
ifneq ($(CONFIG_UNWIND_INFO),y)
cflags-y += -fno-asynchronous-unwind-tables
endif
ifneq ($(CONFIG_DEBUG_INFO),y)
# -fweb shrinks the kernel a bit, but the difference is very small
# it also messes up debugging, so don't use it for now.
Loading