On 10/01/2015 02:33 AM, Aurelien Jarno wrote:
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 <r...@twiddle.net>
---
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.
I don't believe that it can happen at the moment, given the size of the current
"safe margin". But the subject came up during review, and I thought we should
indeed do something about it.
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.
You're right. I had thought that we tested page_check_range on the given
address in user-mode before passing it on to the guest.
In any case, that's how to fix the problem you indicate...
r~