dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: fallback to dma_alloc_coherent when memory encryption is active
@ 2019-03-13  9:20 Christian König
  2019-03-13 17:36 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2019-03-13  9:20 UTC (permalink / raw)
  To: dri-devel; +Cc: Thomas.Lendacky

We can't just map any randome page we get when memory encryption is
active.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/drm_memory.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index 8dbcdc77f6bf..132fef8ff1b6 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -168,6 +168,13 @@ bool drm_need_swiotlb(int dma_bits)
 	if (xen_pv_domain())
 		return true;
 
+	/*
+	 * Enforce dma_alloc_coherent when memory encryption is active as well
+	 * for the same reasons as for Xen paravirtual hosts.
+	 */
+	if (mem_encrypt_active())
+		return true;
+
 	for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
 		max_iomem = max(max_iomem,  tmp->end);
 	}
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm: fallback to dma_alloc_coherent when memory encryption is active
  2019-03-13  9:20 [PATCH] drm: fallback to dma_alloc_coherent when memory encryption is active Christian König
@ 2019-03-13 17:36 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-03-13 17:36 UTC (permalink / raw)
  To: Christian König; +Cc: Thomas.Lendacky, Maling list - DRI developers

On Wed, Mar 13, 2019 at 5:21 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> We can't just map any randome page we get when memory encryption is
> active.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_memory.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
> index 8dbcdc77f6bf..132fef8ff1b6 100644
> --- a/drivers/gpu/drm/drm_memory.c
> +++ b/drivers/gpu/drm/drm_memory.c
> @@ -168,6 +168,13 @@ bool drm_need_swiotlb(int dma_bits)
>         if (xen_pv_domain())
>                 return true;
>
> +       /*
> +        * Enforce dma_alloc_coherent when memory encryption is active as well
> +        * for the same reasons as for Xen paravirtual hosts.
> +        */
> +       if (mem_encrypt_active())
> +               return true;
> +
>         for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
>                 max_iomem = max(max_iomem,  tmp->end);
>         }
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-13 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13  9:20 [PATCH] drm: fallback to dma_alloc_coherent when memory encryption is active Christian König
2019-03-13 17:36 ` Alex Deucher

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).