Skip to contentSkip to conversation

question on "powerpc/pseries/dma: Allow SWIOTLB"

DISCUSSION Christoph Hellwig 2 participants 9 messages Jul 19, 2019 – Jul 22, 2019

lore
Share & tools
lore
#0 lore raw

Hey Alexey,

what is the use case for the above commit? Shouldn't we handle all addressing limits using the iommu?

#1 lore raw
Quoted 4 lines · Christoph Hellwig

Hey Alexey,

what is the use case for the above commit? Shouldn't we handle all addressing limits using the iommu?

Our secure VMs is the use case, when only a fraction of system memory is available for DMA.

Signature · 1 line
Alexey
#2 lore raw
Quoted 10 lines · Alexey Kardashevskiy
Quoted 4 lines · Christoph Hellwig

Hey Alexey,

what is the use case for the above commit? Shouldn't we handle all addressing limits using the iommu?

Our secure VMs is the use case, when only a fraction of system memory is available for DMA.

But shouldn't we force usage of the direct ops in that case as the IOMMU is not neededed at all? Also isn't that support non-upstream so far?

#3 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Alexey Kardashevskiy
Quoted 2 lines · Christoph Hellwig

Hey Alexey,

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

what is the use case for the above commit? Shouldn't we handle all addressing limits using the iommu?

Our secure VMs is the use case, when only a fraction of system memory is available for DMA.

But shouldn't we force usage of the direct ops in that case as the IOMMU is not neededed at all?

We do, for mappings, but not unmappings and syncing.

Quoted 1 line

Also isn't that support non-upstream so far?

How is this relevant? I expect the existing "swiotlb=force" just work.

Signature · 1 line
Alexey
#4 lore raw
Quoted 4 lines · Alexey Kardashevskiy
Quoted 2 lines

But shouldn't we force usage of the direct ops in that case as the IOMMU is not neededed at all?

We do, for mappings, but not unmappings and syncing.

Well, I mean as in literally not setting a dma_ops so that the dma_direct code is used without the indirection through the iommu ops. This is not only more obvious, but also faster as you avoid the indirect call (although that probably doesn't matter much if you are bounce buffering anyway).

Quoted 3 lines
Quoted 1 line

Also isn't that support non-upstream so far?

How is this relevant? I expect the existing "swiotlb=force" just work.

I though the whole secure VM support was still not upstream.

#5 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 4 lines · Alexey Kardashevskiy
Quoted 2 lines

But shouldn't we force usage of the direct ops in that case as the IOMMU is not neededed at all?

We do, for mappings, but not unmappings and syncing.

Well, I mean as in literally not setting a dma_ops so that the dma_direct code is used without the indirection through the iommu ops. This is not only more obvious, but also faster as you avoid the indirect call (although that probably doesn't matter much if you are bounce buffering anyway).

I was not precise. We cannot avoid IOMMU in the guest for passed through devices.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Also isn't that support non-upstream so far?

How is this relevant? I expect the existing "swiotlb=force" just work.

I though the whole secure VM support was still not upstream.

It is getting there and I still do not see why "swiotlb=force" should not work if chosed in the cmdline.

Signature · 1 line
Alexey
#6 lore raw
Quoted 2 lines · Alexey Kardashevskiy

It is getting there and I still do not see why "swiotlb=force" should not work if chosed in the cmdline.

Ok, makes sense. But that means we also have the issue in a few other places..

#7 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Alexey Kardashevskiy

It is getting there and I still do not see why "swiotlb=force" should not work if chosed in the cmdline.

Ok, makes sense. But that means we also have the issue in a few other places..

Hmm, where? I got broadcom ethernet working with this.

Signature · 1 line
Alexey
#8 lore raw
Quoted 11 lines · Alexey Kardashevskiy
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Alexey Kardashevskiy

It is getting there and I still do not see why "swiotlb=force" should not work if chosed in the cmdline.

Ok, makes sense. But that means we also have the issue in a few other places..

Hmm, where? I got broadcom ethernet working with this.

In all the other IOMMU drivers that conditionally forward to the dma direct ops. So it shouldn't affect powerpc.