All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 03/14] KVM: x86 emulator: implement DAS (opcode 2F)
Date: Sun, 22 Aug 2010 15:21:08 +0300	[thread overview]
Message-ID: <4C711634.5060809@redhat.com> (raw)
In-Reply-To: <1282479506-3740-4-git-send-email-avi@redhat.com>

  On 08/22/2010 03:18 PM, Avi Kivity wrote:
> Signed-off-by: Avi Kivity<avi@redhat.com>
> ---
>   arch/x86/kvm/emulate.c |   37 ++++++++++++++++++++++++++++++++++++-
>   1 files changed, 36 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index f6f93b9..4cbc884 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -2176,6 +2176,40 @@ static int em_push(struct x86_emulate_ctxt *ctxt)
>   	return X86EMUL_CONTINUE;
>   }
>
> +static int em_das(struct x86_emulate_ctxt *ctxt)
> +{
> +	struct decode_cache *c =&ctxt->decode;
> +	u8 al, old_al;
> +	bool af, cf, old_cf;
> +
> +	cf = ctxt->eflags&  X86_EFLAGS_CF;
> +	al = c->dst.val;
> +
> +	old_al = al;
> +	old_cf = cf;
> +	cf = false;
> +	af = ctxt->eflags&  X86_EFLAGS_AF;
> +	if ((al&  0x0f)>  9 || af) {
> +		al -= 6;
> +		cf = old_cf | (al>= 250);
> +		af = true;
> +	} else {
> +		af = false;
> +	}
> +	if (old_al>  0x99 || old_cf) {
> +		al -= 0x60;
> +		cf = true;
> +	}
> +
> +	c->dst.val = al;
> +	ctxt->eflags&= ~(X86_EFLAGS_AF | X86_EFLAGS_CF);
> +	if (cf)
> +		ctxt->eflags |= X86_EFLAGS_CF;
> +	if (af)
> +		ctxt->eflags |= X86_EFLAGS_AF;
> +	return X86EMUL_CONTINUE;
> +}
> +

Missing the following hunk:

      }

      c->dst.val = al;
+    /* Set PF, ZF, SF */
+    c->src.type = OP_IMM;
+    c->src.val = 0;
+    c->src.bytes = 1;
+    emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags);
      ctxt->eflags &= ~(X86_EFLAGS_AF | X86_EFLAGS_CF);
      if (cf)
          ctxt->eflags |= X86_EFLAGS_CF;


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-08-22 12:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-22 12:18 [PATCH 00/14] More instruction emulations Avi Kivity
2010-08-22 12:18 ` [PATCH 01/14] KVM: x86 emulator: pass destination type to ____emulate_2op() Avi Kivity
2010-08-22 12:18 ` [PATCH 02/14] KVM: x86 emulator: Use a register for ____emulate_2op() destination Avi Kivity
2010-08-22 12:18 ` [PATCH 03/14] KVM: x86 emulator: implement DAS (opcode 2F) Avi Kivity
2010-08-22 12:21   ` Avi Kivity [this message]
2010-08-22 12:18 ` [PATCH 04/14] KVM: x86 emulator: implement CALL FAR (FF /3) Avi Kivity
2010-08-22 12:18 ` [PATCH 05/14] KVM: x86 emulator: add SrcImmU16 operand type Avi Kivity
2010-08-22 12:18 ` [PATCH 06/14] KVM: x86 emulator: implement RET imm16 (opcode C2) Avi Kivity
2010-08-22 12:18 ` [PATCH 07/14] KVM: x86 emulator: implement IMUL REG, R/M, imm8 (opcode 6B) Avi Kivity
2010-08-22 12:18 ` [PATCH 08/14] KVM: x86 emulator: implement IMUL REG, R/M (opcode 0F AF) Avi Kivity
2010-08-22 12:18 ` [PATCH 09/14] KVM: x86 emulator: remove SrcImplicit Avi Kivity
2010-08-22 12:18 ` [PATCH 10/14] KVM: x86 emulator: implement RDTSC (opcode 0F 31) Avi Kivity
2010-08-22 12:18 ` [PATCH 11/14] KVM: x86 emulator: consolidate immediate decode into a function Avi Kivity
2010-08-22 12:18 ` [PATCH 12/14] KVM: x86 emulator: add Src2Imm decoding Avi Kivity
2010-08-22 12:18 ` [PATCH 13/14] KVM: x86 emulator: implement IMUL REG, R/M, IMM (opcode 69) Avi Kivity
2010-08-22 12:18 ` [PATCH 14/14] KVM: x86 emulator: implement CWD (opcode 99) 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=4C711634.5060809@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.