Re: [PATCH 2/2] x86 emulator: Add into, int, and int3 instructions (opcodes 0xcc-0xce)

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

 



 On 08/04/2010 05:44 AM, Mohammed Gamal wrote:
This adds support for int instructions to the emulator

@@ -2963,6 +3025,21 @@ special_insn:
  		if (rc != X86EMUL_CONTINUE)
  			goto done;
  		break;
+	case 0xcc:		/* int3 */
+		irq = 3;
+		goto do_interrupt;
+	case 0xcd:		/* int n */
+		irq = c->src.val;
+	do_interrupt:
+		rc = emulate_int(ctxt, ops, irq);
+		if (rc != X86EMUL_CONTINUE)
+			goto done;
+		break;
+	case 0xce:		/* into */
+		if (ctxt->eflags&  EFLG_OF) {
+			irq = 4;
+			goto do_interrupt;
+		}

If OF is clear, you fall through and emulate an IRET.

  	case 0xcf:		/* iret */
  		rc = emulate_iret(ctxt, ops);



--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
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