Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp531383imm; Wed, 22 Aug 2018 08:17:28 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwy++569ahGzmNeB1lfCFwR0euVn5EOH5+NBhnTIveDAwU6jiS1kLhV7EW9ANq4k4iPSZxw X-Received: by 2002:a17:902:4203:: with SMTP id g3-v6mr55285467pld.30.1534951048512; Wed, 22 Aug 2018 08:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534951048; cv=none; d=google.com; s=arc-20160816; b=QM5JkJzswwDLHDnuvO5C2duDMBFNaagG7PMBJSMeajckYh+D9Jv+2aeeD3HBc4X+bh 9zb2/OaC/pBnLLJs9oOPjO0BTpcjlArvHdm4Fya+Xgt2TJF1EH1K4ir+Yltt4hgP4ugM 6a+u3MhnkEJBmU1gxJQ2OUY+dAD/7VDXEtqHl/8CD5BX5g1MzwzQ8V6IrScyTwBJ5XbX CAgXX0VqjwePWPPKoVER7SWHfvQxdX1mcCoZjYIkGNtdLpSM6Pgk7Ydj2EZ63O+PJANY UiBuxqFO5BZUwT5dIaK9mNInjK7/PiSHPQVuuvjFlW4N3GKpL0LK5ZmOnwkw5yLKmudG k08A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=8FnfFr+Jm8bK9K32WfB8TUr6ib203wdkLbOcxKK71+I=; b=iBZZUtaz434BX1lsKM+4bRTVA9kKQzXmZMJYY+WVeQm5ttRLu574IY+jdJzSRoBry7 QLzr7JuDPsN9X6shpO2lcpoJuCxI6zf5vJcm7mxqY8x6rXx9EqRa9NRgAuSWjnFJGdCb 3mZnGT0BR20iQNm69BsfI4OtV4Q7HnNaLo/kTDlv1MwXLM9RmTn4mXE0G1jrWrX5h49G MiNLqCOXDzx/xPDaHR8epEYriw3cKc6JtiSCJbOlDMjF3S28LGmVCMoHJbN14PrR+YbM LSHSnAEEUvFqZfQzX3ALyfbYLPDRPtvf3Nttn9HPAarwLh1f+I2t2u5WSO6vEbynh49h EiKw== ARC-Authentication-Results: i=1; mx.google.com; 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 d3-v6si1889075pgk.610.2018.08.22.08.17.13; Wed, 22 Aug 2018 08:17:28 -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; 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 S1729353AbeHVS33 (ORCPT + 99 others); Wed, 22 Aug 2018 14:29:29 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:45961 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728343AbeHVS32 (ORCPT ); Wed, 22 Aug 2018 14:29:28 -0400 Received: by mail-qt0-f194.google.com with SMTP id g44-v6so1726086qtb.12 for ; Wed, 22 Aug 2018 08:04:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8FnfFr+Jm8bK9K32WfB8TUr6ib203wdkLbOcxKK71+I=; b=JfLFg0B3jsbR0DcdPKtCplElQxVTbymnvEaNdTkPGNXZ2rC7wxE9ggDvNiSNy6+EIs SomUU1yzIW52y7FfGWEmD/vwUHGM6XtNEk1/gH0glnsRkthQb6/D7dwsrL4Gs6mzM74W zkglw9IjKWna8t2MOFhVxU13Md06+zyf6kInQc3MOOzAgLGrmXffkBk9ps+n68rygRMY lb1/yt5GSNEPzV7J4tc/U3KpkZvj8jpMpzuZ4YcVuQeadDiT6lEAO+Qfhk4qpjdwCWqn VQObOP3+1aMQNiijVIdO5VcJdYBUZCDvL4Q8IS/bOn6aDBZ/3gSORA995Dw2s00+dsh7 tjOA== X-Gm-Message-State: APzg51CYFgH3Z23t4QFWpUviyI8kPEYXLQ3uHon5BD4MObrWgXQSBxh3 CVNDO+If0lYs3UYwuYBELFv/nZRSzlAaMy77Ybg= X-Received: by 2002:ac8:6959:: with SMTP id n25-v6mr8175541qtr.9.1534950252587; Wed, 22 Aug 2018 08:04:12 -0700 (PDT) MIME-Version: 1.0 References: <20180821222416.7771-1-stefan@agner.ch> <77d139d225e16b90d9b8da1982a11707@agner.ch> In-Reply-To: <77d139d225e16b90d9b8da1982a11707@agner.ch> From: Arnd Bergmann Date: Wed, 22 Aug 2018 17:03:56 +0200 Message-ID: Subject: Re: [PATCH] ARM: use choice for kernel unwinders To: Stefan Agner Cc: Russell King - ARM Linux , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 22, 2018 at 4:38 PM Stefan Agner wrote: > On 22.08.2018 12:02, Arnd Bergmann wrote: > > On Wed, Aug 22, 2018 at 12:24 AM Stefan Agner wrote: > > > > Looks ok to me. I've added it to my randconfig test environment, you > > will hear from me within a day if I run into build regressions. > > > > We may still want to clean up these three lines: > > > > lib/Kconfig.debug: select FRAME_POINTER if !MIPS && !PPC && > > !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !X86 > > lib/Kconfig.debug: select FRAME_POINTER if !MIPS && !PPC && !S390 && > > !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 > > lib/Kconfig.debug: select FRAME_POINTER if !MIPS && !PPC && !S390 && > > !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 > > > > in which ARM is the odd case that currently depends on an architecture > > specific rather than the architecture itself. > > I guess we would just follow X86 lead by saying ARM is guaranteed to > have unwinding support, and hence we can add !ARM. Right, that was the idea. > > We could introduce a 'config ARCH_HAS_UNWINDER' symbol that gets > > selected by mips, ppc, s390, microblaze, arm and x86 unconditionally, > > and then simplify the 'select' statements here. > > Yeah I was thinking about something like that too. > > It seems to be a bit weird to me that lib/Kconfig.debug selects a > specific stack unwinding technique... This must be a historic artifact from the time when FRAME_POINTER was the only unwinding method that existed. We may also have some architectures that don't support any unwinding. > Ideally other config symbol should just ask arch to make sure a > unwinding technique is available (NEED_STACK_UNWINDING?) and arch then > makes sure to provide a reasonable default. > > This then also would make it possible to select no stack unwinding in > case arch supports that and all the users of stack unwinding are > disabled too. Not sure how that exactly would look like in Kconfig, I > was thinking like: > > choice > prompt "Choose kernel unwinder" > optional if !NEED_STACK_UNWINDING > default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER > default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER > > But "optional if" does not exist yet :-) You can write that as choice prompt "Choose kernel unwinder" if NEED_STACK_UNWINDING This will hide the prompt when NEED_STACK_UNWINDING is disabled, making it impossible to pick one of the two unwinders. > Reading the comments in arch/arm/Kconfig.debug seems to suggest that > once upon a time it was possible to disable stack unwinding on ARM. > > But then, maybe we don't really want to go there? Might be interesting > for tinification efforts. I'd leave that for another day ;-) Arnd