From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhKL5-00071F-3Y for qemu-devel@nongnu.org; Wed, 30 Sep 2015 12:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhKL1-0006Hm-17 for qemu-devel@nongnu.org; Wed, 30 Sep 2015 12:34:42 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:58558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhKL0-0006HN-Ro for qemu-devel@nongnu.org; Wed, 30 Sep 2015 12:34:38 -0400 Date: Wed, 30 Sep 2015 18:33:55 +0200 From: Aurelien Jarno Message-ID: <20150930163355.GC17449@aurel32.net> References: <1443589786-26929-1-git-send-email-rth@twiddle.net> <1443589786-26929-25-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443589786-26929-25-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v4 24/26] tcg: Allocate a guard page after code_gen_buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org On 2015-09-30 15:09, Richard Henderson wrote: > This will catch any overflow of the buffer. > > Add a native win32 alternative for alloc_code_gen_buffer; > remove the malloc alternative. > > Signed-off-by: Richard Henderson > --- > translate-all.c | 210 ++++++++++++++++++++++++++++++++------------------------ > 1 file changed, 119 insertions(+), 91 deletions(-) I havent reviewed the patch in details, but I wonder if that could really happen? Given the size of the code generation buffer (a few MB at least), I don't think it's a problem if we don't use it to the last kB, and thus we could keep some safe margin if needed. Also what happens if an overflow really happens? In softmmu mode a segmentation fault will happen. In user-mode I guess the fault will be forwarded to the guest process, so this will likely wrongly be interpreted as a bug in the guest code. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net