]> rtime.felk.cvut.cz Git - jailhouse.git/commit
x86: Choose a hypercall instruction in run-time
authorValentine Sinitsyn <valentine.sinitsyn@gmail.com>
Mon, 1 Sep 2014 16:54:48 +0000 (22:54 +0600)
committerJan Kiszka <jan.kiszka@siemens.com>
Sat, 1 Nov 2014 19:10:01 +0000 (20:10 +0100)
commit7b602e3afdfa24ccb434d2f848d732c4e5e2cb21
tree66faa246c7b50eec640864e56c852d8c81f41013
parent3db48bd55cb7bc3eece6b3ed5bf6010806834269
x86: Choose a hypercall instruction in run-time

VMX and SVM use different instructions to make a hypercall (vmcall and
vmmcall, respectively). Jailhouse abstracts hypercall instructions with
inlined functions in jailhouse_hypercall.h, and these need to be able to
differentiate between VMX and SVM. For this reason, jailhouse_use_vmcall
global variable was introduced that is stored and filled by the driver.
Inmates will require similar initialization. This is left out as inmates
do not make use of hypercalls at this point.

As jailhouse_call_*() functions are never called on a CPU without VM
extensions (the driver checks if Jailhouse is enabled before issuing a
hypercall, and inmates do not run outside cells), it is safe to assume
that the CPU without VMX support is an SVM one.

Signed-off-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
[Jan: dropped inmate initialization,
      switched to bool for jailhouse_use_vmcall,
      refactored init_use_vmcall_flag to init_hypercall]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver.c
hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
hypervisor/arch/x86/include/asm/processor.h
hypervisor/arch/x86/vcpu.c