Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp560881pxb; Tue, 29 Mar 2022 07:44:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3Zf0bdNJwkvN1Bryf1YsPBOVbJ3wESaDAvAgyPAKj4Jcq4tpGDRZ/D3Ap7bQ2qqhwMHP0 X-Received: by 2002:ac8:65cf:0:b0:2e1:e78c:85f3 with SMTP id t15-20020ac865cf000000b002e1e78c85f3mr27249043qto.15.1648565086086; Tue, 29 Mar 2022 07:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648565086; cv=none; d=google.com; s=arc-20160816; b=ax2NfGYqq4+Xzai5FjXVAP6u9lN2SbWtQXTKdwFSn2BIN+uxPWqVWi72X9fr05Tp7t YHAD1lWVuA1a4miifcjQmMHdYbtg2reHdBf0PLroRIjGjbtOvioJvF1KkeGCaNc+ehG0 1J3F2FdgL7bJMg3TbW8E+Og13xBwvpjrsoUHNu0ROTtg9gB6cGjTr4CreGCw1mqZjhlg FUcste6YXxVMvqiIMBufMM2GCSD7xhuFWIc3SFXBcc79YNGzwgyws4Lsh1HK94DmQYIB t3lAdN/PMb/bmWEOUTCY1IPy3W+MmxCXWVE1Vbi0iTZeBilNRJ2MshaXmnfjHKL0nW2a 7nXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=01mxyWDLRIt5kimROuqbPGIxm1dCV7lRCsI+Du/e0Ss=; b=IkHZZtu3r8MeKeden32F6XwzVVzDaKKsstLT3oT8Nh+zuxUIiQWOfUa0zNmDJTsR+y +HfBiZLgW7ahUNKkFrQbTgBGJnvBekBK71Qb40h1kGj4Q2rwP9hH5jGHKEBmkmSSLLpE nDqKpnJ5Dk/vZNVGapaSuBxHDU2X2q0JnuQrn4jFM8sYwb9U4VX0lIk6uwD8GAsV2Vzr 0h/vRtVnryR2au0XjoeSGwOz1bmflPqiStYiWZREMD+//Cfb+4fCQkzSOA8d1DHu7o9E f/0bSDVKxTUPpiKS6E9rILZ6L2UiABuyBKVZSoFNm1nFGxy3HKoUMVcpkRtDIrvXku4w LO1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=L3kBFENc; 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 q4-20020ac84504000000b002e1fbf3be26si9136911qtn.23.2022.03.29.07.44.14; Tue, 29 Mar 2022 07:44:45 -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=@ellerman.id.au header.s=201909 header.b=L3kBFENc; 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 S236186AbiC2MDc (ORCPT + 99 others); Tue, 29 Mar 2022 08:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236184AbiC2MD3 (ORCPT ); Tue, 29 Mar 2022 08:03:29 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83A095BD0E for ; Tue, 29 Mar 2022 05:01:45 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4KSSpX4blyz4xNm; Tue, 29 Mar 2022 23:01:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1648555304; bh=01mxyWDLRIt5kimROuqbPGIxm1dCV7lRCsI+Du/e0Ss=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=L3kBFENcYSTJQ6cWgshgm35f9FNB8Ew3X782WdaRMzj5n1w6uL8J0Z/9Ys116iCFS 3PKWwyLdvJr7Urq5zfhmzBHcNgBvtBFVrXcYgUJcLmLdW1ydcCQ87VcVAvUsX5BuNm WBZuEPhmLtbthCqRlOVX2bbziX37DusGS6BuAtrp4Di10dnmOkWG+QgHwwm8zOu8Yu ZN9UUWjSbHiLGVna/Gx2iXrBrD8HB7QI4Y2ePlRHcqGzwi508PLBVR2T5X7UsVNl0c nY6Jcm5fJsxWdKA6Re61fRVd9yvLa+Eq0akkxggx2ECh4uGtyOXf5hKVkr8ZbFYdyM vfcsSLcgEpWTA== From: Michael Ellerman To: Josh Poimboeuf , Christophe Leroy Cc: Peter Zijlstra , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "aik@ozlabs.ru" , Sathvika Vasireddy , "naveen.n.rao@linux.vnet.ibm.com" , "linuxppc-dev@lists.ozlabs.org" , "Naveen N. Rao" Subject: Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions In-Reply-To: <20220328195920.dqlfra3lcardko6r@treble> References: <20220318105140.43914-1-sv@linux.ibm.com> <20220318105140.43914-4-sv@linux.ibm.com> <0b55f122-4760-c1ba-840a-0911cefec2ad@csgroup.eu> <20220328195920.dqlfra3lcardko6r@treble> Date: Tue, 29 Mar 2022 23:01:38 +1100 Message-ID: <87mth9ezml.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Josh Poimboeuf writes: > On Sun, Mar 27, 2022 at 09:09:20AM +0000, Christophe Leroy wrote: >> Second point is the endianess and 32/64 selection, especially when >> crossbuilding. There is already some stuff regarding endianess based on >> bswap_if_needed() but that's based on constant selection at build time >> and I couldn't find an easy way to set it conditionaly based on the >> target being built. >> >> Regarding 32/64 selection, there is almost nothing, it's based on using >> type 'long' which means that at the time being the target and the build >> platform must both be 32 bits or 64 bits. >> >> For both cases (endianess and 32/64) I think the solution should >> probably be to start with the fileformat of the object file being >> reworked by objtool. > > Do we really need to detect the endianness/bitness at runtime? Objtool > is built with the kernel, why not just build-in the same target > assumptions as the kernel itself? I don't think we need runtime detection. But it will need to support basically most combinations of objtool running as 32-bit/64-bit LE/BE while the kernel it's analysing is 32-bit/64-bit LE/BE. >> What are current works in progress on objtool ? Should I wait Josh's >> changes before starting looking at all this ? Should I wait for anything >> else ? > > I'm not making any major changes to the code, just shuffling things > around to make the interface more modular. I hope to have something > soon (this week). Peter recently added a big feature (Intel IBT) which > is already in -next. > > Contributions are welcome, with the understanding that you'll help > maintain it ;-) > > Some years ago Kamalesh Babulal had a prototype of objtool for ppc64le > which did the full stack validation. I'm not sure what ever became of > that. From memory he was starting to clean the patches up in late 2019, but I guess that probably got derailed by COVID. AFAIK he never posted anything. Maybe someone at IBM has a copy internally (Naveen?). > FWIW, there have been some objtool patches for arm64 stack validation, > but the arm64 maintainers have been hesitant to get on board with > objtool, as it brings a certain maintenance burden. Especially for the > full stack validation and ORC unwinder. But if you only want inline > static calls and/or mcount then it'd probably be much easier to > maintain. I would like to have the stack validation, but I am also worried about the maintenance burden. I guess we start with mcount, which looks pretty minimal judging by this series, and see how we go from there. cheers