commit 15554c668705bcbaa9da3fbf2a1efe45bb42adc4
parent 93ddfc5c264338ed8c8e7cb0940e2c9c70e5b64c
Author: Louis Burda <quent.burda@gmail.com>
Date: Mon, 6 Feb 2023 19:34:57 -0600
fixup! Save registers to xmm to lower baseline counts and avoid timing issues with apic_oneshot
The cpu register state is cleared after vmrun in sev-es, as such we need to reload cpc_ds for probing and cpc_prime_probe. Since the access locations are constant, these extra loads will simply end up in the baseline. Additionally, the apic precision is not affected as the acceses happen *after* vmrun
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/svm/vmenter.S b/arch/x86/kvm/svm/vmenter.S
@@ -289,6 +289,10 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run)
1: vmrun %_ASM_AX
2: cli
+ # in sev-es the cpu register state is not restored after vmrun..
+ # xmm regs have been cleared so we need to do an extra accesses
+ movq cpc_ds_probe, %xmm8
+ movq cpc_prime_probe, %xmm14
wrap_probe sev_es_vcpu_run
#ifdef CONFIG_RETPOLINE