]> 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)
commit2e207fd9671b95fbc2ce770e7a38efedd745a5b1
treefc4a8f06af57bff2529a55dafc7918289827683e
parent42d73273f7aad20244b60de771c1dff177c65be9
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