]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: SVM: Add VMRUN handler
authorAlexander Graf <agraf@suse.de>
Tue, 25 Nov 2008 19:17:07 +0000 (20:17 +0100)
committerAvi Kivity <avi@redhat.com>
Mon, 15 Dec 2008 12:49:38 +0000 (14:49 +0200)
commit27e20ba28398e9a6dd073685a780130f821c0f99
tree86597278e9110b67da82b4fd3e44f86c6801082b
parentce291aaccd9b3b84806dd4fab3d9fd13f2e37e45
KVM: SVM: Add VMRUN handler

This patch implements VMRUN. VMRUN enters a virtual CPU and runs that
in the same context as the normal guest CPU would run.
So basically it is implemented the same way, a normal CPU would do it.

We also prepare all intercepts that get OR'ed with the original
intercepts, as we do not allow a level 2 guest to be intercepted less
than the first level guest.

v2 implements the following improvements:

- fixes the CPL check
- does not allocate iopm when not used
- remembers the host's IF in the HIF bit in the hflags

v3:

- make use of the new permission checking
- add support for V_INTR_MASKING_MASK

v4:

- use host page backed hsave

v5:

- remove IOPM merging code

v6:

- save cr4 so PAE l1 guests work

v7:

- return 0 on vmrun so we check the MSRs too
- fix MSR check to use the correct variable

Acked-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/kvm_svm.h
arch/x86/kvm/svm.c