]> rtime.felk.cvut.cz Git - jailhouse.git/commit
x86: Do not call vmload/vmsave on every VM exit
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 5 Apr 2015 09:55:07 +0000 (11:55 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 15 Apr 2015 07:53:58 +0000 (09:53 +0200)
commitf93e23934b7bca2f134cae3d99facfd891640c7e
treeb56a5bb84c9813cf6f70c1f47b2fe637ded6f346
parentee283bcf1818076662d897d489260f09d2b46c6c
x86: Do not call vmload/vmsave on every VM exit

Benchmarks indicate that we can gain about 160 cycles per VM exit &
reentry by only saving/restoring MSR_GS_BASE. We don't touch the other
states that vmload/vmsave deals with.

Specifically, we don't depend on a valid TR/TSS while in root mode
because Jailhouse has neither in userspace nor uses the IST for
interrupts or exceptions, thus does not try to access the TSS.

We still need to perform vmload on handover (actually, we only need to
load MSR_GS_BASE, but vmload is simpler) and after VCPU reset. And as we
no longer save the full state, also for shutdown, we need to pull the
missing information for arch_cpu_restore directly from the registers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/svm-vmexit.S
hypervisor/arch/x86/svm.c