Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5271837ybb; Tue, 24 Mar 2020 14:10:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vugMpTx/1VkxdN6umTqIF/JJ72B6Hs0ic28baXYhzlm/ufh27QJLdaskenqiXIKj44LqNXQ X-Received: by 2002:a05:6808:304:: with SMTP id i4mr148412oie.87.1585084248658; Tue, 24 Mar 2020 14:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585084248; cv=none; d=google.com; s=arc-20160816; b=qCvN9fB5so2eZNWiaoaW/epafpfWjr4gbGcAU4f65Vke59GIIvXi2zx8/7Z3Jw4qPl BokEq0nrnRQMGyWRDMOlcrECeVBlmmGPnlcDTjylzpxJdI4ZmkH+armbD3RvPeNNHZuC H/6CDBVWWwL2KHF3R2pH2ADWbPLgTKc+40iOHPrGIEP6tJ1pH7a7JgcyH4OCkwGW0cTn DCLCjMMAT/tub2cJKMxHvjBdG5fuBEyx7YFkM8tnibv17Sb10S2sF4d+uuhUamdyrRPi 4ZmsqSpKtOfg3OtBvbP5IHpAkrN0yoyKThdbbZY0nZDGw3ZX+aIPdbI2ntK7JOC8BURi 2KAw== 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=a1cddOFNzKiuz4HxLKTDXuP0YWdbsERaj9bizJLyUwE=; b=W8OfD8foT8ueUDQaImEY/AGQKWO+ODna5NGiDJ2Pw67W5C9uAPxE7v+CdRDrT7aFKI IF6OeAza7Pvu4/Bk7WiX3OztuCz6zB4KApWClQrc/5Yc6HnXXetQ6Z9/SW3/uJkwjL2S 60g19PK3sBEIf4fwsxjCu0yfbJNece39p4ews/fWdeetgHAxdThBWuAajNV5OdwKhq/q +QcgHv7FOJj7ioPunrounLKabFIlfKKDwRNQrNLdI/TJ4Y2i1uK4xoQIJQDsTTDybLpw HSAGQ0rZZkq4o5uZz0o2wTllxxMutR4ZoBy8Qldj4snFu/LWSXG7AgqSYv7XwWF92/lx bXVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+WMr8KG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si9256475otr.38.2020.03.24.14.10.36; Tue, 24 Mar 2020 14:10:48 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+WMr8KG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbgCXVKQ (ORCPT + 99 others); Tue, 24 Mar 2020 17:10:16 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:47253 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbgCXVKQ (ORCPT ); Tue, 24 Mar 2020 17:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585084215; 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=a1cddOFNzKiuz4HxLKTDXuP0YWdbsERaj9bizJLyUwE=; b=U+WMr8KGCTnz5pVEesrusr7I5u99KaHx1oepJODqUu6s2KtMi0/9PXd9vDVgEjRF4YRDpI dnBa2F8u2t+3C7BZa/nFsAekZ3NtcPxF6lbBtGFrhMVcvGWrujaDu5891COnEToGSAnlJV pSfQEb5ZCyOE0v4i5j8sY/NMG88vsbw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-cr3paSwiP2a7omC8NSdOpw-1; Tue, 24 Mar 2020 17:10:11 -0400 X-MC-Unique: cr3paSwiP2a7omC8NSdOpw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA8BF107ACC4; Tue, 24 Mar 2020 21:10:09 +0000 (UTC) Received: from treble (unknown [10.10.119.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B769A8F363; Tue, 24 Mar 2020 21:10:08 +0000 (UTC) Date: Tue, 24 Mar 2020 16:10:06 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, x86@kernel.org, mhiramat@kernel.org, mbenes@suse.cz, brgerst@gmail.com Subject: Re: [PATCH v3 17/26] objtool: Re-arrange validate_functions() Message-ID: <20200324211006.vaocsz2s7xcalr2i@treble> References: <20200324153113.098167666@infradead.org> <20200324160924.924304616@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200324160924.924304616@infradead.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 04:31:30PM +0100, Peter Zijlstra wrote: > In preparation to adding a vmlinux.o specific pass, rearrange some > code. No functional changes intended. > > Signed-off-by: Peter Zijlstra (Intel) > --- > tools/objtool/check.c | 60 ++++++++++++++++++++++++++++---------------------- > 1 file changed, 34 insertions(+), 26 deletions(-) > > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -2413,9 +2413,8 @@ static bool ignore_unreachable_insn(stru > return false; > } > > -static int validate_functions(struct objtool_file *file) > +static int validate_section(struct objtool_file *file, struct section *sec) > { > - struct section *sec; > struct symbol *func; > struct instruction *insn; > struct insn_state state; > @@ -2428,35 +2427,44 @@ static int validate_functions(struct obj > CFI_NUM_REGS * sizeof(struct cfi_reg)); > state.stack_size = initial_func_cfi.cfa.offset; > > - for_each_sec(file, sec) { > - list_for_each_entry(func, &sec->symbol_list, list) { > - if (func->type != STT_FUNC) > - continue; > - > - if (!func->len) { > - WARN("%s() is missing an ELF size annotation", > - func->name); > - warnings++; > - } > - > - if (func->pfunc != func || func->alias != func) > - continue; > - > - insn = find_insn(file, sec, func->offset); > - if (!insn || insn->ignore || insn->visited) > - continue; > - > - state.uaccess = func->uaccess_safe; > - > - ret = validate_branch(file, func, insn, state); > - if (ret && backtrace) > - BT_FUNC("<=== (func)", insn); > - warnings += ret; > + list_for_each_entry(func, &sec->symbol_list, list) { > + if (func->type != STT_FUNC) > + continue; > + > + if (!func->len) { > + WARN("%s() is missing an ELF size annotation", > + func->name); wonky indentation Acked-by: Josh Poimboeuf -- Josh