public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] x86 emulator: Add into, int, and int3 instructions (opcodes 0xcc-0xce)
Date: Wed, 04 Aug 2010 09:21:43 +0300	[thread overview]
Message-ID: <4C5906F7.6020009@redhat.com> (raw)
In-Reply-To: <1280889892-25751-1-git-send-email-m.gamal005@gmail.com>

  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.


  reply	other threads:[~2010-08-04  6:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04  2:44 [PATCH 2/2] x86 emulator: Add into, int, and int3 instructions (opcodes 0xcc-0xce) Mohammed Gamal
2010-08-04  6:21 ` Avi Kivity [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-08-04 11:38 Mohammed Gamal
2010-08-05  9:25 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C5906F7.6020009@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox