Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1830554ybb; Thu, 2 Apr 2020 08:08:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJF4isJWiNnIruDFMDIurqNRh/efFz411xsDIuE8uf05VezCuotFPGf0F8voaEgL5Uh/RFx X-Received: by 2002:a9d:7c9a:: with SMTP id q26mr2799748otn.143.1585840092057; Thu, 02 Apr 2020 08:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585840092; cv=none; d=google.com; s=arc-20160816; b=w/pNI4lUcnq0wKIIh4B7Dzp9tQDWLrOcrsuP4VIP1N4Nzj2gQg/NVhFpZYuW4DAqBG 9cFZgQexkbHOtAvZ1AcLP4cdBRTtne0IKxCqA/7mqwQ+Wg+2dNeOhx6sqYdxSnU30a07 MOGaAYKMHW8MwOuAFkCwI3/qmcD+Y0Fhpp2tun0G0f1D3IsrsG5xGs7OUp50ZFWf5Hh+ GkVCXu/pqLOzlPicnjIW7HW90/qzsQonXEhb6ScLYT0yfblSJcwqj+hTQz9ov1CsU3Ai Q3d89nRZZ7omcR2rpDhrNeS/qSIC6+eRY/X46ZozhOFjfaFEiqyxVNLpdxMvubWrjN8H 043g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wUAIUHKPNY6CBj+ztvqtf2rjatWpCwWsKeO3Gq2tLe4=; b=toyYMYkFZnYoLcdxm+gcS3WeVhLc0gpKco3zEsOa45c3l4Op7LLtr6RNIdEoJUfwm9 Iu45aiL61sKMyC5iZZvZWHmCI1uLtHaGgTPqB7HWSWuu5Om7w46lUIbBnG/8E6J30LEt E9J2iO+d94hoxukfN7pEuvUEJaYxOJPfZau+WiZuDAaWVYbwm1Z1+7TMtCQjtToGwmEA LOA+3MclZCFDFN5xU0vEPP7sPW69/dfjXG7F7DWXeEsv/jBqhPFQAgUSKLtOcsa2pW31 gACsPQvBfcGyE94TG8b51riC23fXqKnsrctC3xxftkfBwI0zFdjG9JkDNgoTc2P9U5zl acXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XvIAz7Jx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si2131011oov.25.2020.04.02.08.07.54; Thu, 02 Apr 2020 08:08:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XvIAz7Jx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389098AbgDBPEL (ORCPT + 99 others); Thu, 2 Apr 2020 11:04:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47534 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388810AbgDBPEL (ORCPT ); Thu, 2 Apr 2020 11:04:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=wUAIUHKPNY6CBj+ztvqtf2rjatWpCwWsKeO3Gq2tLe4=; b=XvIAz7Jx6tt/kXRu1RDERocUbP EnRazd+MeU/BGXmtllSpnJ/1gEwb8rcQqbwxWfC8uqPwNOXBG9NeY48SOUiHt0uZuHwfuQbpZe/8J rUq0P4tGcAgSxZlkzBRpGpx288B0IJx1yLYWUOMSDmmKrteSLWHzXkQu37Ec6E+SkxzFITI/aWGoq haqRieAyCUnZLtuF20qKZEwiQVmL8YAd5u+G6dG4jARxLRZCP1jdrBDmOXDNzYWpiWA5ILgKa10Yx seBuN6svqAb6LTXP2OeAJzr8OP7HxTBB8SJi1lSmQlzUFB8o9fPwhYW9LhgvexxYU/CkJr+kqbz3O ZpDcZkmw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jK1O4-0003x0-SW; Thu, 02 Apr 2020 15:04:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 315F3305E45; Thu, 2 Apr 2020 17:04:07 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1AB102B0DECD0; Thu, 2 Apr 2020 17:04:07 +0200 (CEST) Date: Thu, 2 Apr 2020 17:04:07 +0200 From: Peter Zijlstra To: Alexandre Chartre Cc: Julien Thierry , x86@kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, tglx@linutronix.de Subject: Re: [PATCH 3/7] objtool: Add support for intra-function calls Message-ID: <20200402150407.GD20730@hirez.programming.kicks-ass.net> References: <20200402082220.808-1-alexandre.chartre@oracle.com> <20200402082220.808-4-alexandre.chartre@oracle.com> <4e779423-395d-5e2e-b641-5604902bf096@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4e779423-395d-5e2e-b641-5604902bf096@oracle.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 03:24:45PM +0200, Alexandre Chartre wrote: > On 4/2/20 2:53 PM, Julien Thierry wrote: > > On 4/2/20 9:22 AM, Alexandre Chartre wrote: > > > +??? sec = find_section_by_name(file->elf, > > > +?????????????????? ".rela.discard.intra_function_call"); > > > > I'm wondering, do we really need to annotate the intra_function_call > > and group the in a section? > > > > Would it be a problem to consider all (static) call instructions with > > a destination that is not the start offset of a symbol to be an > > intra-function call (and set insn->intra_function_call and > > insn->jump_dest accordingly)? > > Correct, we could automatically detect intra-function calls instead of > having to annotate them. However, I choose to annotate them because I don't > think that's not an expected construct in a "normal" code flow (at least > on x86). So objtool would still issue a warning on intra-function calls > by default, and you can annotate them to indicate if they are expected. I wondered the same thing when reading the patch. I'm confliected on this. On the one hand auto-detecting this seems like an excellent idea. If/when the compiler generates them, they had better be okay too. Josh?