Message ID | 20230222073315.9081-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp438623wrd; Tue, 21 Feb 2023 23:41:23 -0800 (PST) X-Google-Smtp-Source: AK7set+PemP6DO3ftqF3zMC1RG3EM3VoF63gk5Ys4vxbbfiv58hbnTvPTFvaG6Yq0vqnYKMqTDA1 X-Received: by 2002:aa7:9798:0:b0:593:da8:6f34 with SMTP id o24-20020aa79798000000b005930da86f34mr8100055pfp.5.1677051683612; Tue, 21 Feb 2023 23:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677051683; cv=none; d=google.com; s=arc-20160816; b=Zl6eyUD+Q0xJ4rBy1mn0eHOiJTO/GQAGSg1SJhiQNGSnYjCO5Ay1Mr9XCEc6g/lZN0 dHdlCW0SQB/+CTzXDjfqGiuwky6Ip/qbpJ6gaL7Lqv92sL1Z03ayQoq2TIx0MftiisMv 1eNq3ogDow7txxRyTj26K372KWE0jpgGDX6BLndWSTlIl9dwPGhuv/rHuZ95hZ/Fz/ch NOi1VtHJHx7/01mr8kPXUnMK14Stc/ezcIYvDBhVPDzxro+i10xs+5QP4PdkCTw9Jx1O myP/jHo36Zv996Rf1mNUzz7B60wRt/5FvHxRgJUjDTpFlWj/9VDwcBlw0pKJBMysN1oL J31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7frTxIZFv6V8GcZJSwPPjJonPyC8OEzNtnJ8xaSDdjY=; b=b2IcS2XHb4jtGxXBYqjElbXuqUbmMyQtmF/h4g95OdWdHF2Vu/agq4bDK2p6OeEbFM drGi633gN4ryrhWLouNAnG7WIAPKyvc/jsyMceoDHEmgF5bF2cm7rs4BueX5Pww8dHIP Hg34Qq5F75Ywkgbh4pmvDoKCRjmyyAKIsFPTHGjEn98xvYFZppK4d59dtP7coTiJFrsv OYu6ZhEr02zYh2xlZWpa2j0AesFnWzxwgfPZ/4wF0rZByKjafAHti9J7V6Eh94qeEk4V ArM479yt6coQZ7CZT8z0cIDQCdLYL9WmjZ9xT8SdgyfMxYQPWHYkQ7Ns9hrShjkHxzhD 6v0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=E5kGRER7; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020aa79f42000000b005a8aba4acdfsi19778813pfr.79.2023.02.21.23.41.10; Tue, 21 Feb 2023 23:41:23 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=E5kGRER7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbjBVHdU (ORCPT <rfc822;hanasaki@gmail.com> + 99 others); Wed, 22 Feb 2023 02:33:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbjBVHdS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Feb 2023 02:33:18 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 820C9189; Tue, 21 Feb 2023 23:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=7frTxIZFv6V8GcZJSwPPjJonPyC8OEzNtnJ8xaSDdjY=; b=E5kGRER7UUdajQ4OvY+g7lA3ND 8TnbP4LsKimWd3IMfWKY/sm1xzuswDZQegXTQn0NEy3yyet7AdazYIS3DSlqQZTToOFjxCrNbin6j pRfb1qfpQjZSy+lSE5HI7rqs8apf+nSbtf8SuUIOfdV5Zd/qkhICGt7rTjEDxRwXXPpPfLV/FKzUc 245rSeVmBnyetiNTKtLbq3uhW3nvS4NEPn4H3fRyGHZUxN0JzQCF9haOXTsalgvYhmEu+1VOeCY2y J+QygSSzO0oZNaRNSXgG6cQSaOJEDmbpNOL2rt+susiVLqDzfuO6mz+/3oFk+xHu7+U0nVtp/XKk3 haC1cs1g==; Received: from [2601:1c2:980:9ec0::df2f] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUjcq-00B5lK-Jg; Wed, 22 Feb 2023 07:33:16 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org>, Vineeth Pillai <viremana@linux.microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, Sean Christopherson <seanjc@google.com>, kvm@vger.kernel.org Subject: [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error Date: Tue, 21 Feb 2023 23:33:15 -0800 Message-Id: <20230222073315.9081-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758516145904583012?= X-GMAIL-MSGID: =?utf-8?q?1758516145904583012?= |
Series |
KVM: SVM: hyper-v: placate modpost section mismatch error
|
|
Commit Message
Randy Dunlap
Feb. 22, 2023, 7:33 a.m. UTC
modpost reports section mismatch errors/warnings:
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
Marking svm_hv_hardware_setup() as __init fixes the warnings.
I don't know why this should be needed -- it seems like a compiler
problem to me since the calling function is marked as __init.
This "(unknown) (section: .init.data)" all refer to svm_x86_ops.
Fixes: 1e0c7d40758b ("KVM: SVM: hyper-v: Remote TLB flush for SVM")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineeth Pillai <viremana@linux.microsoft.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org
---
arch/x86/kvm/svm/svm_onhyperv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Randy Dunlap <rdunlap@infradead.org> writes: > modpost reports section mismatch errors/warnings: > WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) > WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) > WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) > > Marking svm_hv_hardware_setup() as __init fixes the warnings. > > I don't know why this should be needed -- it seems like a compiler > problem to me since the calling function is marked as __init. > > This "(unknown) (section: .init.data)" all refer to svm_x86_ops. > > Fixes: 1e0c7d40758b ("KVM: SVM: hyper-v: Remote TLB flush for SVM") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Vineeth Pillai <viremana@linux.microsoft.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Vitaly Kuznetsov <vkuznets@redhat.com> > Cc: Sean Christopherson <seanjc@google.com> > Cc: kvm@vger.kernel.org > --- > arch/x86/kvm/svm/svm_onhyperv.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff -- a/arch/x86/kvm/svm/svm_onhyperv.h b/arch/x86/kvm/svm/svm_onhyperv.h > --- a/arch/x86/kvm/svm/svm_onhyperv.h > +++ b/arch/x86/kvm/svm/svm_onhyperv.h > @@ -30,7 +30,7 @@ static inline void svm_hv_init_vmcb(stru > hve->hv_enlightenments_control.msr_bitmap = 1; > } > > -static inline void svm_hv_hardware_setup(void) > +static inline __init void svm_hv_hardware_setup(void) > { > if (npt_enabled && > ms_hyperv.nested_features & HV_X64_NESTED_ENLIGHTENED_TLB) { > There's a second empty svm_hv_hardware_setup() implementation 50 lines below in the same file for !if IS_ENABLED(CONFIG_HYPERV) case and I think it needs to be marked as '__init' as well.
On 2/22/23 06:15, Vitaly Kuznetsov wrote: > Randy Dunlap <rdunlap@infradead.org> writes: > >> modpost reports section mismatch errors/warnings: >> WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) >> WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) >> WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data) >> >> Marking svm_hv_hardware_setup() as __init fixes the warnings. >> >> I don't know why this should be needed -- it seems like a compiler >> problem to me since the calling function is marked as __init. >> >> This "(unknown) (section: .init.data)" all refer to svm_x86_ops. >> >> Fixes: 1e0c7d40758b ("KVM: SVM: hyper-v: Remote TLB flush for SVM") >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >> Cc: Vineeth Pillai <viremana@linux.microsoft.com> >> Cc: Paolo Bonzini <pbonzini@redhat.com> >> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> >> Cc: Sean Christopherson <seanjc@google.com> >> Cc: kvm@vger.kernel.org >> --- >> arch/x86/kvm/svm/svm_onhyperv.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff -- a/arch/x86/kvm/svm/svm_onhyperv.h b/arch/x86/kvm/svm/svm_onhyperv.h >> --- a/arch/x86/kvm/svm/svm_onhyperv.h >> +++ b/arch/x86/kvm/svm/svm_onhyperv.h >> @@ -30,7 +30,7 @@ static inline void svm_hv_init_vmcb(stru >> hve->hv_enlightenments_control.msr_bitmap = 1; >> } >> >> -static inline void svm_hv_hardware_setup(void) >> +static inline __init void svm_hv_hardware_setup(void) >> { >> if (npt_enabled && >> ms_hyperv.nested_features & HV_X64_NESTED_ENLIGHTENED_TLB) { >> > > There's a second empty svm_hv_hardware_setup() implementation 50 lines > below in the same file for !if IS_ENABLED(CONFIG_HYPERV) case and I > think it needs to be marked as '__init' as well. > I saw that. I can make that change also. I was optimistic that since it is empty, gcc would not be fooled by it. v2 later today. thanks.
diff -- a/arch/x86/kvm/svm/svm_onhyperv.h b/arch/x86/kvm/svm/svm_onhyperv.h --- a/arch/x86/kvm/svm/svm_onhyperv.h +++ b/arch/x86/kvm/svm/svm_onhyperv.h @@ -30,7 +30,7 @@ static inline void svm_hv_init_vmcb(stru hve->hv_enlightenments_control.msr_bitmap = 1; } -static inline void svm_hv_hardware_setup(void) +static inline __init void svm_hv_hardware_setup(void) { if (npt_enabled && ms_hyperv.nested_features & HV_X64_NESTED_ENLIGHTENED_TLB) {