public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] (big) real mode emulation - jb
@ 2007-10-31  0:44 Nitin A Kamble
       [not found] ` <1193791471.9258.20.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Nitin A Kamble @ 2007-10-31  0:44 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 326 bytes --]

Hi Avi,	
  Attached is the patch to implement emulation of instruction:

jb (opcode 0xe3)

Please apply.
-- 
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open

[-- Attachment #1.1.2: 0005-Implement-emulation-of-instruction.patch --]
[-- Type: application/mbox, Size: 1624 bytes --]

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] (big) real mode emulation - jb
       [not found] ` <1193791471.9258.20.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
@ 2007-10-31  0:59   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-10-31  0:59 UTC (permalink / raw)
  To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w; +Cc: kvm-devel

Nitin A Kamble wrote:
> Hi Avi,	
>   Attached is the patch to implement emulation of instruction:
>
> jb (opcode 0xe3)
> [PATCH] Implement emulation of instruction jb (conditional jump) 
> opcodes: 0xe3
> From:
> Nitin A Kamble <nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>   To:
> Date:
> 2007-10-31 05:41
>    
> Signed-off-by: Nitin A Kamble <nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/kvm/x86_emulate.c |   25 ++++++++++++++++++++++++-
>  1 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index 579cfcf..1357355 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
> @@ -165,7 +165,7 @@ static u16 opcode_table[256] = {
>         /* 0xD8 - 0xDF */
>         0, 0, 0, 0, 0, 0, 0, 0,
>         /* 0xE0 - 0xE7 */
> -       0, 0, 0, 0, 0, 0, 0, 0,
> +       0, 0, 0, ImplicitOps, 0, 0, 0, 0,
>         /* 0xE8 - 0xEF */
>         ImplicitOps, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 
> 0, 0, 0,
>         /* 0xF0 - 0xF7 */
> @@ -1446,6 +1446,29 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, 
> struct x86_emulate_ops *ops)
>                 c->src.val = c->regs[VCPU_REGS_RCX];
>                 emulate_grp2(ctxt);
>                 break;
> +       case 0xe3 : /* jb */ {
> +               int rel = insn_fetch(s8, 1, c->eip);
> +               int condition = 0;
> +               if (test_cc(c->b, ctxt->eflags)) {
> +                       switch (c->op_bytes) {
> +                       case 2:
> +                               condition =
> +                                       (0 == *(u16 *) 
> &c->regs[VCPU_REGS_RCX]);
> +                               break;
> +                       case 4:
> +                               condition =
> +                                       (0 == *(u32 *) 
> &c->regs[VCPU_REGS_RCX]);
> +                               break;
> +                       case 8:
> +                               condition =
> +                                       (0 == *(u64 *) 
> &c->regs[VCPU_REGS_RCX]);
> +                               break;
> +                       }
> +               }
> +               if (condition)
> +                       JMP_REL(rel);
> +               break;
> +       }
>         case 0xf6 ... 0xf7:     /* Grp3 */
>                 rc = emulate_grp3(ctxt, ops);
>                 if (rc != 0)

This looks more like jcxz?

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-31  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31  0:44 [patch] (big) real mode emulation - jb Nitin A Kamble
     [not found] ` <1193791471.9258.20.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-10-31  0:59   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox