From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAqal-0001Op-K9 for qemu-devel@nongnu.org; Sun, 20 Dec 2015 21:52:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAqai-0001UR-EW for qemu-devel@nongnu.org; Sun, 20 Dec 2015 21:52:55 -0500 Received: from out11.biz.mail.alibaba.com ([205.204.114.131]:39462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAqah-0001UN-VB for qemu-devel@nongnu.org; Sun, 20 Dec 2015 21:52:52 -0500 References: <5673A718.40103@emindsoft.com.cn> <5673ACFA.6060900@emindsoft.com.cn> <5673D4BD.4080305@vivier.eu> <5673E459.7030901@emindsoft.com.cn> From: Chen Gang Message-ID: <56776841.2060003@emindsoft.com.cn> Date: Mon, 21 Dec 2015 10:47:29 +0800 MIME-Version: 1.0 In-Reply-To: <5673E459.7030901@emindsoft.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Notice about lock bitmask translation for fcntl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , riku.voipio@iki.fi Cc: Peter Maydell , qemu-devel , Richard Henderson On 2015年12月18日 18:47, Chen Gang wrote: > > On 2015年12月18日 17:41, Laurent Vivier wrote: >> >> Le 18/12/2015 07:51, Chen Gang a écrit : [...] >>> >>> +++ b/linux-user/mmap.c >>> @@ -567,6 +567,10 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, >>> printf("\n"); >>> #endif >>> tb_invalidate_phys_range(start, start + len); >>> + if ((prot & PROT_WRITE) && (flags & MAP_ANONYMOUS) >>> + && ((flags & MAP_PRIVATE) || (fd == -1))) { >>> + memset(g2h(start), 0, len); >>> + } >> >> IMHO, their kernel needs a fix, mmap(2): >> >> MAP_ANONYMOUS >> The mapping is not backed by any file; its contents are initial‐ >> ized to zero. >> Oh, sorry, after check again, it is not kernel's issue: mmap() will always zero the ANONYMOUS memory for kernel 3.8 in sw_64 arch. It is still our qemu's issue in mmap_frag (do not zero ANONYMOUS memory fragments), so I sent patch v2 for it, please help check. Thanks. > > OK, Thanks. > > -- Chen Gang (陈刚) Open, share, and attitude like air, water, and life which God blessed