]> rtime.felk.cvut.cz Git - jailhouse.git/commit
x86: Implement vcpu_[de]activate_vmm() for AMD-V
authorValentine Sinitsyn <valentine.sinitsyn@gmail.com>
Wed, 4 Jun 2014 18:31:12 +0000 (00:31 +0600)
committerJan Kiszka <jan.kiszka@siemens.com>
Sat, 1 Nov 2014 19:10:09 +0000 (20:10 +0100)
commitb818fad3aaed34d0e85c3a1ea4ef0a0361d6f886
treead87b087756efae4db51f175dceacb9087321813
parent5e3ddd37345e4b3ea8cfcb4f8870a790f9fe0c2a
x86: Implement vcpu_[de]activate_vmm() for AMD-V

Compared to VMX, vcpu_activate_vmm() and vcpu_deativate_vmm() for AMD-V
systems have several notable differences.

First, additional MSRs (part of VMCB but not VMCS) need to be set and
restored. Then, host state area is opaque in AMD-V, so vcpu_activate_vmm()
remembers host stack pointer and essentially begins a VMRUN/#VMEXIT loop
implemented in svm-vmexit.S. Third, as RAX register is part of VMCB, it is
copied to guest_regs on each VM exit and written back before VM entry.

As Jailhouse runs with GIF set, it needs to be cleared on VMM deactivation.

Signed-off-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/include/asm/percpu.h
hypervisor/arch/x86/svm-vmexit.S
hypervisor/arch/x86/svm.c