Mohammed Gamal wrote:
This patch adds 'cld' and 'std' instructions to the emulator


I presume for big real mode?  Which guest wants it?

@@ -1755,6 +1755,14 @@ special_insn:
                ctxt->eflags |= X86_EFLAGS_IF;
                c->dst.type = OP_NONE;       /* Disable writeback. */
                break;
+       case 0xfc: /* cld */
+               ctxt->eflags &= ~EFLG_DF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;
+       case 0xfd: /* std */
+               ctxt->eflags |= EFLG_DF;
+               c->dst.type = OP_NONE;  /* Disable writeback. */
+               break;

You need to add non-zero entries in opcode_table[] for this to work. Also, why disable writeback? If there is not DstSomething in opcode_table[], c->dst.type will be OP_NONE anyway.

I would like to see test cases for emulator changes. See users/test/x86/emulator.c. Of course, right now it is impossible to cause cld and std to execute in the emulator. But with the proposed invalid_guest_state() change, it should be easy to to cause this state and force emulation.

So how about adding optional invalid_guest_state() support (controlled by a module parameter), then start adding instructions and test cases, then removing the module parameter when everything works?

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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to