qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] restoring eflags after iret on x86
@ 2008-09-07 14:02 Cohn, Robert S
  2008-09-08 16:22 ` malc
  0 siblings, 1 reply; 2+ messages in thread
From: Cohn, Robert S @ 2008-09-07 14:02 UTC (permalink / raw)
  To: qemu-devel

I am working with 0.9.1 sources and have seen a problem with restoring
eflags during an iret.

helper_ret_protected Does this:
    if (is_iret) {
        /* NOTE: 'cpl' is the _old_ CPL */
        eflags_mask = TF_MASK | AC_MASK | ID_MASK | RF_MASK | NT_MASK;
        if (cpl == 0)
            eflags_mask |= IOPL_MASK;
        iopl = (env->eflags >> IOPL_SHIFT) & 3;
        if (cpl <= iopl)
            eflags_mask |= IF_MASK;
        if (shift == 0)
            eflags_mask &= 0xffff;
        load_eflags(new_eflags, eflags_mask);
  }
  
My understanding is that it also needs to do:
env->cc_op = CC_OP_EFLAGS
  
Or else it will continue to use the old value of cc_op, which will not
be consistent with the value that was just stored into cc_src.
  
I looked at the trunk on svn and it appears to have the same problem. It
is strange that iret is broken in this way and no one else is seeing the
problem. Am I missing something?
  
Robert
  

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

end of thread, other threads:[~2008-09-08 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-07 14:02 [Qemu-devel] restoring eflags after iret on x86 Cohn, Robert S
2008-09-08 16:22 ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).