From: Michael Tokarev <mjt@tls.msk.ru>
To: Avi Kivity <avi@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Jan Kiszka <jan.kiszka@web.de>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] kvm: align ram_size to page boundary
Date: Fri, 06 Jul 2012 22:50:11 +0400 [thread overview]
Message-ID: <4FF73363.1080409@msgid.tls.msk.ru> (raw)
In-Reply-To: <4FDDD818.4030700@redhat.com>
On 17.06.2012 17:14, Avi Kivity wrote:
> On 06/17/2012 04:06 PM, Blue Swirl wrote:
>
>>> strtosz() is much too general. We could do it in vl.c without trouble.
>>> However, it takes away our ability to emulate a "640k should be enough
>>> for everyone" machine.
>>
>> Then how about current max of target page sizes: 8k? No machine should
>> want less than that.
>
> Okay by me, but I can hear the we-should-have-a-generic-mechanism crowd
> charging their megaphone batteries.
So, is there some bottom line in that? I think I'll put a (temp)
fix/workaround for the debian package to require memory size to be
a multiple of 8K, and to produce a warning if that requiriment hasn't
met.
Something like this:
diff --git a/vl.c b/vl.c
index 5d9fc55..db98a4a 100644
--- a/vl.c
+++ b/vl.c
@@ -2671,7 +2675,15 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "qemu: ram size too large\n");
exit(1);
}
- ram_size = value;
+#define RAM_SIZE_GRANULARITY (8*1024)
+ ram_size = value / RAM_SIZE_GRANULARITY;
+ ram_size *= RAM_SIZE_GRANULARITY;
+ if (ram_size != value) {
+ fprintf(stderr,
+ "warning: requested memory size (%" PRIu64 " bytes) "
+ "truncated to %" PRIu64 " bytes\n",
+ value, (uint64_t)ram_size);
+ }
break;
}
case QEMU_OPTION_mempath:
With this patch, running
qemu-system-x86_64 -m 1.4g
produces the following:
warning: requested memory size (1503238553 bytes) truncated to 1503232000 bytes
Thanks,
/mjt
prev parent reply other threads:[~2012-07-06 18:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-17 8:47 [PATCH] kvm: align ram_size to page boundary Avi Kivity
2012-06-17 8:47 ` [Qemu-devel] " Avi Kivity
2012-06-17 11:03 ` Jan Kiszka
2012-06-17 11:03 ` [Qemu-devel] " Jan Kiszka
2012-06-17 11:30 ` Avi Kivity
2012-06-17 11:30 ` [Qemu-devel] " Avi Kivity
2012-06-17 11:47 ` Jan Kiszka
2012-06-17 11:47 ` [Qemu-devel] " Jan Kiszka
2012-06-17 11:51 ` Avi Kivity
2012-06-17 11:51 ` [Qemu-devel] " Avi Kivity
2012-06-17 12:43 ` Blue Swirl
2012-06-17 12:43 ` [Qemu-devel] " Blue Swirl
2012-06-17 12:48 ` Peter Maydell
2012-06-17 12:48 ` Peter Maydell
2012-06-17 12:54 ` Avi Kivity
2012-06-17 12:54 ` [Qemu-devel] " Avi Kivity
2012-06-17 13:06 ` Blue Swirl
2012-06-17 13:06 ` [Qemu-devel] " Blue Swirl
2012-06-17 13:14 ` Avi Kivity
2012-06-17 13:14 ` [Qemu-devel] " Avi Kivity
2012-07-06 18:50 ` Michael Tokarev [this message]
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=4FF73363.1080409@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.