]> rtime.felk.cvut.cz Git - jailhouse.git/commit
x86: Bring host CR4 into well-defined state during setup
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 18 Mar 2015 07:39:19 +0000 (08:39 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Sat, 21 Mar 2015 14:14:37 +0000 (15:14 +0100)
commit0254c6cec7a8f6212848b118a6aeb60d8d4eccb4
treeec4049bfcd3ac0b244e81616dc2bb175c4edd871
parent427ff407c1ae4d8c2acfe657974f54b240c4af1b
x86: Bring host CR4 into well-defined state during setup

Analogously to CR0: Avoid any uncertainty about the state of CR4 left
behind by Linux: check for unexpectedly set reserved bits or required-1
bits, and otherwise set our own state.

A side effect of this change is the VMX's vcpu_exit will no longer clear
VMXE in CR4 but only in the cached Linux state that arch_cpu_restore
will write back.

CC: 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/include/asm/vcpu.h
hypervisor/arch/x86/setup.c
hypervisor/arch/x86/svm.c
hypervisor/arch/x86/vmx.c