Commit 174a9a1fe06aaf8df6bd6a3e874091cefedadbdd

Authored by aliguori
1 parent c21bbcfa

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.

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
Showing 1 changed file with 1 additions and 1 deletions
... ... @@ -410,7 +410,7 @@ static void code_gen_alloc(unsigned long tb_size)
410 410 code_gen_buffer_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
411 411 #else
412 412 /* XXX: needs ajustments */
413   - code_gen_buffer_size = (int)(phys_ram_size / 4);
  413 + code_gen_buffer_size = (unsigned long)(phys_ram_size / 4);
414 414 #endif
415 415 }
416 416 if (code_gen_buffer_size < MIN_CODE_GEN_BUFFER_SIZE)
... ...