[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 06/12] net: cadence_gem: Add support for sele
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v1 06/12] net: cadence_gem: Add support for selecting the DMA MemoryRegion |
Date: |
Mon, 8 Oct 2018 13:26:38 +0100 |
On 6 October 2018 at 00:14, Philippe Mathieu-Daudé <address@hidden> wrote:
> Hi Edgar,
>
> On 03/10/2018 17:07, Edgar E. Iglesias wrote:
>> From: "Edgar E. Iglesias" <address@hidden>
>>
>> Add support for selecting the Memory Region that the GEM
>> will do DMA to.
>> @@ -1500,6 +1506,13 @@ static void gem_realize(DeviceState *dev, Error
>> **errp)
>> CadenceGEMState *s = CADENCE_GEM(dev);
>> int i;
>>
>> + if (s->dma_mr) {
>> + s->dma_as = g_malloc0(sizeof(AddressSpace));
>> + address_space_init(s->dma_as, s->dma_mr, NULL);
>> + } else {
>> + s->dma_as = &address_space_memory;
>> + }
>
> This is not the first time I see this if() block.
>
> Should we consider refactor it?
Given that there are only three users of the device in the tree,
I think the nicest cleanup would be to make those callers pass
in a suitable MemoryRegion (which could just be the system memory
MR), and make the "dma" property of the device mandatory to set.
We can do that as followup, though.
thanks
-- PMM
- Re: [Qemu-devel] [PATCH v1 03/12] net: cadence_gem: Use uint32_t for 32bit descriptor words, (continued)
- [Qemu-devel] [PATCH v1 04/12] net: cadence_gem: Add macro with max number of descriptor words, Edgar E. Iglesias, 2018/10/03
- [Qemu-devel] [PATCH v1 05/12] net: cadence_gem: Add support for extended descriptors, Edgar E. Iglesias, 2018/10/03
- [Qemu-devel] [PATCH v1 06/12] net: cadence_gem: Add support for selecting the DMA MemoryRegion, Edgar E. Iglesias, 2018/10/03
- [Qemu-devel] [PATCH v1 07/12] net: cadence_gem: Implement support for 64bit descriptor addresses, Edgar E. Iglesias, 2018/10/03
- [Qemu-devel] [PATCH v1 08/12] net: cadence_gem: Announce 64bit addressing support, Edgar E. Iglesias, 2018/10/03
- [Qemu-devel] [PATCH v1 09/12] target-arm: powerctl: Enable HVC when starting CPUs to EL2, Edgar E. Iglesias, 2018/10/03