Commit 3b0d6458 authored by Thomas Hellstrom's avatar Thomas Hellstrom

drm/vmwgfx: Refuse DMA operation when SEV encryption is active

TTM doesn't yet fully support mapping of DMA memory when SEV is active,
so in that case, refuse DMA operation. For guest-backed object operation
this means 3D acceleration will be disabled. For host-backed, VRAM will be
used for data transfer between the guest and the device.
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
parent 81a00960
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mem_encrypt.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_ioctl.h> #include <drm/drm_ioctl.h>
...@@ -575,6 +576,10 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv) ...@@ -575,6 +576,10 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
[vmw_dma_map_populate] = "Caching DMA mappings.", [vmw_dma_map_populate] = "Caching DMA mappings.",
[vmw_dma_map_bind] = "Giving up DMA mappings early."}; [vmw_dma_map_bind] = "Giving up DMA mappings early."};
/* TTM currently doesn't fully support SEV encryption. */
if (mem_encrypt_active())
return -EINVAL;
if (vmw_force_coherent) if (vmw_force_coherent)
dev_priv->map_mode = vmw_dma_alloc_coherent; dev_priv->map_mode = vmw_dma_alloc_coherent;
else if (vmw_restrict_iommu) else if (vmw_restrict_iommu)
......
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