On Wed, Nov 09, 2022, Paolo Bonzini wrote:
FILL_RETURN_BUFFER can access percpu data, therefore vmload of the host save area must be executed first. First of all, move the VMCB vmsave/vmload to assembly, essentially undoing commit fb0c4a4fee5a ("KVM:
Nit, similar to adding parantheses to function names, I prefer capitalizing instruction mnemonics, i.e. VMSAVE and VMLOAD, to make it obvious that you're referring to a specific instruction as opposed to a theme/flow.
SVM: move VMLOAD/VMSAVE to C code", 2021-03-15). The reason for that commit was that it made it simpler to use a different VMCB for VMLOAD/VMSAVE versus VMRUN; but that is not a big hassle anymore thanks to the kvm-asm-offsets machinery.
The idea on how to number the exception tables is stolen from a prototype patch by Peter Zijlstra.
Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Link: https://lore.kernel.org/all/f571e404-e625-bae1-10e9-449b2eb4cbd8@citrix.com/ Signed-off-by: Paolo Bonzini pbonzini@redhat.com
Reviewed-by: Sean Christopherson seanjc@google.com