repository: /home/avi/kvm/linux-2.6
branch: master
commit 924894fc582925140ed0648b3ca54af6df69d02e
Author: Avi Kivity <[EMAIL PROTECTED]>
Date:   Tue Nov 27 19:14:21 2007 +0200

    KVM: x86 emulator: unify two switches
    
    The rep prefix cleanup left two switch () statements next to each other.
    Unify them.
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index f03b1f8..859cd27 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -1546,31 +1546,6 @@ special_insn:
        case 0x9d: /* popf */
                c->dst.ptr = (unsigned long *) &ctxt->eflags;
                goto pop_instruction;
-       case 0xc3: /* ret */
-               c->dst.ptr = &c->eip;
-               goto pop_instruction;
-       case 0xf4:              /* hlt */
-               ctxt->vcpu->halt_request = 1;
-               goto done;
-       case 0xf5:      /* cmc */
-               /* complement carry flag from eflags reg */
-               ctxt->eflags ^= EFLG_CF;
-               c->dst.type = OP_NONE;  /* Disable writeback. */
-               break;
-       case 0xf8: /* clc */
-               ctxt->eflags &= ~EFLG_CF;
-               c->dst.type = OP_NONE;  /* Disable writeback. */
-               break;
-       case 0xfa: /* cli */
-               ctxt->eflags &= ~X86_EFLAGS_IF;
-               c->dst.type = OP_NONE;  /* Disable writeback. */
-               break;
-       case 0xfb: /* sti */
-               ctxt->eflags |= X86_EFLAGS_IF;
-               c->dst.type = OP_NONE;  /* Disable writeback. */
-               break;
-       }
-       switch (c->b) {
        case 0xa4 ... 0xa5:     /* movs */
                c->dst.type = OP_MEM;
                c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
@@ -1659,6 +1634,9 @@ special_insn:
        case 0xae ... 0xaf:     /* scas */
                DPRINTF("Urk! I don't handle SCAS.\n");
                goto cannot_emulate;
+       case 0xc3: /* ret */
+               c->dst.ptr = &c->eip;
+               goto pop_instruction;
        case 0xe8: /* call (near) */ {
                long int rel;
                switch (c->op_bytes) {
@@ -1678,7 +1656,7 @@ special_insn:
                 * emulate_push() save value in size of c->op_bytes, therefore
                 * we are setting it now to be the size of eip so all the value
                 * of eip will be saved
-                */ 
+                */
                c->op_bytes = c->ad_bytes;
                emulate_push(ctxt);
                break;
@@ -1688,8 +1666,26 @@ special_insn:
                JMP_REL(c->src.val);
                c->dst.type = OP_NONE; /* Disable writeback. */
                break;
-
-
+       case 0xf4:              /* hlt */
+               ctxt->vcpu->halt_request = 1;
+               goto done;
+       case 0xf5:      /* cmc */
+               /* complement carry flag from eflags reg */
+               ctxt->eflags ^= EFLG_CF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;
+       case 0xf8: /* clc */
+               ctxt->eflags &= ~EFLG_CF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;
+       case 0xfa: /* cli */
+               ctxt->eflags &= ~X86_EFLAGS_IF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;
+       case 0xfb: /* sti */
+               ctxt->eflags |= X86_EFLAGS_IF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;
        }
        goto writeback;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to