Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4321697rwb; Mon, 31 Jul 2023 05:19:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlEdyJMFV9mcGyrORYFE2pN/25CTHZJLs/hyWotoK58mSapr02X3D/YgGvJ3cfr8kkQ54tXk X-Received: by 2002:a17:90a:a58d:b0:263:f7ce:335e with SMTP id b13-20020a17090aa58d00b00263f7ce335emr8340551pjq.43.1690805969972; Mon, 31 Jul 2023 05:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805969; cv=none; d=google.com; s=arc-20160816; b=qEkfCgEGzlA+uXXiL4iay6yAdkqzSjGOQ2p7yvkzLlmwqBrpBzCz8Y0Dff7r/PqwYX TrnTr/j+GZhD3wKpOx1joeAQxcEmb/TluCwwT7tQ/31muXMYxFAqZxfnUnSFl2k+SB2L SqJBgq1t4DX4XD6q/YFNOwCX8ErHXjxSQkanOxTIlfXgQXlG81+g2woKZLg2oGt0fXzO yCC7Fi3kk4RVCBUQC2cYI7VjBDQgGaHGivOBRGSPoWOEJYmIsJEhoO8hkg37uhmJSA98 klPkQhj/1npK4YBv58oldpv+gh5yNx/9iv+D/ky2ZgExTJCjWYegnzfNT84s5EIfwfA/ /zzA== 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=M/35EV6KuQFV76XfAiI3kNPUCvGz0oTI5DQh4eGuYFg=; fh=njL7NvZcAZQImptUs0hA6r6GDCOxMTZIvT1ay5z8nQM=; b=mMEuZAAK/qsSlVBcTiBTRrCOhzK/qssax1GpaPiyAkTwj513KZ1XBI6lVNXyND911K ActTJH68bredENAJrpu6pmMYEfgBaiE62WkIltIwOiXpno1wIHt5OsQFm8julyDsuqP8 JdJoWpZSlcww2q5KH6FTW+QooEXd1TEIlJ5ZPDUFTg6iBMl3mAkSM9In7yqJXa193kuU VZC+HQuFMbFgBZYUP0kcO49L7opN3rOW06gagJ7HvZVg5mzn0sA3KFiRFqz3E5S5sHP0 QvdhEPEhYINe2uWAvcJIhgiy5pTiNdV2UNPciV+bb1uHPkC67Zik9qpBVyE2ke1E0Mvt cvhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ftvJr3wG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a17090ab31400b00262c146b8cesi3578845pjr.158.2023.07.31.05.19.17; Mon, 31 Jul 2023 05:19:29 -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=@redhat.com header.s=mimecast20190719 header.b=ftvJr3wG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbjGaLSK (ORCPT + 99 others); Mon, 31 Jul 2023 07:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbjGaLSH (ORCPT ); Mon, 31 Jul 2023 07:18:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74733E76 for ; Mon, 31 Jul 2023 04:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690802235; 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=M/35EV6KuQFV76XfAiI3kNPUCvGz0oTI5DQh4eGuYFg=; b=ftvJr3wG70kjwu73yW76fYZu140qSWKoq/RUAFYi8tb8lVYXpFsFIfROJiAZ4QEIkKtTVm dSgtpBzy2brojfUgumTGHFR19nPHQqWII0UdgtX0J6PVMehNLu5NfLZArXS1/dx9x05OKU OUoaUZrDZnBeDiYyxYiqmDMOyLB2q1w= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-5-A6xJ9u3EPWOqd8ljm6T9Rg-1; Mon, 31 Jul 2023 07:17:14 -0400 X-MC-Unique: A6xJ9u3EPWOqd8ljm6T9Rg-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-403b066c6e7so57834311cf.2 for ; Mon, 31 Jul 2023 04:17:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690802234; x=1691407034; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M/35EV6KuQFV76XfAiI3kNPUCvGz0oTI5DQh4eGuYFg=; b=LjrYtOZq1PipMUk99peaYRkmipY6JObuNF1Y3/tyX1EQ/pnEdCH3wlxUL6w0NiSSCZ hNNm7ZZF1MhLt2xwZuKi0wlkG9DfjfNhJBlJTc7+T81lDAytoyatrTLruyLdHWZ4JB2K h3dnM/sa+hOuv/OXkbfEBnF22tz0RUpkvtlsztlTIaCyrop7VOpe4sBqwRDNSYEvaDyh SV6Fvzio2HSW8bzC8xLXc4818drko6nabS8ON5aUe5mqfUAVZHtafBN3r997m8IacqVS o1Gr5DqCE5ETr62vCQUkQRyRXMvtCPTYE/HVmA5YKNp7ui8qQE97kv987n4sN+YOqRHN ZBYw== X-Gm-Message-State: ABy/qLaa9lIRmUIv0aKnVPZiE2wlKBWd2JmXqt+3W6Qv7/1AxD0gxIoe y6ehY3BaeAOs51+wcnYbodnvlAWbIA52aOcYQcaZQPrJ4WvP/nRiDS7+EtUiNkhh1JLL98WGdIp 87k+y1uikSk9adRcvwB/VgCKx X-Received: by 2002:a05:622a:1a27:b0:403:cb17:c108 with SMTP id f39-20020a05622a1a2700b00403cb17c108mr12984343qtb.24.1690802229052; Mon, 31 Jul 2023 04:17:09 -0700 (PDT) X-Received: by 2002:a05:622a:1a27:b0:403:cb17:c108 with SMTP id f39-20020a05622a1a2700b00403cb17c108mr12984294qtb.24.1690802228754; Mon, 31 Jul 2023 04:17:08 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id o18-20020ac85552000000b00403bf34266csm3426262qtr.30.2023.07.31.04.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 04:17:08 -0700 (PDT) From: Valentin Schneider To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 11/20] objtool: Flesh out warning related to pv_ops[] calls In-Reply-To: <20230728153334.myvh5sxppvjzd3oz@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-12-vschneid@redhat.com> <20230728153334.myvh5sxppvjzd3oz@treble> Date: Mon, 31 Jul 2023 12:16:59 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 28/07/23 10:33, Josh Poimboeuf wrote: > On Thu, Jul 20, 2023 at 05:30:47PM +0100, Valentin Schneider wrote: >> I had to look into objtool itself to understand what this warning was >> about; make it more explicit. >> >> Signed-off-by: Valentin Schneider >> --- >> tools/objtool/check.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/objtool/check.c b/tools/objtool/check.c >> index 8936a05f0e5ac..d308330f2910e 100644 >> --- a/tools/objtool/check.c >> +++ b/tools/objtool/check.c >> @@ -3360,7 +3360,7 @@ static bool pv_call_dest(struct objtool_file *file, struct instruction *insn) >> >> list_for_each_entry(target, &file->pv_ops[idx].targets, pv_target) { >> if (!target->sec->noinstr) { >> - WARN("pv_ops[%d]: %s", idx, target->name); >> + WARN("pv_ops[%d]: indirect call to %s() leaves .noinstr.text section", idx, target->name); >> file->pv_ops[idx].clean = false; > > This is an improvement, though I think it still results in two warnings, > with the second not-so-useful warning happening in validate_call(). > > Ideally it would only show a single warning, I guess that would need a > little bit of restructuring the code. You're quite right - fabricating an artificial warning with a call to __flush_tlb_local(): vmlinux.o: warning: objtool: pv_ops[1]: indirect call to native_flush_tlb_local() leaves .noinstr.text section vmlinux.o: warning: objtool: __flush_tlb_all_noinstr+0x4: call to {dynamic}() leaves .noinstr.text section Interestingly the second one doesn't seem to have triggered the "pv_ops" bit of call_dest_name. Seems like any call to insn_reloc(NULL, x) will return NULL. Trickling down the file yields: vmlinux.o: warning: objtool: pv_ops[1]: indirect call to native_flush_tlb_local() leaves .noinstr.text section vmlinux.o: warning: objtool: __flush_tlb_all_noinstr+0x4: call to pv_ops[0]() leaves .noinstr.text section In my case (!PARAVIRT_XXL) pv_ops should look like: [0]: .cpu.io_delay [1]: .mmu.flush_tlb_user() so pv_ops[1] looks right. Seems like pv_call_dest() gets it right because it uses arch_dest_reloc_offset(). If I use the above to fix up validate_call(), would we still need pv_call_dest() & co? > > -- > Josh