Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8239420rwn; Wed, 14 Sep 2022 11:04:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Sc3w+sopHPu9+HM5rmVIGuaYXAb81kVMjz4ovPw5IPH0AjamTQkTBuPOSlDhd7ayuNYmG X-Received: by 2002:a17:907:80d:b0:73d:a576:dfbd with SMTP id wv13-20020a170907080d00b0073da576dfbdmr26896057ejb.402.1663178647494; Wed, 14 Sep 2022 11:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663178647; cv=none; d=google.com; s=arc-20160816; b=RO0PJb7uh9NHv1g3MJCl9hY9wfJsCRHTX0HThfJVTq+VBIpSY/jWUqEOM3qshOn9rb flsoaDhcdadir5VkbdrK7VFGTePdoo4T6JWK6nEYkwakyn9/gianbBYs3SGuATZ5Mbea 67KheY4k6/QcATN6jPqlWLLObizBvGi5ytqib496RT82egaRvREftWWU1xqdu9olFuc6 p1jNP9I0h8qXRw1/pS7Lxzz8NK/8yasJ1WHzXXNYyiHJv6NMdyJYIAk8xHj0TnhhmlzN eUAAr9F0J8nVbXGote7PlzYGK2/7F979b+5ooZ/t02NX1bDoV47pc1ebp3fcXaRK+Xq/ IqVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=m1xZgHluU8R44Del+xCLJRA16tPL+6lCKMSVcth3ry8=; b=dlC+geSZ38pKKQb6uym48NoBSO5Twt1MZkFh7yIl+BV1zllg3957YIh/g/7SRNMe/e Dy/OeIigGEYtdlh94nlRECxeTZvW1gGQhDIEDQC9KMoD+CLGTOsxuHxEDnjXrHZvr/GO Sckv4iy06EVCeXYYyjTHKMzSkGfqAkO5mSxrf4pt7lfMhX1amGNAiWwmiNLjLknh5FaI 5gDu6ra9HAUZwx8ttGKjSvr0A6FAM1kvjBQKLo6oO/Q/sT8Jrq2naisc1WJ1h+HT0mPv 0AJ0Cgv4pj9W9UfK9P6EyLDhxldySDFuR2jIH36tRuzAcmrsFjkbyAtwKxRK9+xHTKhf 75eA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xh13-20020a170906da8d00b007707fc720desi14432418ejb.977.2022.09.14.11.03.40; Wed, 14 Sep 2022 11:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbiINRr5 (ORCPT + 99 others); Wed, 14 Sep 2022 13:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiINRrz (ORCPT ); Wed, 14 Sep 2022 13:47:55 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3221430543; Wed, 14 Sep 2022 10:47:54 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 28EHYR2K002376; Wed, 14 Sep 2022 12:34:27 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 28EHYPMf002375; Wed, 14 Sep 2022 12:34:25 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 14 Sep 2022 12:34:25 -0500 From: Segher Boessenkool To: Peter Zijlstra Cc: Michael Matz , Josh Poimboeuf , Borislav Petkov , linux-toolchains@vger.kernel.org, Indu Bhagat , Nick Desaulniers , linux-kernel@vger.kernel.org, "Jose E. Marchesi" , Miroslav Benes , Mark Rutland , Will Deacon , x86@kernel.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Ard Biesheuvel , Chen Zhongjin , Sathvika Vasireddy , Christophe Leroy , Mark Brown Subject: Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn} Message-ID: <20220914173425.GZ25951@gate.crashing.org> References: <20220909180704.jwwed4zhwvin7uyi@treble> <20220914000416.daxbgccbxwpknn2q@treble> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2022 at 04:55:27PM +0200, Peter Zijlstra wrote: > On Wed, Sep 14, 2022 at 02:28:26PM +0000, Michael Matz wrote: > > Don't mix DWARF debug info with DWARF-based unwinding info, the latter > > doesn't imply the former. Out of interest: how does ORC get around the > > need for CFI annotations (or equivalents to restore registers) and what > > Objtool 'interprets' the stackops. So it follows the call-graph and is > an interpreter for all instructions that modify the stack. Doing that it > konws what the stackframe is at 'most' places. To get correct backtraces on e.g. PowerPC you need to emulate many of the integer insns. That is why GCC enables -fasynchronous-unwind-tables by default for us. The same is true for s390, aarch64, and x86 (unless 32-bit w/ frame pointer). The problem is that you do not know how to access anything on the stack, whether in the current frame or in a previous frame, from a random point in the program. GDB has many heuristics for this, and it still does not get it right in all cases. > > makes it fast? I want faster unwinding for DWARF as well, when there's > > feature parity :-) Maybe something can be learned for integration into > > dwarf-unwind. > > I think we have some details here: > > https://www.kernel.org/doc/html/latest/x86/orc-unwinder.html It is faster because it does a whole lot less. Is that still enough? It's not clear (to me) what exact information it wants to provide :-( Segher