]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - arch/x86/kvm/vmx.c
KVM: nVMX: VMX instructions: add checks for #GP/#SS exceptions
authorEugene Korenevsky <ekorenevsky@gmail.com>
Fri, 17 Apr 2015 02:22:21 +0000 (02:22 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Jul 2015 06:26:39 +0000 (08:26 +0200)
commitf9eb4af67c9dde195bae965a86c35c35402249c0
treefab333824144143d7ed92295575e85efd8e60bc2
parent0da029ed7ee5fdf49a2a0e14160c3e9999be9292
KVM: nVMX: VMX instructions: add checks for #GP/#SS exceptions

According to Intel SDM several checks must be applied for memory operands
of VMX instructions.

Long mode: #GP(0) or #SS(0) depending on the segment must be thrown
if the memory address is in a non-canonical form.

Protected mode, checks in chronological order:
- The segment type must be checked with access type (read or write) taken
into account.
For write access: #GP(0) must be generated if the destination operand
is located in a read-only data segment or any code segment.
For read access: #GP(0) must be generated if if the source operand is
located in an execute-only code segment.
- Usability of the segment must be checked. #GP(0) or #SS(0) depending on the
segment must be thrown if the segment is unusable.
- Limit check. #GP(0) or #SS(0) depending on the segment must be
thrown if the memory operand effective address is outside the segment
limit.

Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c