]> git.baikalelectronics.ru Git - kernel.git/commit
KVM, pkeys: save/restore PKRU when guest/host switches
authorXiao Guangrong <guangrong.xiao@linux.intel.com>
Tue, 22 Mar 2016 08:51:18 +0000 (16:51 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Mar 2016 15:21:06 +0000 (16:21 +0100)
commit668887bbe4fe1a6cc11eaad8d459821e9075eb92
treefc4a8f06af57bff2529a55dafc7918289827683e
parent09c4a6acb214cabc473a62ef1e1e0acbc5ce724c
KVM, pkeys: save/restore PKRU when guest/host switches

Currently XSAVE state of host is not restored after VM-exit and PKRU
is managed by XSAVE so the PKRU from guest is still controlling the
memory access even if the CPU is running the code of host. This is
not safe as KVM needs to access the memory of userspace (e,g QEMU) to
do some emulation.

So we save/restore PKRU when guest/host switches.

Signed-off-by: Huaitong Han <huaitong.han@intel.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c