Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp456848ybz; Wed, 29 Apr 2020 03:24:19 -0700 (PDT) X-Google-Smtp-Source: APiQypI0uxnupyyD15z6LKS/7MzfjAd5tenLH2gUhZAPxam7UgMu7m3H9yvMnyL0FFUziuClCcGL X-Received: by 2002:aa7:c0d2:: with SMTP id j18mr1725237edp.283.1588155859077; Wed, 29 Apr 2020 03:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588155859; cv=none; d=google.com; s=arc-20160816; b=h+7LoLFezqbZU4d4NmByeMoVCp/hDBw5/JLci6n+ZQRWuKBUPN5eO2jnFFd+vXbWYP rQaNXvYIt3LvbLXx16xib1/NkaQOPmX0MX5XhQTBl/+pwL1KFub/ZZRDWCsj5TCyc8n1 c/GinUmZhRkFgTFDNOsf0/J7v8VB3GrECJNu+u+wHNKVF8KgVpFZhmBnqoEA7hQJp+zi 9eGmzlh3NiEOpNgzhrkmaMKkGxy8CF9lM+hF+14Hf3Vzv5Yuyj0w+yirvtdlR7IgAwg1 PWPJKbdr3wSgkWCEgjSfTNy0K1wFpVZ6gevmaF5nU0MgJ3UivXJf/blbFku6lm9ZxXio ZTmQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aiyMISgJU8trSwUkRDZ8tNmypa9sBSdyxqBeshLo1x0=; b=q7YaQaMG8pVjTArJmmfo90lJHFOM5IDJXc+yqVc0GPMNLc+jUWyhV0VFgKEkNv1vU3 SLJcmgymt00YW/k+AODWgT37PS+CaZQ0LBRM0Hj7vIjtOJmSWx6Gw13F3EtwShgLlSin V1M4GC/usKlNwUCtL3VNRlesfy+Zi+OBNzSa4yHSPEmqhe7B03QH2ifRsHIuybbjudfT d3nkrv0xZL2ahCb4QWWgonJQ+OTrKscS94r4gJF4INlrm6jReyaXGHppaHpB+QsAeZcq Z16mIHYEtstzWiI+4YsBXXv75Z7LSPi3ucQyPXIsdWr1LMG3hnGHXOG8cXa/ygMIwBeU JxrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="RuDarup/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x21si3604836ejs.38.2020.04.29.03.23.55; Wed, 29 Apr 2020 03:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="RuDarup/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726847AbgD2KUX (ORCPT + 99 others); Wed, 29 Apr 2020 06:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgD2KTw (ORCPT ); Wed, 29 Apr 2020 06:19:52 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A047CC035494 for ; Wed, 29 Apr 2020 03:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=aiyMISgJU8trSwUkRDZ8tNmypa9sBSdyxqBeshLo1x0=; b=RuDarup/cu6qiHBZQo9EpstJP6 eKV+DWORwtqqOxp9vfCyCEuFoKEjFDn3xpEkzCWwY0wHz2DsjnRSN0GRVAyXUew6kwSxiuqxtFIYk vC8y1wgBOHP9N4/uErCi4RHtKprKtacN4gikCbyCnVuz+77zncnaehny1QJGqV89U/2KuFHbq0s5I 0IKwf32L0ioeQm3Cj0Wp/6Vngw4uKLrDaBFpsxfndx+wlgu1GKUFz8gimgV20mNUz7OHZJ8CbLulj eShlYSaNLC7BSHVeyBhMGeH4y6Fyz9L8glSHYjPPI+e4cUB/bncMUMzcQmvlyDe4h2LDcz+fFYE+4 uPiWfBxQ==; 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 1jTjoi-0005R5-7D; Wed, 29 Apr 2020 10:19:48 +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 A7944303F45; Wed, 29 Apr 2020 12:19:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 933E4201F9F0B; Wed, 29 Apr 2020 12:19:45 +0200 (CEST) Date: Wed, 29 Apr 2020 12:19:45 +0200 From: Peter Zijlstra To: jpoimboe@redhat.com, alexandre.chartre@oracle.com Cc: linux-kernel@vger.kernel.org, jthierry@redhat.com, tglx@linutronix.de, x86@kernel.org, mbenes@suse.cz Subject: [PATCH v2.1 01-A/14] objtool: Remove check preventing branches within alternative Message-ID: <20200429101945.GJ13592@hirez.programming.kicks-ass.net> References: <20200428191101.886208539@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428191101.886208539@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Subject: objtool: Remove check preventing branches within alternative From: Julien Thierry Date: Fri, 27 Mar 2020 15:28:42 +0000 From: Julien Thierry While jumping from outside an alternative region to the middle of an alternative region is very likely wrong, jumping from an alternative region into the same region is valid. It is a common pattern on arm64. The first pattern is unlikely to happen in practice and checking only for this adds a lot of complexity. Just remove the current check. Suggested-by: Josh Poimboeuf Signed-off-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200327152847.15294-6-jthierry@redhat.com --- tools/objtool/check.c | 6 ------ 1 file changed, 6 deletions(-) --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2180,12 +2180,6 @@ static int validate_branch(struct objtoo sec = insn->sec; - if (insn->alt_group && list_empty(&insn->alts)) { - WARN_FUNC("don't know how to handle branch to middle of alternative instruction group", - sec, insn->offset); - return 1; - } - while (1) { next_insn = next_insn_same_sec(file, insn);