[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/7] libqos: Correct mask to align size to PAGE_
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 4/7] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc |
Date: |
Tue, 29 Jul 2014 22:10:06 +0100 |
On 24 July 2014 19:31, Marc Marí <address@hidden> wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Marc Marí <address@hidden>
> ---
> tests/libqos/malloc-pc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
> index db1496c..2efd095 100644
> --- a/tests/libqos/malloc-pc.c
> +++ b/tests/libqos/malloc-pc.c
> @@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t
> size)
>
>
> size += (PAGE_SIZE - 1);
> - size &= PAGE_SIZE;
> + size &= -PAGE_SIZE;
Do we have access to the osdep.h ROUND_UP macro from libqos?
If so, we could replace these two lines with
size = ROUND_UP(size, PAGE_SIZE);
thanks
-- PMM
- [Qemu-devel] [PATCH 3/7] libqtest: add QTEST_LOG for debugging qtest testcases, (continued)
- [Qemu-devel] [PATCH 3/7] libqtest: add QTEST_LOG for debugging qtest testcases, Marc Marí, 2014/07/24
- [Qemu-devel] [PATCH 5/7] libqos: Change free function called in malloc, Marc Marí, 2014/07/24
- [Qemu-devel] [PATCH 1/7] tests: Functions bus_foreach and device_find from libqos virtio API, Marc Marí, 2014/07/24
- [Qemu-devel] [PATCH 4/7] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc, Marc Marí, 2014/07/24
- [Qemu-devel] [PATCH 6/7] virtio-blk: Correct bug in support for flexible descriptor layout, Marc Marí, 2014/07/24
- [Qemu-devel] [PATCH 7/7] libqos: Added basic virtqueue support to virtio implementation, Marc Marí, 2014/07/24