x86_decode_insn succeeds with GroupMask flags when it should fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The unimplemented movdqa (66 0f 7f 07) instruction triggers a bug in
the x86 emulator.  The emulator should fail since the instruction is
unimplemented.   However the emulator thinks it is succeeding but we
keep re-executing the same instruction over and over.  top shows 100%
CPU utilization and perf top shows we're constantly running through
the x86 emulator in kvm.ko.

The problem is that ctxt->d != 0 even though the instruction is
unimplemented (N):

while (ctxt->d & GroupMask) {
    switch (ctxt->d & GroupMask) {
    ...  <-- opcode zeroed if instruction is unimplemented
    }

    ctxt->d &= ~(u64)GroupMask;  <-- only clears GroupMask
    ctxt->d |= opcode.flags;     <-- opcode.flags == 0, ctxt->d != 0
}

...

/* Unrecognised? */
if (ctxt->d == 0 || (ctxt->d & Undefined))  <-- always false
    return EMULATION_FAILED;

Stefan
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux