summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-02-06 19:34:57 -0600
committerLouis Burda <quent.burda@gmail.com>2023-02-06 19:34:57 -0600
commit15554c668705bcbaa9da3fbf2a1efe45bb42adc4 (patch)
tree3c3cd73e4df4c4489b851b664d245a694de175b5
parent93ddfc5c264338ed8c8e7cb0940e2c9c70e5b64c (diff)
downloadcachepc-linux-15554c668705bcbaa9da3fbf2a1efe45bb42adc4.tar.gz
cachepc-linux-15554c668705bcbaa9da3fbf2a1efe45bb42adc4.zip
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
-rw-r--r--arch/x86/kvm/svm/vmenter.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/vmenter.S b/arch/x86/kvm/svm/vmenter.S
index 1a3e83e5a277..01cf98e16b57 100644
--- 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