qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] linux-user/mmap.c: Set prot page flags f


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 1/3] linux-user/mmap.c: Set prot page flags for the correct region in mmap_frag()
Date: Tue, 26 Jan 2016 10:26:42 +0000

On 26 January 2016 at 10:19, Chen Gang <address@hidden> wrote:
> When I run WeChat.exe with i386 wine with qemu-i386 under sw_64 arch.
>
>  - The related command:
>
>    "./i386-linux-user/qemu-i386 -strace -L /upstream/i386_wine 
> /upstream/i386_wine/usr/local/bin/wine "C:\\Program 
> Files\\Tencent\\WeChat\\WeChat.exe" > ana/try/info-strace.log 2>&1"
>
>  - The related output (no any munmap, 135168 = 128KB + 4KB):
>
>    4600 
> mmap2(0x00340000,135168,PROT_READ,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0) = 
> 0x00340000
>    4600 mmap2(0x00340000,135168,PROT_READ,MAP_SHARED|MAP_FIXED,8,0) = 
> 0x00340000
>    4600 rt_sigprocmask(SIG_SETMASK,0x0033f574,NULL) = 0
>    4600 rt_sigprocmask(SIG_BLOCK,0x7bced7e0,0x0033f5d0) = 0
>    4600 write(3,0x33f6cc,64) = 64
>    4600 read(4,0x33f6cc,64) = 1
>    4600 rt_sigprocmask(SIG_SETMASK,0x0033f5d0,NULL) = 0
>    4600 close(8) = 0
>    4600 rt_sigprocmask(SIG_BLOCK,0x7bced7e0,0x0033f674) = 0
>    4600 mprotect(0x00160000,65536,PROT_READ|PROT_WRITE) = 0
>    4600 rt_sigprocmask(SIG_SETMASK,0x0033f674,NULL) = 0
>    4600 rt_sigprocmask(SIG_BLOCK,0x7bced7e0,0x0033f990) = 0
>    4600 
> mmap2(0x00340000,135168,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED|MAP_NORESERVE,-1,0)
>  = 0x00340000
>
> wine often does like above, map the same position multiple times.

That output seems to show all the mmap calls working fine, though.

>> Reading the target_mmap() code, its intention seems to be:
>>  (a) if the whole allocation fits in one host page, call
>>      mmap_frag() once and then "goto the_end1"
>
> Also yes to me.
>
>>  (b) otherwise, we'll call mmap_frag() once for the start
>>      of the guest mapping, and once for the end, which must
>>      be two different host pages
>>
>
> Also yes to me.
>
>> So if you're seeing mmap_frag() called twice for the same
>> host page then something is going wrong, but I'm not sure what.
>>
>
> For the case I provide above, it can call mmap_frag() twice for the same
> host page.

For the same single call to target_mmap() ? What is the code flow
within QEMU that causes this?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]