From: Orit Wasserman <owasserm@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, quintela@redhat.com,
qemu-devel@nongnu.org, avi@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap
Date: Wed, 31 Oct 2012 14:04:35 +0200 [thread overview]
Message-ID: <509113D3.9040404@redhat.com> (raw)
In-Reply-To: <CAFEAcA8mqupuSn09NnCTa=Xdy096Y6JLHcrFNyZ+4ThhKYm58A@mail.gmail.com>
On 10/31/2012 01:25 PM, Peter Maydell wrote:
> On 31 October 2012 12:19, Orit Wasserman <owasserm@redhat.com> wrote:
>> The number of bits is off by one, for example if last_ram_offset
>> is 0x1000 (the guest has one page) we get 0 bits instead of 1.
>>
>> Signed-off-by: Orit Wasserman <owasserm@redhat.com>
>> ---
>> arch_init.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch_init.c b/arch_init.c
>> index b75a4c5..a80c3c8 100644
>> --- a/arch_init.c
>> +++ b/arch_init.c
>> @@ -565,7 +565,7 @@ static void reset_ram_globals(void)
>> static int ram_save_setup(QEMUFile *f, void *opaque)
>> {
>> RAMBlock *block;
>> - int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
>> + int64_t ram_pages = (last_ram_offset() >> TARGET_PAGE_BITS) + 1;
>
> This will give you an extra bit if the last_ram_offset()
> is an exact multiple of the page size, though. Try
> int64_t ram_pages = DIV_ROUND_UP(last_ram_offset(), TARGET_PAGE_SIZE);
Good idea ...
> ?
>
> -- PMM
>
prev parent reply other threads:[~2012-10-31 12:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 11:19 [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap Orit Wasserman
2012-10-31 11:24 ` Avi Kivity
2012-10-31 12:00 ` Orit Wasserman
2012-10-31 11:25 ` Peter Maydell
2012-10-31 12:04 ` Orit Wasserman [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=509113D3.9040404@redhat.com \
--to=owasserm@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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.