Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8114776rwn; Wed, 14 Sep 2022 09:08:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kVqMF8UFy2keGxaSWfNHjduPMrUSEBa3mysYGB0ZEtZXcaEmNX1O3xPFUwn1thUrrCXCe X-Received: by 2002:a05:6402:4493:b0:451:141d:3231 with SMTP id er19-20020a056402449300b00451141d3231mr21459323edb.318.1663171701917; Wed, 14 Sep 2022 09:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663171701; cv=none; d=google.com; s=arc-20160816; b=Gi8wEeGQksg6AjFOI1kLWM6qVXgYdEaC8VFoyr4ELWd7PnJTGn8oE+rGqaVAzTOjqk bz911MtbjWK9/rm4BHTylUKE7kmlnw6k0pVfzasfgpEYehs4WaNV0044OK6peTcODaww 8AePbGqTl8HxLKuK17xXM5shvDzdcxf2DMvv//LTuNJHYNWD0xczZVcjlZ3rjkJwLuD7 QbrUV6HFlgev7hh0vWOTgWkqAsmoYi5xIrf00TAh5PD9n0Wsod6e2bSHWyU5BXdT81KW 32diGfx/rqhgPV92S9ynnMFl101lyCuDLb6g1DVPd/4EH8jJUqXeJrzJVnD5APMftnl4 JOtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lALMKmdqPOn863q1KH2GHJFtFLSUGddYczxk7N3aI/M=; b=a6EXECHKmK5mQLtN//0TLZtZytBVubE0vBwWN32l3iMxb4c32WEbtreBB6oBwNI8g8 aWZ5oR9+WeOl+yBzdnWo83seR8JJWAbPhJtJqdhZ4uZRsAr0TIL8yjxjlnLGop3bl1+V MbHBLrPGeCW3jTyY4J1B+pmHihFwCsR8sNnSB83KCSMhC092lMXEU6mRW9H4R6R5+1VV SFxiusdGpyjg7qV1CQKBsIbEY88VWvFXw0pVcRtKtjadwXBhR3bqyt7mo2+w1YGv4NUb /7UC2y5U+sxJfK4pE/fule2iHTguF5LAxJ+2vJ4hXx0vFyl6+bPuFuako1mgaUCWWjZQ 7Cpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=czTvweMU; 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 hz6-20020a1709072ce600b007304a1ee3e3si11617075ejc.517.2022.09.14.09.07.56; Wed, 14 Sep 2022 09:08:21 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=czTvweMU; 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 S229757AbiINO4Q (ORCPT + 99 others); Wed, 14 Sep 2022 10:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbiINO4K (ORCPT ); Wed, 14 Sep 2022 10:56:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B995549B53; Wed, 14 Sep 2022 07:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lALMKmdqPOn863q1KH2GHJFtFLSUGddYczxk7N3aI/M=; b=czTvweMUYoYEwwLa37VQmFT4n6 yngz7eFZe9tSr77iA5R23q4p3rOTQ0tUEDmwtQ865Anxjj0hRK5lCOyoI41DeAX4Sbp0G9PJvf5zS kUJ7fsgOMtvDUbenfkNBESLno0UFnzzWqf0WZ3jEAlzoJvMpfFRsvfIXWaXHofc84YUdstmAeGSt/ /VWUkFerFuOp0vVfysvRP+QjT2l4QLw4nudPPSkuUDuGF9Obnk9Ndpm8X5umKT9achMkhU35jb+Wg UfejWRl74GzEaZ36dbnwK0cWBDzKeijaPAWBD+mILYlVXI9R0o32CkIs7xdslXQJw8XtBhQDUzoLM AM/bI/KA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYTnX-000GUH-OT; Wed, 14 Sep 2022 14:55:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A75AE3002AE; Wed, 14 Sep 2022 16:55:27 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8BDA8201B3981; Wed, 14 Sep 2022 16:55:27 +0200 (CEST) Date: Wed, 14 Sep 2022 16:55:27 +0200 From: Peter Zijlstra To: Michael Matz Cc: 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: References: <20220909180704.jwwed4zhwvin7uyi@treble> <20220914000416.daxbgccbxwpknn2q@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 02:28:26PM +0000, Michael Matz wrote: > Hello, > > On Wed, 14 Sep 2022, Peter Zijlstra wrote: > > > > Maybe this is semantics, but I wouldn't characterize objtool's existence > > > as being based on the mistrust of tools. It's main motivation is to > > > fill in the toolchain's blind spots in asm and inline-asm, which exist > > > by design. > > > > That and a fairly deep seated loathing for the regular CFI annotations > > and DWARF in general. Linus was fairly firm he didn't want anything to > > do with DWARF for in-kernel unwinding. > > I was referring only to the check-stuff functionality of objtool, not to > its other parts. Altough, of course, "deep seated loathing" is a special > form of mistrust as well ;-) Those were born out the DWARF unwinder itself crashing the kernel due to it's inherent complexity (tracking the whole DWARF state machine and not being quite robust itself). That, and the manual CFI annotations were 'always' wrong, due to humans and no tooling verifying them. That said; objtool does do have a number of annotations as well; mostly things telling what kind of stackframe stuff starts with. > > That left us in a spot that we needed unwind information in a 'better' > > format than DWARF. > > > > Objtool was born out of those contraints. ORC not needing the CFI > > annotations and ORC being *much* faster at unwiding and generation > > (debug builds are slow) were all good. > > 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. > 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