16.04.2012 16:31, Bart Oldeman wrote:
> For x86-64 dosemu jumps to DPMI code using the "iretl" instruction
> that is valid in userland and pops all of eip, cs, eflags, esp, and ss
> (that's its behaviour in long mode). However, if the popped cs is a
> selector to a 16-bit PM segment, the high 16 bits of esp don't change
> (the famous CPU issue). So we want them to be zero. Any 47-bit value
> of rsp=xxxx0000xxxx is fine.
Oh my, thats a real shit. :((
Then maybe you should at least check whether the saved
value was actually zero, and print an error if not.
There is a more reliable workaround that I implemented
in the kernel. You can use stack at any address, but with a
special LDT-entry, which base is adjusted every time according
to the value of the saved ESP, so that the needed bits in the
RSP to match them. I'd say its a shit too, but at least it will
allow to restore the precise value, and will avoid the need for
searching of the right page...

>  The loop tries to mmap 0x100000000 which
> usually works but if this address was already mapped before it tries
> higher addresses. (an alternative method is to parse /proc/self/maps).
:(
I agree that parsing /proc/self/maps just for that, was of a
questionable benefit.

But: this all is very questionable.
I mean, there is a kernel, which will trash ESP asynchronously
anyway. So was there any use to do all that recovery to just
have the ESP screwed up by the kernel a microsecond later?
Of course if there is a hope to have an in-kernel workaround too,
then yes.

Hmm... how was this not a problem before? I think, before it
was done with LSS. Is it possible to just do it again, with good
old LSS?

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dosemu-devel

Reply via email to