From: Avi Kivity <avi@redhat.com>
To: Bobby Powers <bobbypowers@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Anthony Liguori <anthony@codemonkey.ws>,
KVM list <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PULL] Urgent memory fix for kvm with unaligned memory slots
Date: Thu, 01 Mar 2012 19:03:19 +0200 [thread overview]
Message-ID: <4F4FABD7.1030709@redhat.com> (raw)
In-Reply-To: <CAArOQ2VQ9iSeWcAqK9pDH78SmC=Pzv_ErUbEqC9n57=aX7Y+Pg@mail.gmail.com>
On 03/01/2012 06:51 PM, Bobby Powers wrote:
> > /* kvm works in page size chunks, but the function may be called
> > with sub-page size and unaligned start address. */
> > - size = TARGET_PAGE_ALIGN(size);
> > - start_addr = TARGET_PAGE_ALIGN(start_addr);
> > + delta = TARGET_PAGE_ALIGN(size) - size;
> > + if (delta > size) {
> > + return;
> > + }
> > + start_addr += delta;
> > + size -= delta;
> > + size &= TARGET_PAGE_MASK;
> > + if (!size || (start_addr & ~TARGET_PAGE_MASK)) {
> > + return;
> > + }
> >
> > if (!memory_region_is_ram(mr)) {
> > return;
> > }
> >
> > - ram = memory_region_get_ram_ptr(mr) + section->offset_within_region;
> > + ram = memory_region_get_ram_ptr(mr) + section->offset_within_region
> > + delta;
>
> Am I crazy, or does this look wrong?
Could be both. Why do you thing it is wrong?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-01 17:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 13:40 [Qemu-devel] [PULL] Urgent memory fix for kvm with unaligned memory slots Avi Kivity
2012-03-01 16:51 ` Bobby Powers
2012-03-01 17:03 ` Avi Kivity [this message]
2012-03-01 17:08 ` Eric Blake
2012-03-01 17:11 ` Bobby Powers
2012-03-01 17:13 ` Avi Kivity
2012-03-02 13:23 ` 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=4F4FABD7.1030709@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=bobbypowers@gmail.com \
--cc=kvm@vger.kernel.org \
--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).