Skip to contentSkip to conversation

[5310] 64 bit truncation in code_gen_buffer_size calculation (Jes Sorensen)

Qemu-devel Anthony Liguori 1 participant 1 message Sep 24, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5310

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5310
Author:   aliguori
Date:     2008-09-24 14:10:36 +0000 (Wed, 24 Sep 2008)

Log Message:
-----------
64 bit truncation in code_gen_buffer_size calculation (Jes Sorensen)

Don't truncate code_gen_buffer_size calculation to int, as it will give unpredicted results on 64 bit systems when booting large guests.

Modified Paths:
--------------
trunk/exec.c

Modified: trunk/exec.c
===================================================================

exec.c +1 -1
@@ -410,7 +410,7 @@
         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)