qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Stefan Berger <stefanb@linux.ibm.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH v2 1/3] misc: use QEMU_IS_ALIGNED
Date: Fri, 3 Jan 2020 08:43:16 +0100	[thread overview]
Message-ID: <2668c259-8ee9-06eb-9d7e-c09ca12aace4@redhat.com> (raw)
In-Reply-To: <20200103074000.1006389-2-marcandre.lureau@redhat.com>

On 1/3/20 8:39 AM, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   exec.c    | 4 ++--
>   roms/SLOF | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index d4b769d0d4..1feda49ca1 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3895,7 +3895,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length)
>   
>       uint8_t *host_startaddr = rb->host + start;
>   
> -    if ((uintptr_t)host_startaddr & (rb->page_size - 1)) {
> +    if (!QEMU_PTR_IS_ALIGNED(host_startaddr, rb->page_size)) {
>           error_report("ram_block_discard_range: Unaligned start address: %p",
>                        host_startaddr);
>           goto err;
> @@ -3903,7 +3903,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length)
>   
>       if ((start + length) <= rb->used_length) {
>           bool need_madvise, need_fallocate;
> -        if (length & (rb->page_size - 1)) {
> +        if (!QEMU_IS_ALIGNED(length, rb->page_size)) {
>               error_report("ram_block_discard_range: Unaligned length: %zx",
>                            length);
>               goto err;
> diff --git a/roms/SLOF b/roms/SLOF
> index 9546892a80..8ebf2f55e1 160000
> --- a/roms/SLOF
> +++ b/roms/SLOF
> @@ -1 +1 @@
> -Subproject commit 9546892a80d5a4c73deea6719de46372f007f4a6
> +Subproject commit 8ebf2f55e1ba1492b942ba4b682160e644fc0f98

Without the SLOF submodule update:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2020-01-03  7:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03  7:39 [PATCH v2 0/3] tpm: fix PPI RAM migration Marc-André Lureau
2020-01-03  7:39 ` [PATCH v2 1/3] misc: use QEMU_IS_ALIGNED Marc-André Lureau
2020-01-03  7:43   ` Philippe Mathieu-Daudé [this message]
2020-01-03  7:59     ` Marc-André Lureau
2020-01-03 10:21       ` Philippe Mathieu-Daudé
2020-01-03 16:36     ` Stefan Berger
2020-01-08 17:06     ` Paolo Bonzini
2020-01-08 18:55   ` Juan Quintela
2020-01-03  7:39 ` [PATCH v2 2/3] tpm-ppi: page-align PPI RAM Marc-André Lureau
2020-01-03 10:02   ` Dr. David Alan Gilbert
2020-01-03 16:38     ` Stefan Berger
2020-01-08 11:29     ` Dr. David Alan Gilbert
2020-01-08 12:49       ` Marc-André Lureau
2020-01-03  7:40 ` [PATCH v2 3/3] savevm: check RAM is pagesize aligned Marc-André Lureau
2020-01-03  7:43   ` Philippe Mathieu-Daudé
2020-01-08 12:47   ` Juan Quintela
2020-02-17 11:33     ` Marc-André Lureau
2020-02-27 18:41       ` Juan Quintela
2020-02-27 21:00         ` Aleksandar Markovic
2020-02-28  7:55           ` Juan Quintela
2020-02-28  9:09           ` Juan Quintela
2020-02-28 10:30             ` Aleksandar Markovic

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=2668c259-8ee9-06eb-9d7e-c09ca12aace4@redhat.com \
    --to=philmd@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.ibm.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 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).