From: Jes Sorensen <jes@sgi.com>
To: qemu-devel@nongnu.org, Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [patch] 64 bit truncation in code_gen_buffer_size calculation
Date: Wed, 24 Sep 2008 11:05:16 +0200 [thread overview]
Message-ID: <48DA02CC.9060802@sgi.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 246 bytes --]
Hi,
This one is pretty obvious, don't truncate the result of
code_gen_buffer_size calculation to int when the target is an unsigned
long. Gives funny results when trying to boot something with a lot of
memory on a 64 bit system.
Cheers,
Jes
[-- Attachment #2: 1199-code-gen-64bit.patch --]
[-- Type: text/plain, Size: 741 bytes --]
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>
---
exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: qemu/exec.c
===================================================================
--- qemu.orig/exec.c
+++ qemu/exec.c
@@ -410,7 +410,7 @@ static void code_gen_alloc(unsigned long
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)
next reply other threads:[~2008-09-24 9:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 9:05 Jes Sorensen [this message]
2008-09-24 14:09 ` [Qemu-devel] Re: [patch] 64 bit truncation in code_gen_buffer_size calculation Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DA02CC.9060802@sgi.com \
--to=jes@sgi.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).