Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5562731pxb; Mon, 28 Mar 2022 14:15:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKKRhmOCAnMlJV1yA6XJ8WagzIcidDd9Dnb8nFhZy5Q+iAh+Q4YDDH6jZKedP8XmZMMAKL X-Received: by 2002:a05:6808:1451:b0:2ec:cfe4:21e with SMTP id x17-20020a056808145100b002eccfe4021emr611834oiv.147.1648502156154; Mon, 28 Mar 2022 14:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648502156; cv=none; d=google.com; s=arc-20160816; b=Q8ibbaFYc5UbEKkJU2YeXl2PLleSTHrN7QBAwRGARqT5mPnxxjmXFQT1h+VXloxSCa LqQRPt19bFEUlJoga2y4xk9BltCSlw0jGDOLOuKGqCeACDKb88TaPUH3hHaHcFDN04v/ 0seVqIO60FvHGk1Gfp4jZTH93ps35T9Y3rT53s1/YDWaAc1axCNu+ZDS6mGhLbTAzn44 KUnOznylkjmZMrgO9f3yelLqi6imn2Ez2inXANp+SWme/SWoZJpAgYZmUhUTzAklXabh 4hFemxne7bvZx3GJSysVjSsQOw6gqceiLGXMtCxh17pWUkaZvcHsuH5RiiGYn5ReDle4 X5Ew== 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=rNlkcdDOnbEEqyaA/TedcvXNhWifU9B0NNWARWuI3n8=; b=gPgnVhhJ8J7FlFVmFOYDvg5bYmqd7e7A4Mp3miSN5Hj9ptU4quZh8uburQMlQLaCnf CUDH3HpJJmGyV/BpAVoDptTB2mb+4xYcNBvqhcg2mjQQ5pSWxBmVarVIZPwNTty96M52 TnFCXOffpsvxMSokkE1WfAy3I2ph4tPgF1jJvzqIZLazVrJi4T+RibYHtwndU5bq/MDY ZKgWYSBhxB89WMItQsrR2216vop9Iz0p4IP/AoNzMf4ZNJ+6Nu3F+gHLhnNatjpXIIQq JpKgy4WSeYKtT3eVCko3ZKPM7XkNs3f/cWii32UtakABOx2QIRJh5NNy3l3iMVT4x5sV RkqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q4W5mxp8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p127-20020aca5b85000000b002ef0c3475aasi9898988oib.42.2022.03.28.14.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:15:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q4W5mxp8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12FAB71A24; Mon, 28 Mar 2022 14:06:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343951AbiC1UBM (ORCPT + 99 others); Mon, 28 Mar 2022 16:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239880AbiC1UBJ (ORCPT ); Mon, 28 Mar 2022 16:01:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 273E634B81 for ; Mon, 28 Mar 2022 12:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648497566; 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=rNlkcdDOnbEEqyaA/TedcvXNhWifU9B0NNWARWuI3n8=; b=Q4W5mxp8IzvQnXAFA4pXr4iq6DFjrZ3uAYshzd2RmqwmQCfufN9DG/sm0/uQbJh0ck7W8z YvmcNHOW6IY+7u8JXVg7aKdOc7xJ4qOsOimQp7dSRHgrafHDWVgaNJc1R9k9wjW4JJ0EhK kp2Nl2JvQRYFtW8W03tBLCLhIfmOyCA= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-550-pZ5kztpxP6qC0KWnfws5FA-1; Mon, 28 Mar 2022 15:59:24 -0400 X-MC-Unique: pZ5kztpxP6qC0KWnfws5FA-1 Received: by mail-qt1-f197.google.com with SMTP id cb11-20020a05622a1f8b00b002e06f729debso13089703qtb.4 for ; Mon, 28 Mar 2022 12:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rNlkcdDOnbEEqyaA/TedcvXNhWifU9B0NNWARWuI3n8=; b=j5UydY96GoEO6z8+cWZXbLZ+UGk0itLYS3Y8G3PUfZGDtVs/BN+9Bavweyxi04LOj9 tH+3tZ+ZsK6jv0c4t3jnf37KcWWNNxK41P4YMsQ7/PVPHMw6Ijxzt27UJhnXomCSAJ1Z EbgIi6IwAWGrqMoA1rktDo/KQuNEERrkKM36hdL5na2HVsIAOOaF/DyyeT4goU1KF0bO ysFDOkArAwaDw5pOlpsSxQLKjYIn16bJlYOwGOcONWP6Z5wOyEW9clZl1t6KKHpXdimT UhZhaSCnZb9SN52D5CorEawREYmSdVzPrCVULRPK9OQXOnL2mGKGR3DqoExjRelV8f6A r7qQ== X-Gm-Message-State: AOAM532fFDJBGFNsqEnJj0y9ivr/F2UfU79BnLrM8KsQPhJQxPQMpzv2 +tssZYUkW9e3u1pZ4/smncf4Qk3etRqCJ6AeIkqvGl3vxu2PAFDfq2OyTpQkaYUyN9puFnckvci FyGlP7dWR0FQ8uvVDUw8HtgsN X-Received: by 2002:ac8:5cc1:0:b0:2e1:bd05:1371 with SMTP id s1-20020ac85cc1000000b002e1bd051371mr23484915qta.573.1648497564278; Mon, 28 Mar 2022 12:59:24 -0700 (PDT) X-Received: by 2002:ac8:5cc1:0:b0:2e1:bd05:1371 with SMTP id s1-20020ac85cc1000000b002e1bd051371mr23484900qta.573.1648497564027; Mon, 28 Mar 2022 12:59:24 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::35]) by smtp.gmail.com with ESMTPSA id z15-20020a05622a060f00b002e2070bf899sm12526007qta.90.2022.03.28.12.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 12:59:23 -0700 (PDT) Date: Mon, 28 Mar 2022 12:59:20 -0700 From: Josh Poimboeuf To: Christophe Leroy Cc: Peter Zijlstra , "aik@ozlabs.ru" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "naveen.n.rao@linux.vnet.ibm.com" , "linuxppc-dev@lists.ozlabs.org" , Sathvika Vasireddy Subject: Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0b55f122-4760-c1ba-840a-0911cefec2ad@csgroup.eu> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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? > 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. 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. -- Josh