From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47EB8C433DF for ; Thu, 15 Oct 2020 15:51:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BABF822254 for ; Thu, 15 Oct 2020 15:51:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1FKJFqlv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="WcX0p/fW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BABF822254 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qMJR8UO4nYMsItgxBKbgvQlr/IaIOoLY466KG1mlRdY=; b=1FKJFqlv2jz5EhlpSGHGjgnRV 3W2WHyxODty8aEGUAGrzmg+DsEZw1yMirczQDzaXRPkm4X1K2J7ZZI+fLjVJd0VUSsT6xZQm4SJFn gL+WTeYKA5Cs5HoKT3BcucVOvb7px/9MWnQ+qo8UPmNVhSvfCE9Vc+Ac6UJceqYjGtc4r44n+CJbX B0tMDtUSqMdlzanoLDOQWc9bMe74ZmEazeEdxcC2X6vmFdrmpuiyfW+xYyyxXPpWl47hPcPGBxioK 1lc5w5BKzVK5LWyX4G+JjQAgopxx7cD1fvMRwGgLaGWAFPbhQgHoqwiGkYN5HOQHbo9dfz+g/x7bY iRLgLvFkQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT5Vz-0004wN-0V; Thu, 15 Oct 2020 15:50:03 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT5Vv-0004vN-DU for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 15:50:00 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0561721D41; Thu, 15 Oct 2020 15:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602776998; bh=3xcLz744yrXycs4J+dLpASYC49qL5PFUOwNt7ojrdeE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WcX0p/fWHxV/F7V9dTEZ2Nm0OxZ9OHv6PdTo04NCK+keyz6Z6uilCwet19AJDDAVH NIMPggy7CRAtru0qBC1qUXEM9AxkSIgBWUDacmnHD+iqqDPrRQBg6q3u6Wea4Bl06s hd6Lv+OGuWH/9xhm8g1SFLxyuUG3zlRf9L26fpK4= Date: Thu, 15 Oct 2020 16:49:51 +0100 From: Mark Brown To: Mark Rutland Subject: Re: [RFC PATCH 0/3] arm64: Implement reliable stack trace Message-ID: <20201015154951.GD4390@sirena.org.uk> References: <20201012172605.10715-1-broonie@kernel.org> <20201015141612.GC50416@C02TD0UTHF1T.local> MIME-Version: 1.0 In-Reply-To: <20201015141612.GC50416@C02TD0UTHF1T.local> X-Cookie: Neutrinos have bad breadth. User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_114959_568001_83C1401D X-CRM114-Status: GOOD ( 23.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Miroslav Benes , Will Deacon , linux-arm-kernel@lists.infradead.org, jpoimboe@redhat.com Content-Type: multipart/mixed; boundary="===============2776657439326953424==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2776657439326953424== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d9ADC0YsG2v16Js0" Content-Disposition: inline --d9ADC0YsG2v16Js0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 15, 2020 at 03:16:12PM +0100, Mark Rutland wrote: > On Thu, Oct 15, 2020 at 03:39:37PM +0200, Miroslav Benes wrote: > > I'll just copy an excerpt from my notes about the required guarantees.= =20 > > Written by Josh (CCed, he has better idea about the problem than me=20 > > anyway). > > It also needs to: > > - detect preemption / page fault frames and return an error > > - only return success if it reaches the end of the task stack; for user > > tasks, that means the syscall barrier; for kthreads/idle tasks, that > > means finding a defined thread entry point > > - make sure it can't get into a recursive loop > > - make sure each return address is a valid text address > > - properly detect generated code hacks like function graph tracing and > > kretprobes > > " > It would be great if we could put something like the above into the > kernel tree, either under Documentation/ or in a comment somewhere for > the reliable stacktrace functions. Yes, please - the expecations are quite hard to follow at the minute, implementing it involves quite a bit of guesswork and cargo culting to figure out what the APIs are supposed to do. > AFAICT, existing architectures don't always handle all of the above in > arch_stack_walk_reliable(). For example, it looks like x86 assumes > unwiding through exceptions is reliable for !CONFIG_FRAME_POINTER, but I > think this might not always be true. I certainly wouldn't have inferred the list from what's there :/ The searching for a defined thread entry point for example isn't entirely visible in the implementations. --d9ADC0YsG2v16Js0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl+Ib54ACgkQJNaLcl1U h9DMogf+LTiE/6gsMcIy4SnWsSJhaRyv8qc7RR6t5y0EHcYrVr4ngO0KboH68nJB rYeYttd19YF3aY6K9kRY7C8QmgaXyWS6yS0GQbkP+tafiUjuHDDB7cxADZ/2XrJR MV2xAXDZmRvCjGTH7tKNF3xkdLrs9VSGxS3qB+I2f9P6g/tzBIsy5GCe5vQpYRBC 7qzo4/Lv5HSPhmcLF1scPufrh3hEaDh/cHI86/prAGiMaCiR9ljLuHuejpRjYwy8 YpawHig3RmP1CX6c7Z88kM0c/AAx7GZO0iu0UuwpoPUHiEX+2yxLPA4U76OFtlIp NtWI+m1nBTfC5vE6M3rrSAfDP2/4mA== =aKmQ -----END PGP SIGNATURE----- --d9ADC0YsG2v16Js0-- --===============2776657439326953424== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2776657439326953424==--