]> git.proxmox.com Git - qemu.git/commitdiff
64 bit truncation in code_gen_buffer_size calculation (Jes Sorensen)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 24 Sep 2008 14:10:36 +0000 (14:10 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 24 Sep 2008 14:10:36 +0000 (14:10 +0000)
Don't truncate code_gen_buffer_size calculation to int, as it will give
unpredicted results on 64 bit systems when booting large guests.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5310 c046a42c-6fe2-441c-8c8c-71466251a162

exec.c

diff --git a/exec.c b/exec.c
index 31374daa55dca04c9a6de1f2e8fcdeb230093313..cb9a7eb34c8d48aff7054ed851f7f96d2ce39340 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -410,7 +410,7 @@ static void code_gen_alloc(unsigned long tb_size)
         code_gen_buffer_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
 #else
         /* XXX: needs ajustments */
-        code_gen_buffer_size = (int)(phys_ram_size / 4);
+        code_gen_buffer_size = (unsigned long)(phys_ram_size / 4);
 #endif
     }
     if (code_gen_buffer_size < MIN_CODE_GEN_BUFFER_SIZE)