Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp293588imd; Fri, 26 Oct 2018 08:37:52 -0700 (PDT) X-Google-Smtp-Source: AJdET5fxlsZbnlZ/ykWAbArY5B+M//ZxEggMUlribQOerPye2TScKhAQnQWImerIS/WGlA1J8UP+ X-Received: by 2002:a63:1765:: with SMTP id 37-v6mr3990894pgx.131.1540568272489; Fri, 26 Oct 2018 08:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540568272; cv=none; d=google.com; s=arc-20160816; b=yqZJUlD8mz6TVvXG0MWQ9YpaAR7UAL/5IqZfxqXi1We2pOUC4alZ8sWNQie1o59Ipv bYxSNYAa71joW7sDWYCRlAKh59RkjXTZ6kmURdiJtXegisuOyqZgF8c8lG4kOmQJbWXc T80zjPPocXl0nNDHf2BlS3Z/B4gT9PrA+pxnqTUi1mYW0/0l3zsb2sLG3RbgX8rnYoZt LWbi9C7jRLbcMd72qWD+vcInGdgtINhXwXy2Lvu9MlroRileui5e/8BAYa7IhKAzD/OK upOGofgKwGLicSiLw3ju9rVATNQx2T+Btuh38kv97uNko5LctuxEVidOCCiiOPLNTnjO vmiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=O8sHJ7Djg7RpknhH3rHgcYDB6FbaDILWlNk0XVVTVXQ=; b=XXeizbS3+4UbsfMu4Qzy84GGtcIwj1kKV1oaaPH0Z62XGJhKVPrzON6bO64ZUxbHXf UnNvTXa6w9n+IBAgxl6DZ7NqesN6VA8r4q1EVXqJYOKtIE9c5JRLNVb/pJpQ0UOrypML IzD3CNqDU4vT3rPtgYad6+NvjUg7V70nZ0IxDMrgJTB9qkNVpfzBEOVDoyb6zrwvHPbS jf1XxcJ/XOK3YzusQGb0+KFS2cc1a6MXOBKlkJoY+wyXNfaBkRqvBN/niOCoPHWBitPL xq3v2PHqpSI5pMVDsf4iwtNTg2ZxmYTHHYlDaCHTPJgLosHBZEiGSH/cZZuGV5deV54y dOmg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23-v6si11337752pgh.581.2018.10.26.08.37.32; Fri, 26 Oct 2018 08:37:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726531AbeJ0AOj (ORCPT + 99 others); Fri, 26 Oct 2018 20:14:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54542 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbeJ0AOj (ORCPT ); Fri, 26 Oct 2018 20:14:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B30B3003D40; Fri, 26 Oct 2018 15:37:09 +0000 (UTC) Received: from treble (ovpn-123-167.rdu2.redhat.com [10.10.123.167]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08021611D3; Fri, 26 Oct 2018 15:37:06 +0000 (UTC) Date: Fri, 26 Oct 2018 10:37:04 -0500 From: Josh Poimboeuf To: Torsten Duwe Cc: Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v4 3/3] arm64: reliable stacktraces Message-ID: <20181026153704.7g34j3gtlklepyvb@treble> References: <20181026142008.D922868C94@newverein.lst.de> <20181026142157.B8FAA68C97@newverein.lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181026142157.B8FAA68C97@newverein.lst.de> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 26 Oct 2018 15:37:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 26, 2018 at 04:21:57PM +0200, Torsten Duwe wrote: > Enhance the stack unwinder so that it reports whether it had to stop > normally or due to an error condition; unwind_frame() will report > continue/error/normal ending and walk_stackframe() will pass that > info. __save_stack_trace() is used to check the validity of a stack; > save_stack_trace_tsk_reliable() can now trivially be implemented. > Modify arch/arm64/kernel/time.c as the only external caller so far > to recognise the new semantics. > > I had to introduce a marker symbol kthread_return_to_user to tell > the normal origin of a kernel thread. > > Signed-off-by: Torsten Duwe I haven't looked at the code, but the commit log doesn't inspire much confidence. It's missing everything I previously asked for in the powerpc version. There's zero mention of objtool. What analysis was done to indicate that we can rely on frame pointers? Such a frame pointer analysis should be included in the commit log. It should describe *at least* the following: - whether inline asm statements with call/branch instructions will confuse GCC into skipping the frame pointer setup if it considers the function to be a leaf function; - whether hand-coded non-leaf assembly functions can accidentally omit the frame pointer prologue setup; - whether GCC can generally be relied upon to get arm64 frame pointers right, in both normal operation and edge cases. The commit log should also describe whether the unwinder itself can be considered reliable for all edge cases: - detection and reporting of preemption and page faults; - detection and recovery from function graph tracing; - detection and reporting of other unexpected conditions, including when the unwinder doesn't reach the end of the stack. -- Josh