]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Provide fpu_sync_guest_vmexit_xfd_state()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 5 Jan 2022 12:35:31 +0000 (04:35 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Jan 2022 18:44:42 +0000 (13:44 -0500)
commit41711d263f555c5492e840b8a2ce82b46a4feb3f
treee21623f2ebe688ffd588ca3faa369a9dd569a361
parentc4bd36ddce49268c03a41e077dfe3e95e451c6eb
x86/fpu: Provide fpu_sync_guest_vmexit_xfd_state()

KVM can disable the write emulation for the XFD MSR when the vCPU's fpstate
is already correctly sized to reduce the overhead.

When write emulation is disabled the XFD MSR state after a VMEXIT is
unknown and therefore not in sync with the software states in fpstate and
the per CPU XFD cache.

Provide fpu_sync_guest_vmexit_xfd_state() which has to be invoked after a
VMEXIT before enabling interrupts when write emulation is disabled for the
XFD MSR.

It could be invoked unconditionally even when write emulation is enabled
for the price of a pointless MSR read.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jing Liu <jing2.liu@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20220105123532.12586-21-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/fpu/api.h
arch/x86/kernel/fpu/core.c