Commit d862b441 authored by Ram Pai's avatar Ram Pai Committed by Michael Ellerman

Revert "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"

This reverts commit edea902c.

At the time the change allowed direct DMA ops for secure VMs; however
since then we switched on using SWIOTLB backed with IOMMU (direct mapping)
and to make this work, we need dma_iommu_ops which handles all cases
including TCE mapping I/O pages in the presence of an IOMMU.

Fixes: edea902c ("powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests")
Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
[aik: added "revert" and "fixes:"]
Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Tested-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191216041924.42318-2-aik@ozlabs.ru
parent 4a8e274e
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <asm/plpar_wrappers.h> #include <asm/plpar_wrappers.h>
#include <asm/svm.h>
#include "pseries.h" #include "pseries.h"
...@@ -1320,15 +1319,7 @@ void iommu_init_early_pSeries(void) ...@@ -1320,15 +1319,7 @@ void iommu_init_early_pSeries(void)
of_reconfig_notifier_register(&iommu_reconfig_nb); of_reconfig_notifier_register(&iommu_reconfig_nb);
register_memory_notifier(&iommu_mem_nb); register_memory_notifier(&iommu_mem_nb);
/* set_pci_dma_ops(&dma_iommu_ops);
* Secure guest memory is inacessible to devices so regular DMA isn't
* possible.
*
* In that case keep devices' dma_map_ops as NULL so that the generic
* DMA code path will use SWIOTLB to bounce buffers for DMA.
*/
if (!is_secure_guest())
set_pci_dma_ops(&dma_iommu_ops);
} }
static int __init disable_multitce(char *str) static int __init disable_multitce(char *str)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment