]> git.baikalelectronics.ru Git - kernel.git/commit
KVM/VMX: Avoid stack engine synchronization uop in __vmx_vcpu_run
authorUros Bizjak <ubizjak@gmail.com>
Tue, 16 Aug 2022 21:10:10 +0000 (23:10 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Sep 2022 16:02:27 +0000 (12:02 -0400)
commitef35d94e9f191430c37bb4d4162d029006cab3a6
tree030017137ed2e238cd2677e6453cfea264844b69
parent54f5ed6f0abd32b44b6ed311f30ebb1a3abe0873
KVM/VMX: Avoid stack engine synchronization uop in __vmx_vcpu_run

Avoid instructions with explicit uses of the stack pointer between
instructions that implicitly refer to it. The sequence of
POP %reg; ADD $x, %RSP; POP %reg forces emission of synchronization
uop to synchronize the value of the stack pointer in the stack engine
and the out-of-order core.

Using POP with the dummy register instead of ADD $x, %RSP results in a
smaller code size and faster code.

The patch also fixes the reference to the wrong register in the
nearby comment.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/r/20220816211010.25693-1-ubizjak@gmail.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmenter.S