Ulrich Weigand wrote:
>
> Kevin Lawton wrote:
>
> > So back to virtual flags. Since we can now virtualize
> > any instructions, we can trap on pushf/popf etc,
> > and don't necessarily need virtual flags.
>
> I'm not sure how this follows: sure, we can now trap on
> pushf/popf. But this means that we *do* need the virtual
> guest flags; after all, the code *emulating* pushf/popf
> will use/modify exactly those virtual flags ...
>
> (If it were to modify the *real* flags, why trap in the
> first place? ;-)
>
> In fact, virtual flags currently don't work correctly,
> *because* we can't yet trap pushf/popf.
>
> Or did I misunderstand your question?
If we emulate eflags reads/writes upon traps generated
on virtualized eflags-related instructions, then the
values in the real eflags register have nothing to
do with what the guest thinks. Eflags becomes just
a register that the guest code never sees.
So no, we don't have to use the virtual flags at all.
What I was looking to do, is to keep it simple for now,
and possibly omit the use of virtual flags. Then add them
in later if it gets us something.
-Kevin