Re: [PATCH v2 2/3] s390/pci: store DMA offset in bus_dma_region

From: Matthew Rosato
Date: Mon Dec 16 2024 - 11:58:30 EST



>>> + map->cpu_start = 0;
>>> + map->dma_start = PAGE_ALIGN(zdev->start_dma);
>>> + map->size = (u64)virt_to_phys(high_memory);
>>
>> I don't think we should restrict the size here to the size of memory.
>> Instead I think it should be zdev->end_dma - zdev->start_dma.
>>
>> Since we handle the restriction to memory size as reserved regions I
>> think that should be compatible. Also I think otherwise this might
>> break the admittedly odd s390_iommu_aperture=X kernel parameter on
>> LPARs.
>
> Correction, zdev->end_dma - zdev->start_dma + 1 because zdev->end_dma
> is inclusive ;-)
>

Forgot about that parameter, thanks... OK, will change to:

map->size = zdev->end_dma - zdev->start_dma + 1;