[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks
From: |
Peter Xu |
Subject: |
Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks |
Date: |
Thu, 2 Sep 2021 18:32:10 -0400 |
On Thu, Sep 02, 2021 at 03:14:30PM +0200, David Hildenbrand wrote:
> diff --git a/migration/migration.c b/migration/migration.c
> index bb909781b7..ae97c2c461 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -391,7 +391,7 @@ int
> migrate_send_rp_message_req_pages(MigrationIncomingState *mis,
> int migrate_send_rp_req_pages(MigrationIncomingState *mis,
> RAMBlock *rb, ram_addr_t start, uint64_t haddr)
> {
> - void *aligned = (void *)(uintptr_t)(haddr & (-qemu_ram_pagesize(rb)));
> + void *aligned = (void *)QEMU_ALIGN_DOWN(haddr, qemu_ram_pagesize(rb));
Is uintptr_t still needed? I thought it would generate a warning otherwise but
not sure.
Also, maybe ROUND_DOWN() is better? QEMU_ALIGN_DOWN is the slow version for
arbitrary numbers.
--
Peter Xu
- [PATCH v4 0/9] migration/ram: Optimize for virtio-mem via RamDiscardManager, David Hildenbrand, 2021/09/02
- [PATCH v4 1/9] memory: Introduce replay_discarded callback for RamDiscardManager, David Hildenbrand, 2021/09/02
- [PATCH v4 2/9] virtio-mem: Implement replay_discarded RamDiscardManager callback, David Hildenbrand, 2021/09/02
- [PATCH v4 3/9] migration/ram: Don't passs RAMState to migration_clear_memory_region_dirty_bitmap_*(), David Hildenbrand, 2021/09/02
- [PATCH v4 4/9] migration/ram: Handle RAMBlocks with a RamDiscardManager on the migration source, David Hildenbrand, 2021/09/02
- [PATCH v4 5/9] virtio-mem: Drop precopy notifier, David Hildenbrand, 2021/09/02
- [PATCH v4 6/9] migration/postcopy: Handle RAMBlocks with a RamDiscardManager on the destination, David Hildenbrand, 2021/09/02
- [PATCH v4 7/9] migration: Simplify alignment and alignment checks, David Hildenbrand, 2021/09/02
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks,
Peter Xu <=
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks, David Hildenbrand, 2021/09/03
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks, David Hildenbrand, 2021/09/03
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks, David Hildenbrand, 2021/09/03
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks, Peter Xu, 2021/09/03
- Re: [PATCH v4 7/9] migration: Simplify alignment and alignment checks, David Hildenbrand, 2021/09/03
[PATCH v4 8/9] migration/ram: Factor out populating pages readable in ram_block_populate_pages(), David Hildenbrand, 2021/09/02