qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-stable@nongnu.org
Cc: alxchk@gmail.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] PING Re: [PATCH for-1.6] exec: fix writing to MMIO area with non-power-of-two length
Date: Fri, 30 Aug 2013 17:49:33 +0200	[thread overview]
Message-ID: <5220BF0D.7040002@redhat.com> (raw)
In-Reply-To: <1375100921-12990-1-git-send-email-pbonzini@redhat.com>

Il 29/07/2013 14:28, Paolo Bonzini ha scritto:
> The problem is introduced by commit 2332616 (exec: Support 64-bit
> operations in address_space_rw, 2013-07-08).  Before that commit,
> memory_access_size would only return 1/2/4.
> 
> Since alignment is already handled above, reduce l to the largest
> power of two that is smaller than l.
> 
> Reported-by: Oleksii Shevchuk <alxchk@gmail.com>
> Tested-by: Oleksii Shevchuk <alxchk@gmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  exec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/exec.c b/exec.c
> index c4f2894..e122c81 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1925,6 +1925,9 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
>      if (l > access_size_max) {
>          l = access_size_max;
>      }
> +    if (l & (l - 1)) {
> +        l = 1 << (qemu_fls(l) - 1);
> +    }
>  
>      return l;
>  }
> 

Ping, and adding qemu-stable.

Paolo

      parent reply	other threads:[~2013-08-30 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 12:28 [Qemu-devel] [PATCH for-1.6] exec: fix writing to MMIO area with non-power-of-two length Paolo Bonzini
2013-07-29 12:41 ` Peter Maydell
2013-07-29 13:47   ` Paolo Bonzini
2013-08-30 15:49 ` Paolo Bonzini [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=5220BF0D.7040002@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alxchk@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).