Skip to content

Commit

Permalink
drm/vmwgfx: Refuse DMA operation when SEV encryption is active
Browse files Browse the repository at this point in the history
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: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
  • Loading branch information
Thomas Hellstrom committed Mar 12, 2020
1 parent 81a0096 commit 3b0d645
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/mem_encrypt.h>

#include <drm/drm_drv.h>
#include <drm/drm_ioctl.h>
Expand Down Expand Up @@ -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_bind] = "Giving up DMA mappings early."};

/* TTM currently doesn't fully support SEV encryption. */
if (mem_encrypt_active())
return -EINVAL;

if (vmw_force_coherent)
dev_priv->map_mode = vmw_dma_alloc_coherent;
else if (vmw_restrict_iommu)
Expand Down

0 comments on commit 3b0d645

Please sign in to comment.