[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] misc: use QEMU_IS_ALIGNED
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH v2 1/3] misc: use QEMU_IS_ALIGNED |
Date: |
Fri, 3 Jan 2020 11:59:10 +0400 |
On Fri, Jan 3, 2020 at 11:43 AM Philippe Mathieu-Daudé
<address@hidden> wrote:
>
> On 1/3/20 8:39 AM, Marc-André Lureau wrote:
> > Signed-off-by: Marc-André Lureau <address@hidden>
> > ---
> > 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é <address@hidden>
oops, I think I should submit a git config proposal, for git commit -a
to exclude submodules, or warn loudly...
Or perhaps I should stop using -a.
[PATCH v2 3/3] savevm: check RAM is pagesize aligned, Marc-André Lureau, 2020/01/03