Re: [PATCH 4/8] KVM: SVM: move guest vmsave/vmload to assembly

From: Paolo Bonzini
Date: Mon Nov 07 2022 - 10:41:38 EST


On 11/7/22 16:23, Peter Zijlstra wrote:
+3: vmrun %_ASM_AX
+4:
+ cli
+ /* Pop @svm to RAX while it's the only available register. */
pop %_ASM_AX
/* Save all guest registers. */
So Andrew noted that once the vmload has executed any exception taken
(say at 3) will crash and burn because %gs is scribbled.

Might be good to make a record of this in the code so it can be cleaned
up some day.


Yeah, it won't happen because clgi/stgi blocks setting kvm_rebooting so I thought of killing the three exception fixups after the first. In the end I kept them for simplicity and to keep the normal/SEV-ES versions as similar as possible.

Paolo