KVM: SVM: adjust register allocation for __svm_vcpu_run()
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Oct 2022 21:30:07 +0000 (17:30 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 17:16:46 +0000 (12:16 -0500)
commitf7ef280132f9bf6f82acf5aa5c3c837206eef501
tree661b83bdff9781276aa6b07eee33780e8653bd41
parent16fdc1de169ee0a4e59a8c02244414ec7acd55c3
KVM: SVM: adjust register allocation for __svm_vcpu_run()

32-bit ABI uses RAX/RCX/RDX as its argument registers, so they are in
the way of instructions that hardcode their operands such as RDMSR/WRMSR
or VMLOAD/VMRUN/VMSAVE.

In preparation for moving vmload/vmsave to __svm_vcpu_run(), keep
the pointer to the struct vcpu_svm in %rdi.  In particular, it is now
possible to load svm->vmcb01.pa in %rax without clobbering the struct
vcpu_svm pointer.

No functional change intended.

Cc: stable@vger.kernel.org
Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/vmenter.S