From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 03/14] KVM: x86 emulator: implement DAS (opcode 2F) Date: Sun, 22 Aug 2010 15:21:08 +0300 Message-ID: <4C711634.5060809@redhat.com> References: <1282479506-3740-1-git-send-email-avi@redhat.com> <1282479506-3740-4-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1045 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752428Ab0HVMVK (ORCPT ); Sun, 22 Aug 2010 08:21:10 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7MCLAHP023348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 22 Aug 2010 08:21:10 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7MCL940032489 for ; Sun, 22 Aug 2010 08:21:09 -0400 In-Reply-To: <1282479506-3740-4-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/22/2010 03:18 PM, Avi Kivity wrote: > Signed-off-by: Avi Kivity > --- > 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