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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8A5C3C43457 for ; Mon, 19 Oct 2020 23:44:11 +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 312572223C for ; Mon, 19 Oct 2020 23:44:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QItG0ueo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BtvQ/iZF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 312572223C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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-Transfer-Encoding: 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-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HWfFdCMUhUg/V6FKDVgUg0KZxYJIbe6atzk2mIxl30Y=; b=QItG0ueodFHLtBmR72VHswQz2 VkAD1YGPQc5GkcmBbXx//xtkwWHrhz0c8zZDctgUOr5Z6wzve32gVWFwH439DNpW+YruSQUtm+/IW IiROHV+uKYMicK+ooJy0Kg2TkdHAdF7Pt9KN7iHNKjZfNSNxWU8m6SP66Oh8zqMXAEyl2pExe3t0G C+MzukJ3L+NrsONpNToXs/AAdna7r9P0XBAbWF9DayrEN7jmWzNBckMsFu1xUmv+8SUuZBQ9AL1QZ S9G1duQd8/CgpM/JHo93EGUZE3uwt09Q0IM6j79e6gXTD5/vayTbXFpufrZAgWu9JiL27xfRQ5DnD G6hOfuzQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUen6-00037b-Jk; Mon, 19 Oct 2020 23:42:12 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUen3-00037B-3H for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2020 23:42:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603150926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hy5Toxs0EKUklsBebnq/S505L/qncNcBB4kBuZErIU4=; b=BtvQ/iZFzzBuImHx+OBCtwvnzG6jFOCbUcGVTNJPk7Dq/CLiycqHQyPfX+A3ZKW3TOV2GS tXsegDwCF4e6m+oS2teeAMUTKqY4tm3YLU/U3C9PYIes4BTkdpnTRLp/6U8ZrfkT2ddlOB af8qs0L/Z26x+L8jZE4IAAmZ7h/ezTQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-eEQdHWqWM7OJlXKeoomt-g-1; Mon, 19 Oct 2020 19:42:02 -0400 X-MC-Unique: eEQdHWqWM7OJlXKeoomt-g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1C3E1895806; Mon, 19 Oct 2020 23:42:00 +0000 (UTC) Received: from treble (ovpn-112-186.rdu2.redhat.com [10.10.112.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C6501002C03; Mon, 19 Oct 2020 23:41:58 +0000 (UTC) Date: Mon, 19 Oct 2020 18:41:55 -0500 From: Josh Poimboeuf To: Mark Brown Subject: Re: [RFC PATCH 0/3] arm64: Implement reliable stack trace Message-ID: <20201019234155.q26jkm22fhnnztiw@treble> References: <20201012172605.10715-1-broonie@kernel.org> <20201015141612.GC50416@C02TD0UTHF1T.local> <20201015154951.GD4390@sirena.org.uk> <20201015212931.mh4a5jt7pxqlzxsg@treble> <20201016121534.GC5274@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201016121534.GC5274@sirena.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201019_194209_182429_2D4701A5 X-CRM114-Status: GOOD ( 22.50 ) 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: Mark Rutland , Catalin Marinas , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Miroslav Benes , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 16, 2020 at 01:15:34PM +0100, Mark Brown wrote: > > Yes, exactly - just copying the existing implementations and hoping that > it's sensible/relevant and covers everything that's needed. It's not > entirely clear what a reliable stacktrace is expected to do that a > normal stacktrace doesn't do beyond returning an error code. While in the end there may not be much of a difference between normal and reliable stacktraces beyond returning an error code, it still requires beefing up the unwinder's error detection abilities. > > > The searching for a defined thread entry point for example isn't > > > entirely visible in the implementations. > > > For now I'll speak only of x86, because I don't quite remember how > > powerpc does it. > > > For thread entry points, aka the "end" of the stack: > > > - For ORC, the end of the stack is either pt_regs, or -- when unwinding > > from kthreads, idle tasks, or irqs/exceptions in entry code -- > > UNWIND_HINT_EMPTY (found by the unwinder's check for orc->end. > > > [ Admittedly the implementation needs to be cleaned up a bit. EMPTY > > is too broad and needs to be split into UNDEFINED and ENTRY. ] > > > - For frame pointers, by convention, the end of the stack for all tasks > > is a defined stack offset: end of stack page - sizeof(pt_regs). > > > And yes, all that needs to be documented. > > Ah, I'd have interpreted "defined thread entry point" as meaning > expecting to find specific functions appering at the end of the stack > rather than meaning positively identifying the end of the stack - for > arm64 we use a NULL frame pointer to indicate this in all situations. > In that case that's one bit that is already clear. I think a NULL frame pointer isn't going to be robust enough. For example NULL could easily be introduced by a corrupt stack, or by asm frame pointer misuse. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel