KVM: vmx: Inject #GP on invalid PAT CR
authorNadav Amit <namit@cs.technion.ac.il>
Thu, 18 Sep 2014 19:39:44 +0000 (22:39 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:17 +0000 (18:32 +0000)
commit418b97fee96c77e7de226f40f3341bba987206a7
tree99e81019f1dfc866612d5b77d0136d0edbbe1c30
parentcc5eec0dbfe38a4b2c1eb21ccc2aa3cef8edbc20
KVM: vmx: Inject #GP on invalid PAT CR

commit 4566654bb9be9e8864df417bb72ceee5136b6a6a upstream.

Guest which sets the PAT CR to invalid value should get a #GP.  Currently, if
vmx supports loading PAT CR during entry, then the value is not checked.  This
patch makes the required check in that case.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h