summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx/nested.c
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2018-12-20 12:25:16 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2018-12-21 12:02:43 +0100
commit051a2d3e59e51ae49fd56aef34e472832897ce46 (patch)
treea6c583cfe78711a8d9e579f1e1861a20725c640b /arch/x86/kvm/vmx/nested.c
parentc6ad45973380af5ef43b708a54d7475d93f86638 (diff)
KVM: VMX: Explicitly reference RCX as the vmx_vcpu pointer in asm blobs
Use '%% " _ASM_CX"' instead of '%0' to dereference RCX, i.e. the 'struct vcpu_vmx' pointer, in the VM-Enter asm blobs of vmx_vcpu_run() and nested_vmx_check_vmentry_hw(). Using the symbolic name means that adding/removing an output parameter(s) requires "rewriting" almost all of the asm blob, which makes it nearly impossible to understand what's being changed in even the most minor patches. Opportunistically improve the code comments. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/nested.c')
-rw-r--r--arch/x86/kvm/vmx/nested.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index d839864aa8b0..da16f022a529 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2759,17 +2759,17 @@ static int __noclone nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu)
asm(
/* Set HOST_RSP */
__ex("vmwrite %%" _ASM_SP ", %%" _ASM_DX) "\n\t"
- "mov %%" _ASM_SP ", %c[host_rsp](%0)\n\t"
+ "mov %%" _ASM_SP ", %c[host_rsp](%% " _ASM_CX")\n\t"
/* Check if vmlaunch or vmresume is needed */
- "cmpl $0, %c[launched](%0)\n\t"
+ "cmpl $0, %c[launched](%% " _ASM_CX")\n\t"
"jne 1f\n\t"
__ex("vmlaunch") "\n\t"
"jmp 2f\n\t"
"1: " __ex("vmresume") "\n\t"
"2: "
/* Set vmx->fail accordingly */
- "setbe %c[fail](%0)\n\t"
+ "setbe %c[fail](%% " _ASM_CX")\n\t"
".pushsection .rodata\n\t"
".global vmx_early_consistency_check_return\n\t"