[Lguest] A Switcher question

Rusty Russell rusty at rustcorp.com.au
Thu Oct 7 11:26:41 EST 2010


On Thu, 7 Oct 2010 03:34:43 am Eviatar Khen wrote:
> Hi All,

Hi Eviatar!

> I hacked Lguest as part of a university project, and there is one main
> issue I haven't understood, and I would really appreciate if someone
> would answer me. 

Sure!

> In the end of the Guest -> Host switch, the %esp register is just above
> five registers: eip, cs, eflag, esp, ss. Then the "iret" instruction
> pops them out and the Guest starts running.

So if iret pops 5 things off the stack, what do you think puts 5 things
on the stack? :)

> What I don't understand is, before the switch back to the Host, where
> the Guest updates those five stack slots and the stack pointer to be
> above them?

The chip does it itself in response to an interrupt...

Hope that helps,
Rusty.


More information about the Lguest mailing list