]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: block guest protection keys unless the host has them enabled
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Aug 2017 09:59:31 +0000 (11:59 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Aug 2017 07:28:02 +0000 (09:28 +0200)
commite3fde2b4d5e3a2c7bac65d4b310160a9358517c8
treeb29e228414a3b176926a4860918444d34b5565b6
parentcf294fe0243f44e04d563c8a3c8bf05129bb9198
KVM: x86: block guest protection keys unless the host has them enabled

If the host has protection keys disabled, we cannot read and write the
guest PKRU---RDPKRU and WRPKRU fail with #GP(0) if CR4.PKE=0.  Block
the PKU cpuid bit in that case.

This ensures that guest_CR4.PKE=1 implies host_CR4.PKE=1.

Fixes: 2e207fd9671b95fbc2ce770e7a38efedd745a5b1
Cc: stable@vger.kernel.org
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c