Re: [PATCH] x86 emulator: Add IRET instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/26/2010 02:07 AM, Mohammed Gamal wrote:
On Mon, Jul 26, 2010 at 2:59 AM, Paolo Bonzini<pbonzini@xxxxxxxxxx>  wrote:
On 07/25/2010 09:20 PM, Mohammed Gamal wrote:

+       if (c->op_bytes == 4)
+               temp_eflags = ((temp_eflags & 0x257fd5) | (ctxt->eflags&
  0x1a0000));

Should this do also

if (c->op_bytes == 2)
    temp_eflags = ((temp_eflags & 0x7fd5) | (ctxt->eflags & ~0xffffL));

?

I don't think this is needed. The temp_eflags value is assigned
directly to eflags if we're operand size is 16 bits. At least that's
what the Intel manual says!

That's fine, but please make sure that

  mov %sp, %bp
  orw $2, 4(%bp)
  iret

followed at return site by

  pushf
  popw %ax

does not set bit 1 in %ax. That's the important point (also see how emulate_popf avoids magic hex constants).

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux