From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFU6U-0000yz-6Q for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:53:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFU6P-0000yI-O5 for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:53:21 -0500 Received: from [199.232.76.173] (port=33574 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFU6P-0000yB-KI for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:53:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6986) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFU6P-0002C9-9P for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:53:17 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB1ErGhN015692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Dec 2009 09:53:16 -0500 Message-ID: <4B152DD9.1080207@redhat.com> Date: Tue, 01 Dec 2009 15:53:13 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B150EAD.4050502@redhat.com> <4B15298B.90004@redhat.com> In-Reply-To: <4B15298B.90004@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Markus Armbruster , qemu-devel@nongnu.org On 12/01/09 15:34, Avi Kivity wrote: > On 12/01/2009 02:40 PM, Gerd Hoffmann wrote: >> >> Even more advanced: Make zero_length_malloc page-sized and >> page-aligned, then munmap int, so dereferencing it actually traps. > > That will cause vma fragmentation. I was thinking about a single unmapped page, which wouldn't cause fragmentation. But that is a bad idea too for other reasons ... cheers, Gerd