Re: [RFC PATCH v2 00/58] KVM: Arm SMMUv3 driver for pKVM
From: Jason Gunthorpe
Date: Wed Jan 22 2025 - 14:16:53 EST
On Wed, Jan 22, 2025 at 05:17:50PM +0000, Mostafa Saleh wrote:
> On Wed, Jan 22, 2025 at 12:20:55PM -0400, Jason Gunthorpe wrote:
> > On Wed, Jan 22, 2025 at 11:04:24AM +0000, Mostafa Saleh wrote:
> > > AFAIK, the most common use cases would be:
> > > - Devices using DMA API because it requires a lot of memory to be
> > > contiguous in IOVA, which is hard to do with identity
> >
> > This is not a feature of the DMA API any driver should rely on .. Are
> > you aware of one that does?
> >
>
> I’d guess one example is media drivers, they usually need large contiguous
> buffers, and would use for ex dma_alloc_coherent(), if the IOMMU is disabled or
> bypassed, that means that the kernel has to find such contiguous size in the
> physical address which can be impossible on devices with small memory as
> mobile devices. Similarly.
I see, that make sense
> It’s not just about completely external devices, it’s a defence in depth
> measure, where for example, network devices can be poked externally an
> there have cases in the past where exploits were found[1], so some vendors
> might have a policy to isolate such devices. Which I believe is a valid.
The performance cost of doing isolation like that with networking is
probably prohibitive with paravirt..
Jason