Before I did the IF check, that was a problem but now it should be ok.
In your scenario, the IF flag would probably be found still to be set
so it would be (correctly) assumed that Windows 2000 was not waiting to
be turned off and qemu would continue normally.
On Wed, Mar 30, 2005 at 02:20:36PM +0200, Struan Bartlett wrote:
It subtracts one from the EIP (to find the address of
the previously-executed instruction) and examines the virtual memory
location pointed to. If the memory location contains 0xF4 (HLT) then it
examines the EFLAGS register. If the IF (Interrupt-enable) flag is
cleared, then one might in fact assume that Windows 2000 is sitting
there just waiting for you to turn it off. The assumption here is that
if interrupts are disabled then there is no way the processor's halt
state can be interrupted.
What happens if the previous instruction is a multi-byte instruction
that happens to have 0xf4 as its last byte?