diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2019-05-07 09:25:59 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-07-03 08:19:35 +0300 |
commit | 1a047cc7e53cb10e4706c09f6e92b2fa911a2bf2 (patch) | |
tree | f7ec84bc255ca2d4e135f52540851d429d2573e4 /arch/powerpc/platforms/pseries/setup.c | |
parent | efd176a04bef41aab5b3087e977fea2b69915174 (diff) | |
download | linux-1a047cc7e53cb10e4706c09f6e92b2fa911a2bf2.tar.xz |
powerpc/pseries/dma: Enable SWIOTLB
So far the pseries platforms has always been using IOMMU making
SWIOTLB unnecessary. Now we want secure guests which means devices can
only access certain areas of guest physical memory; we are going to
use SWIOTLB for this purpose.
This allows SWIOTLB for pseries. By default there is no change in
behavior.
This enables SWIOTLB when the "swiotlb" kernel parameter is set to
"force".
With the SWIOTLB enabled, the kernel creates a directly mapped DMA
window (using the usual DDW mechanism) and implements SWIOTLB on top
of that.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pseries/setup.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index e4f0dfd4ae33..30d72b587ac5 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -42,6 +42,7 @@ #include <linux/of.h> #include <linux/of_pci.h> #include <linux/memblock.h> +#include <linux/swiotlb.h> #include <asm/mmu.h> #include <asm/processor.h> @@ -71,6 +72,7 @@ #include <asm/isa-bridge.h> #include <asm/security_features.h> #include <asm/asm-const.h> +#include <asm/swiotlb.h> #include "pseries.h" #include "../../../../drivers/pci/pci.h" @@ -797,6 +799,9 @@ static void __init pSeries_setup_arch(void) } ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; + + if (swiotlb_force == SWIOTLB_FORCE) + ppc_swiotlb_enable = 1; } static void pseries_panic(char *str) |