[PATCH v2] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

Michael Ellerman mpe at ellerman.id.au
Fri May 5 12:21:24 AEST 2023


Gaurav Batra <gbatra at linux.vnet.ibm.com> writes:
> Hello Michael,
>
> I agree with your concerns regarding a device been able to access memory 
> that doesn't belong to it. That exposure we have today with 2MB TCEs. 
> With 2MB TCEs, DMA window size will be big enough, for dedicated 
> adapters, that whole memory is going to be mapped "direct". Which 
> essentially means, that a "rogue" device/driver has the potential to 
> corrupt LPAR wide memory.

Yes that's always been a trade-off between performance and robustness,
and performance is generally the winner.

There have been various command line flags in the past to configure
stricter behaviour, disable bypass etc. Some of those are now generic,
iommu.strict/passthrough, it would be good to get them wired up to work
on powerpc at some point.

> I have sent you v3.

Thanks.

cheers


More information about the Linuxppc-dev mailing list