Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp112384imm; Tue, 21 Aug 2018 15:41:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwL8S+ha6A71Bv8qXUTn3WW6ByzE3z4lDjmkfvSlFAHHWJbxYLO1bi8JeHCMbb2N4hCywG8 X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr48597814pgh.28.1534891289688; Tue, 21 Aug 2018 15:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534891289; cv=none; d=google.com; s=arc-20160816; b=J4gCJuN/UfU+/HIa842IjUy/rQKkYMi4aG/yC8eY6ZSKMJ1dcTwLt1aXINidguG1vh 1xM67QlI1Sg+Pl1xTJyOHOfizqI9nmzJASUioejs0Qhwc5Rgsyu2BiAKJjbJkBx/q0LQ +4XobhFe3zdYxYLeSVtqqgV8soC7mWoXHYAH8aC+4Wuhi7+zdkT8NYjGRD07DG0yJ3u/ tD74WJ1alYOysOCkmpX78KVoRSpL5yCzFkNBMbZGNL43yXJUIWh0Wsro6Ajae4QlMsda m3VM6bixC7COq/FEeW5pP4VFRgVWmHiV9nUccFl5opOqexsgCpc7OloloRqivosKBYIa 7Ozg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=V5ZO0llhBh0dA5CGb2xhgUiVajwNN5XqLN9q2GxvKcU=; b=jcF/zPmt/Nr5FFDAj0jibHJnjVKOXYajxQSkFC9YzVh1Z+ReaKN+4ruJpltgI6euC2 75bda4CmzDs4YjSrM5o639VWOX5xxzwVMjZBEoDHmlZnczcXP5WeV+OyCtbf36Sta1FV d71eDkKvyY6r1sqer8wByBnMJeg5FOSp+0xsrhfSt1uRfxysnwmfMBMyTsSdY3icDXYQ ZkWtumS71FsaoCindrfswpIRg91e+yrsVtUu7dYMUgQEzfY973khXFYsNVcB4cA8G2tQ MxoQ87m1Sv9fb6Q8MEeqHgWCbPgMiflGaCvdc2WRBMy1PWdRDwrxNspi7ZLPlBmSxZEa IF7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=qNjE3USb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14-v6si13321367pgg.345.2018.08.21.15.41.14; Tue, 21 Aug 2018 15:41:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=qNjE3USb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbeHVBq0 (ORCPT + 99 others); Tue, 21 Aug 2018 21:46:26 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:33408 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbeHVBq0 (ORCPT ); Tue, 21 Aug 2018 21:46:26 -0400 Received: from trochilidae.lan (unknown [37.17.239.3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0C9515C054A; Wed, 22 Aug 2018 00:24:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1534890260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=V5ZO0llhBh0dA5CGb2xhgUiVajwNN5XqLN9q2GxvKcU=; b=qNjE3USbU0mmRpPAYRT7K5Myqf0KSW7xk91giWtIxo5zzjjn/r/vtcOntCk0gHFMczJw6g Dk900nDA8FErtRG9UX9hu7yEsJ6gOellGqFOUP9Icgk+e283zphEAEYERunrwSRsD++pZK 39vbh2jCbeTz1cKT06WC8YKtXqpFcPQ= From: Stefan Agner To: linux@armlinux.org.uk, arnd@arndb.de Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] ARM: use choice for kernel unwinders Date: Wed, 22 Aug 2018 00:24:16 +0200 Message-Id: <20180821222416.7771-1-stefan@agner.ch> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While in theory multiple unwinders could be compiled in, it does not make sense in practise. Use a choice to make the unwinder selection mutually exclusive and mandatory. Already before this commit it has not been possible to deselect FRAME_POINTER. Remove the obsolete comment. Furthermore, to produce a meaningful backtrace with FRAME_POINTER enabled the kernel needs a specific function prologue: mov ip, sp stmfd sp!, {fp, ip, lr, pc} sub fp, ip, #4 To get to the required prologue gcc uses apcs and no-sched-prolog. This compiler options are not available on clang, and clang is not able to generate the required prologue. Make the FRAME_POINTER config symbol depending on !clang. Suggested-by: Arnd Bergmann Signed-off-by: Stefan Agner --- arch/arm/Kconfig.debug | 43 ++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 693f84392f1b..ba09e744384a 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -48,30 +48,41 @@ config DEBUG_WX If in doubt, say "Y". -# RMK wants arm kernels compiled with frame pointers or stack unwinding. -# If you know what you are doing and are willing to live without stack -# traces, you can get a slightly smaller kernel by setting this option to -# n, but then RMK will have to kill you ;). -config FRAME_POINTER - bool - depends on !THUMB2_KERNEL - default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER +choice + prompt "Choose kernel unwinder" + default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER + default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER + help + This determines which method will be used for unwinding kernel stack + traces for panics, oopses, bugs, warnings, perf, /proc//stack, + livepatch, lockdep, and more. + +config UNWINDER_FRAME_POINTER + bool "Frame pointer unwinder" + depends on !THUMB2_KERNEL && !CC_IS_CLANG + select FRAME_POINTER help - If you say N here, the resulting kernel will be slightly smaller and - faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled, - when a problem occurs with the kernel, the information that is - reported is severely limited. + This option enables the frame pointer unwinder for unwinding + kernel stack traces. -config ARM_UNWIND - bool "Enable stack unwinding support (EXPERIMENTAL)" +config UNWINDER_ARM + bool "ARM EABI stack unwinder" depends on AEABI - default y + select ARM_UNWIND help This option enables stack unwinding support in the kernel using the information automatically generated by the compiler. The resulting kernel image is slightly bigger but the performance is not affected. Currently, this feature - only works with EABI compilers. If unsure say Y. + only works with EABI compilers. + +endchoice + +config ARM_UNWIND + bool + +config FRAME_POINTER + bool config OLD_MCOUNT bool -- 2.18.0