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 62D67C433E7 for ; Tue, 20 Oct 2020 10:05:17 +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 DA40822282 for ; Tue, 20 Oct 2020 10:05:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dXwRHhRB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA40822282 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=alx99z48w6dAK97aozuEY7qDaJa3YfwvD45b/pExxuo=; b=dXwRHhRBJFf2luH6AUn5bQspc MAD2a42Lvsl1nLCtg+gTA0ThUDQQATMmJhHTJ4xFaU5/yyPgxlcCiCLoo3eU5W1FX4oCbMGV20jX+ phnrttT9vTCtjiXoq8pXClPXYQZbKP1R1NWXATtQH6we5IXZb1oFAxa1JPJX6keHNDgy+mustoCJZ T3+1YTVo3qNyqMIv0/1js1uU3QNbGMD0JzH5vD0PqGk4Qtytog87FfXdTG23zg3OdgZBkp58jmzn0 dgFx6xEJzBFTMUzNkk0uQg3o/r83rKdKEufC48bQSqD2lfVhMRb5c+tesb99SVITUuVv2UDcFmqZY Qo0Au1ewA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUoUv-0006GA-TC; Tue, 20 Oct 2020 10:04:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUoUt-0006F4-Do for linux-arm-kernel@lists.infradead.org; Tue, 20 Oct 2020 10:04:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 111A3101E; Tue, 20 Oct 2020 03:04:02 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.53.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A730C3F66E; Tue, 20 Oct 2020 03:03:59 -0700 (PDT) Date: Tue, 20 Oct 2020 11:03:52 +0100 From: Mark Rutland To: Josh Poimboeuf Subject: Re: [RFC PATCH 0/3] arm64: Implement reliable stack trace Message-ID: <20201020100352.GA48360@C02TD0UTHF1T.local> References: <20201012172605.10715-1-broonie@kernel.org> <20201015141612.GC50416@C02TD0UTHF1T.local> <20201015154951.GD4390@sirena.org.uk> <20201015212931.mh4a5jt7pxqlzxsg@treble> <20201016111431.GB84361@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201016111431.GB84361@C02TD0UTHF1T.local> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_060403_506982_C7C47FF1 X-CRM114-Status: GOOD ( 14.35 ) 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 , linux-kernel@vger.kernel.org, Mark Brown , 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 12:14:31PM +0100, Mark Rutland wrote: > Mark B's reply dropped this, but the next paragraph covered that: > > | I was planning to send a mail once I've finished writing a test, but > | IIUC there are some windows where ftrace/kretprobes > | detection/repainting may not work, e.g. if preempted after > | ftrace_return_to_handler() decrements curr_ret_stack, but before the > | arch trampoline asm restores the original return addr. So we might > | need something like an in_return_trampoline() to detect and report > | that reliably. > > ... so e.g. for a callchain A->B->C, where C is instrumented there are > windows where B might be missing from the trace, but the trace is > reported as reliable. I'd missed a couple of details, and I think I see how each existing architecture prevents this case now. Josh, just to confirm the x86 case, am I right in thinking that the ORC unwinder will refuse to unwind from the return_to_handler and kretprobe_trampoline asm? IIRC objtool shouldn't build unwind info for those as return_to_handler is marked with SYM_CODE_{START,END}() and kretprobe_trampoline is marked with STACK_FRAME_NON_STANDARD(). Both powerpc and s390 refuse to reliably unwind through exceptions, so they can rely on function call boundaries to keep the callchain in a sane state. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel