KVM: VMX: Avoid to rdmsrl(MSR_IA32_SYSENTER_ESP)
authorLai Jiangshan <laijs@linux.alibaba.com>
Thu, 18 Nov 2021 11:08:01 +0000 (19:08 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:25:04 +0000 (04:25 -0500)
commit6ab8a4053f7114d130fe1f3485d71efec20f5806
tree50ac917d7b3c86bd9936bc3168328564be8bea29
parent24cd19a28cb7174df502162641d6e1e12e7ffbd9
KVM: VMX: Avoid to rdmsrl(MSR_IA32_SYSENTER_ESP)

The value of host MSR_IA32_SYSENTER_ESP is known to be constant for
each CPU: (cpu_entry_stack(cpu) + 1) when 32 bit syscall is enabled or
NULL is 32 bit syscall is not enabled.

So rdmsrl() can be avoided for the first case and both rdmsrl() and
vmcs_writel() can be avoided for the second case.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20211118110814.2568-3-jiangshanlai@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c