Two questions about RF bit in Rflags

刘冬华 <[email protected]> Tue, 16 Jan 2018 10:27:44 +0800
Newsgroups gmane.comp.emulators.bochs.devel
Message-ID <[email protected]>
Hi,

 

 

The Bochs is amazing software and I am a fan of yours.

 

I am studying the code related to RF bit. Here I have two questions about
setting and clearing RF bit to consult you.

And my questions are based on 17.3.1.1 in SDM said as below.

 

All Intel 64 and IA-32 processors manage the RF flag as follows. The RF Flag
is cleared at the start of the instruction

after the check for code breakpoint, CS limit violation and FP exceptions.
Task Switches and IRETD/IRETQ instructions

transfer the RF image from the TSS/stack to the EFLAGS register.

When calling an event handler, Intel 64 and IA-32 processors establish the
value of the RF flag in the EFLAGS image

pushed on the stack:

* For any fault-class exception except a debug exception generated in
response to an instruction breakpoint, the

value pushed for RF is 1.

* For any interrupt arriving after any iteration of a repeated string
instruction but the last iteration, the value

pushed for RF is 1.

* For any trap-class exception generated by any iteration of a repeated
string instruction but the last iteration,

the value pushed for RF is 1.

 

 

My questions:

 

Q1:  As SDM described, RF flag is cleared after the check for code
breakpoint for each instruction. 

      Could you tell me what Bochs does on this? I haven’t find how Bochs
implements this feature. Did I miss anything?

 

 

Q2:  As SDM described, the value pushed for RF is 1 on the conditions above
(red part).

      Could you tell me how Bochs handles this scenario? 

I haven’t find any actions to set RF in bochs code except fault-class
exception.

 

 

Thanks,

Cliff

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
bochs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bochs-developers