Re: [RFC PATCH v1 5/5] KVM: Remove kvm_rebooting and its references

Xin Li
2025-09-17T16:52:47Z

On 9/16/2025 10:56 AM, Sean Christopherson wrote:
> On Tue, Sep 09, 2025, Xin Li (Intel) wrote:
>> Drop kvm_rebooting and all related uses. Virtualization is now disabled
>> immediately before a CPU shuts down, eliminating any chance of executing
>> virtualization instructions during reboot.
>
> Wrong. KVM clears EFER.SVME in reponse to kvm_shutdown(), and thus can trip
> #UDs on e.g. VMRUN.
>

This patch assumes that AMD SVM enable/disable has been moved to the CPU
startup and shutdown routines. Accordingly, kvm_shutdown() no longer
clears EFER.SVME, and the patch demonstrates the resulting simplification
from removing kvm_rebooting. However, as noted in the cover letter, no
actual modifications were made to AMD SVM.

Is this what seems wrong to you?

Thanks!
Xin