From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Ram Pai <linuxram@us.ibm.com>,
linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Cc: andmike@us.ibm.com, mst@redhat.com, mdroth@linux.vnet.ibm.com,
linux-kernel@vger.kernel.org, ram.n.pai@gmail.com, cai@lca.pw,
tglx@linutronix.de, sukadev@linux.vnet.ibm.com, hch@lst.de,
bauerman@linux.ibm.com, david@gibson.dropbear.id.au
Subject: Re: [PATCH v4 2/2] powerpc/pseries/iommu: Use dma_iommu_ops for Secure VMs aswell.
Date: Tue, 3 Dec 2019 11:58:18 +1100 [thread overview]
Message-ID: <58b08d09-aaf8-5659-c4e8-c502c508f35c@ozlabs.ru> (raw)
In-Reply-To: <1575269124-17885-3-git-send-email-linuxram@us.ibm.com>
On 02/12/2019 17:45, Ram Pai wrote:
> Commit edea902c1c1e ("powerpc/pseries/iommu: Don't use dma_iommu_ops on
> secure guests")
> disabled dma_iommu_ops path, for secure VMs. The rationale for disabling
> the dma_iommu_ops path, was to use the dma_direct path, since it had
> inbuilt support for bounce-buffering through SWIOTLB.
>
> However dma_iommu_ops is functionally much richer. Depending on the
> capabilities of the platform, it can handle direct DMA; with or without
> bounce buffering, and it can handle indirect DMA. Hence its better to
> leverage the richer functionality supported by dma_iommu_ops.
What exactly do we leverage after applying this patch? afaict things are
going to work in exact same old way with this applied, no? Thanks,
>
> Renable dma_iommu_ops path for pseries Secure VMs.
>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> ---
> arch/powerpc/platforms/pseries/iommu.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 0720831..6adf4d3 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -36,7 +36,6 @@
> #include <asm/udbg.h>
> #include <asm/mmzone.h>
> #include <asm/plpar_wrappers.h>
> -#include <asm/svm.h>
> #include <asm/ultravisor.h>
>
> #include "pseries.h"
> @@ -1337,15 +1336,7 @@ void iommu_init_early_pSeries(void)
> of_reconfig_notifier_register(&iommu_reconfig_nb);
> register_memory_notifier(&iommu_mem_nb);
>
> - /*
> - * 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);
> + set_pci_dma_ops(&dma_iommu_ops);
> }
>
> static int __init disable_multitce(char *str)
>
--
Alexey
next prev parent reply other threads:[~2019-12-03 1:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-02 6:45 [PATCH v4 0/2] Enable IOMMU support for pseries Secure VMs Ram Pai
2019-12-02 6:45 ` [PATCH v4 1/2] powerpc/pseries/iommu: Share the per-cpu TCE page with the hypervisor Ram Pai
2019-12-02 6:45 ` [PATCH v4 2/2] powerpc/pseries/iommu: Use dma_iommu_ops for Secure VMs aswell Ram Pai
2019-12-03 0:58 ` Alexey Kardashevskiy [this message]
2019-12-03 4:07 ` Ram Pai
2019-12-03 0:56 ` [PATCH v4 1/2] powerpc/pseries/iommu: Share the per-cpu TCE page with the hypervisor Alexey Kardashevskiy
2019-12-03 2:08 ` Ram Pai
2019-12-03 2:15 ` Alexey Kardashevskiy
2019-12-03 4:05 ` Ram Pai
2019-12-03 4:24 ` Alexey Kardashevskiy
2019-12-03 16:52 ` Ram Pai
2019-12-04 0:04 ` Alexey Kardashevskiy
2019-12-04 0:49 ` Ram Pai
2019-12-04 1:08 ` Alexey Kardashevskiy
2019-12-04 3:36 ` David Gibson
2019-12-04 20:42 ` Ram Pai
2019-12-04 22:26 ` Alexey Kardashevskiy
2019-12-05 2:15 ` [PATCH v4 1/2] powerpc/pseries/iommu: Share the per-cpu TCE page with the hypervisor.y Ram Pai
2019-12-06 23:10 ` [PATCH v4 1/2] powerpc/pseries/iommu: Share the per-cpu TCE page with the hypervisor Ram Pai
2019-12-05 8:28 ` Christoph Hellwig
2019-12-04 18:26 ` Leonardo Bras
2019-12-04 20:27 ` Ram Pai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58b08d09-aaf8-5659-c4e8-c502c508f35c@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=andmike@us.ibm.com \
--cc=bauerman@linux.ibm.com \
--cc=cai@lca.pw \
--cc=david@gibson.dropbear.id.au \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=linuxram@us.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=mst@redhat.com \
--cc=ram.n.pai@gmail.com \
--cc=sukadev@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).