Re: [PATCH 07/17] KVM: monolithic: x86: adjust the section prefixes

Paolo Bonzini
2019-09-25T12:32:10Z

On 25/09/19 14:13, Andrea Arcangeli wrote:
>
> The __exit removed from unsetup is because kvm_arch_hardware_unsetup
> is called by kvm_init, so unless somehow kvm_init can go in the exit
> section and be dropped too during the final kernel link (which would
> prevent KVM to initialize in the first place at kernel boot), it's not
> feasible to call a function located in the exit section and dropped
> during the kernel link from there.
>
> As far as I can tell with upstream KVM if you hit the
> kvm_arch_hardware_unsetup function during kvm_init error path it'll
> crash the kernel at boot because of it.
>
> Removing __exit fixes that potential upstream crash and upstream bug.

You're right.

> The comment header was short, I'll add more commentary to the commit
> header to reduce the confusion about why removing __exit is needed.

Yes, thanks!

Paolo