]> 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)
commitdc949c0bfe7d79402f0b11e264e92089545e2441
tree79005a4f1775c033f1bd4c500b6381578f8e6ae5
parentfc95ae263be68490b2f71828b2f751bc7c323db5
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