On 04/20/2011 12:33 AM, Richard Henderson wrote:

> Did you try --enable-user-pie?  It may not really help, but I'm curious.

No. I don't think it will help because placement of the executable probably
doesn't account for how large its heap will grow.

You'll still run out of memory as the heap grows and runs into an 
LD_PRELOAD'ed shared object that's been mapped below 0x60000000, then crash
without your do_brk() MAP_FIXED patch, or fail with some error code with it.

> Honestly I'm not keen on this patch.  This level of obfuscation on the
> startup and memory map of the host binary is just a gross hack working
> around the lack of proper page tables in user mode.

This mechanism has been used in Wine for 6 years, but Wine doesn't have
any other way to guarantee the memory layout.

> If you really really need to get this working with a 32-bit host binary
> (rather than doing the sensible thing and using a 64-bit PIE binary),
> then working to enable CONFIG_SOFTMMU in user mode instead would be the
> most useful thing you could do.  Indeed, this would fix a number of 
> problems we currently have emulating other guests that have a page size
> different from the host.

Yes, having page tables in user mode emulation would help, but would
probably make the target executable considerably slower too.

thanks,

Mike

Reply via email to