[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/8] hw/dma: Introduce dma_size_t type definition
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 7/8] hw/dma: Introduce dma_size_t type definition |
Date: |
Tue, 4 Jan 2022 09:50:56 +0100 |
On Mon, Jan 3, 2022 at 11:22 AM David Hildenbrand <david@redhat.com> wrote:
> > /*
> > * When an IOMMU is present, bus addresses become distinct from
> > * CPU/memory physical addresses and may be a different size. Because
> > @@ -39,9 +28,22 @@ struct QEMUSGList {
> > * least most) cases.
> > */
> > typedef uint64_t dma_addr_t;
> > +typedef uint64_t dma_size_t;
>
> This is a bit inconsistent with other address types (hwaddr,
> ram_addr_t), no?
Indeed.
> -> git grep "_size_t"
>
> What sticks out are "external" mach_vm_size_t and png_size_t.
>
> To me, it logically makes sense that both types are equal, because we're
> operating on the same address space (with the same size).
>
> So at least I don't see the benefit here, but I'd love to be enlightened :)
No, you are right, I was not convinced either. I'll stick to dma_addr_t.