public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error
@ 2023-02-22  7:33 Randy Dunlap
  2023-02-22 14:15 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-02-22  7:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Vineeth Pillai, Paolo Bonzini, Vitaly Kuznetsov,
	Sean Christopherson, kvm

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) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error
  2023-02-22  7:33 [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error Randy Dunlap
@ 2023-02-22 14:15 ` Vitaly Kuznetsov
  2023-02-22 16:18   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Kuznetsov @ 2023-02-22 14:15 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Randy Dunlap, Vineeth Pillai, Paolo Bonzini, Sean Christopherson,
	kvm

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.

-- 
Vitaly


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error
  2023-02-22 14:15 ` Vitaly Kuznetsov
@ 2023-02-22 16:18   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-02-22 16:18 UTC (permalink / raw)
  To: Vitaly Kuznetsov, linux-kernel
  Cc: Vineeth Pillai, Paolo Bonzini, Sean Christopherson, kvm



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.
-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-22 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-22  7:33 [PATCH] KVM: SVM: hyper-v: placate modpost section mismatch error Randy Dunlap
2023-02-22 14:15 ` Vitaly Kuznetsov
2023-02-22 16:18   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox