KVM: arm64: Fix section mismatches around hyp_cpu_pm_{init,exit}
PATCH 1/1 KVM: arm64: Fix section mismatches around hyp_cpu_pm_{init,exit}
Commit fa8c3d65538a ("KVM: arm64: Keep nVHE EL2 vector installed") inadvertently changed clang's inlining decisions around hyp_cpu_pm_{init,exit}, causing the following section mismatch warnings:
WARNING: modpost: vmlinux.o(.text+0x95c6c): Section mismatch in reference from the function kvm_arch_init() to the function .init.text:hyp_cpu_pm_exit()
The function kvm_arch_init() references
the function __init hyp_cpu_pm_exit().
This is often because kvm_arch_init lacks a __init annotation or the annotation of hyp_cpu_pm_exit is wrong.
WARNING: modpost: vmlinux.o(.text+0x97054): Section mismatch in reference from the function init_subsystems() to the function .init.text:hyp_cpu_pm_init()
The function init_subsystems() references
the function __init hyp_cpu_pm_init().
This is often because init_subsystems lacks a __init annotation or the annotation of hyp_cpu_pm_init is wrong.
Remove the __init annotation so that there are no warnings regardless of how functions are inlined.
--- arch/arm64/kvm/arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kvm/arm.c +2 -2
@@ -1574,12 +1574,12 @@ static struct notifier_block hyp_init_cpu_pm_nb = { .notifier_call = hyp_init_cpu_pm_notifier, }; -static void __init hyp_cpu_pm_init (void ) +static void hyp_cpu_pm_init (void ) {if (!is_protected_kvm_enabled ())cpu_pm_register_notifier (&hyp_init_cpu_pm_nb); } -static void __init hyp_cpu_pm_exit (void ) +static void hyp_cpu_pm_exit (void ) {if (!is_protected_kvm_enabled ())cpu_pm_unregister_notifier (&hyp_init_cpu_pm_nb);
base-commit: 5c8fe583cce542aa0b84adc939ce85293de36e5e
Signature · 1 line
2.30.0
Marc Zyngier
maintainerQuoted 20 lines · Nathan Chancellor
Commit
fa8c3d65538a("KVM: arm64: Keep nVHE EL2 vector installed") inadvertently changed clang's inlining decisions around hyp_cpu_pm_{init,exit}, causing the following section mismatch warnings:WARNING: modpost:
vmlinux.o(.text+0x95c6c): Section mismatch in reference from the functionkvm_arch_init()to the function .init.text:hyp_cpu_pm_exit()
The functionkvm_arch_init()references
the function__inithyp_cpu_pm_exit().
This is often becausekvm_arch_initlacks a__initannotation or the annotation ofhyp_cpu_pm_exitis wrong.WARNING: modpost:
vmlinux.o(.text+0x97054): Section mismatch in reference from the functioninit_subsystems()to the function .init.text:hyp_cpu_pm_init()
The functioninit_subsystems()references
the function__inithyp_cpu_pm_init().
This is often becauseinit_subsystemslacks a__initannotation or the annotation ofhyp_cpu_pm_initis wrong.
Quoted 8 lines
Remove the
__initannotation so that there are no warnings regardless of how functions are inlined.Fixes 1fcf7ce0c602 ("arm: kvm: implement CPU PM notifier")Fixes 06a71a24bae5 ("arm64: KVM: unregister notifiers in hyp modeteardown path")
Hi Nathan,
Already posted[1] last week.
Thanks,
M.
[1] htps://lore.kernel.org/r/[email protected]
Signature · 5 lines
Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 32 lines · Marc Zyngier
Quoted 20 lines · Nathan Chancellor
Commit
fa8c3d65538a("KVM: arm64: Keep nVHE EL2 vector installed") inadvertently changed clang's inlining decisions around hyp_cpu_pm_{init,exit}, causing the following section mismatch warnings:WARNING: modpost:
vmlinux.o(.text+0x95c6c): Section mismatch in reference from the functionkvm_arch_init()to the function .init.text:hyp_cpu_pm_exit()
The functionkvm_arch_init()references
the function__inithyp_cpu_pm_exit().
This is often becausekvm_arch_initlacks a__initannotation or the annotation ofhyp_cpu_pm_exitis wrong.WARNING: modpost:
vmlinux.o(.text+0x97054): Section mismatch in reference from the functioninit_subsystems()to the function .init.text:hyp_cpu_pm_init()
The functioninit_subsystems()references
the function__inithyp_cpu_pm_init().
This is often becauseinit_subsystemslacks a__initannotation or the annotation ofhyp_cpu_pm_initis wrong.Quoted 8 lines
Remove the
__initannotation so that there are no warnings regardless of how functions are inlined.Fixes 1fcf7ce0c602 ("arm: kvm: implement CPU PM notifier")Fixes 06a71a24bae5 ("arm64: KVM: unregister notifiers in hyp modeteardown path")
Hi Nathan,
Quoted 9 lines
Already posted[1] last week.
Thanks,
M.[1] htps://lore.kernel.org/r/[email protected]
Signature · 1 line
Jazz is not dead. It just smells funny...
Sorry for the duplicate, I am usually good at spotting that :(
Cheers,
Nathan