]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
commit39f062ff51b2a3bf9919bc74e575296f7e8cce1f
tree79005a4f1775c033f1bd4c500b6381578f8e6ae5
parentbe06b6bece19be5b167d863fd6c5271e4ec8f1fa
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