]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Generate #UD when memory operand is required
authorNadav Amit <namit@cs.technion.ac.il>
Wed, 26 Nov 2014 13:47:18 +0000 (15:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Dec 2014 14:29:04 +0000 (15:29 +0100)
commit128a7e2e2f21eb093bb2b68ae036ec4087ae15ea
tree79005a4f1775c033f1bd4c500b6381578f8e6ae5
parent4834b86c2982900d2a47889c2827e9c35c350dbb
KVM: x86: Generate #UD when memory operand is required

Certain x86 instructions that use modrm operands only allow memory operand
(i.e., mod012), and cause a #UD exception otherwise. KVM ignores this fact.
Currently, the instructions that are such and are emulated by KVM are MOVBE,
MOVNTPS, MOVNTPD and MOVNTI.  MOVBE is the most blunt example, since it may be
emulated by the host regardless of MMIO.

The fix introduces a new group for handling such instructions, marking mod3 as
illegal instruction.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c