On Friday 24 March 2006 03:30, Jeff Dike wrote:
> On Fri, Mar 24, 2006 at 01:56:32AM +0100, Blaisorblade wrote:
> > I don't think it's easy - however, it can be done. Below my idea - Jeff,
> > please comment on this

> > In assembly.
> > It goes like this:

> > call label /*this is coded like a relative jump, i.e. call +1*/
> > label: pop $eax /*we got the saved EIP*/
> >
> > /* Now we can round EIP and subtract an offset to calculate the data page
> > location.
> > */

> How does this give us the location of the data page?

The EIP is inside the stub code page, and the two pages are one near the 
other.

> You really want to know the end of the process address space, which
> you can do by taking the address of a convenient local and rounding up
> to the nearest 1G or .5G or so.

You can't do that in the stub; however, what you suggest or something similar 
is probably needed outside the stub, from the kernel code, when you need to 
map it somewhere inside the process memory.

However, currently, the rounding can't be 0.5G, it must be 0.25G with the 
current code, and it's still fragile if the host code is changed.

(arch/i386/Kconfig)
config PAGE_OFFSET
        hex
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0x78000000 if VMSPLIT_2G
        default 0x40000000 if VMSPLIT_1G
        default 0xC0000000

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

        

        
                
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to