KVM, pkeys: expose CPUID/CR4 to guest
authorHuaitong Han <huaitong.han@intel.com>
Tue, 22 Mar 2016 08:51:21 +0000 (16:51 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Mar 2016 15:38:17 +0000 (16:38 +0100)
commitb9baba861489041b37b54fc7ee0b0006b5327151
tree28a3d76b7d602a2b886356b08097e82d4a7169ed
parentbe94f6b71067df47d623fc6c6983a8dee504fb4d
KVM, pkeys: expose CPUID/CR4 to guest

X86_FEATURE_PKU is referred to as "PKU" in the hardware documentation:
CPUID.7.0.ECX[3]:PKU. X86_FEATURE_OSPKE is software support for pkeys,
enumerated with CPUID.7.0.ECX[4]:OSPKE, and it reflects the setting of
CR4.PKE(bit 22).

This patch disables CPUID:PKU without ept, because pkeys is not yet
implemented for shadow paging.

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