Skip to contentSkip to conversation

Unposted reserved_va patch

Qemu-devel Richard Henderson 2 participants 3 messages Jun 2, 2010 – Jun 3, 2010

lore
Share & tools
lore
#0 lore raw

Re: 68a1c816868b3e35a1da698af412b29e61b1948a

In general, I like the idea (especially since I've proposed it before. ;-)

However:

+ if (have_guest_base) {
+ flags |= MAP_FIXED;
+ }

I think this is broken. If the user specifies -G n -R m they're hoping or guessing that the range [n,n+m) is free. What they're not expecting is for the qemu application or any of the required shared libraries to get forcibly unmapped.

I think instead you should simply adjust the error reporting after the mmap attempt without MAP_FIXED.

r~

#1 lore raw
Quoted 10 lines

Re: 68a1c816868b3e35a1da698af412b29e61b1948a

In general, I like the idea (especially since I've proposed it before. ;-)

However:

(quoted diff) +3 -0
+        if (have_guest_base) {
+            flags |= MAP_FIXED;
+        }
Quoted 7 lines

I think this is broken. If the user specifies -G n -R m they're hoping or guessing that the range [n,n+m) is free. What they're not expecting is for the qemu application or any of the required shared libraries to get forcibly unmapped.

I think instead you should simply adjust the error reporting after the mmap attempt without MAP_FIXED.

Hmm, maybe. My reasoning was that this is consistent with the current behavior of the ELF loader. If you specify -G then the target application will be splatted at that address, regardless of whether it's already used by the host.

Paul

#2 lore raw
Quoted 3 lines · Paul Brook

Hmm, maybe. My reasoning was that this is consistent with the current behavior of the ELF loader. If you specify -G then the target application will be splatted at that address, regardless of whether it's already used by the host.

Well, sort-of. Before you removed PAGE_RESERVED we'd yield a very cryptic error message about mmap failed and exit.

r~