Skip to content

Commit 3b0d645

Browse files
committed
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: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
1 parent 81a0096 commit 3b0d645

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/dma-mapping.h>
3030
#include <linux/module.h>
3131
#include <linux/pci.h>
32+
#include <linux/mem_encrypt.h>
3233

3334
#include <drm/drm_drv.h>
3435
#include <drm/drm_ioctl.h>
@@ -575,6 +576,10 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
575576
[vmw_dma_map_populate] = "Caching DMA mappings.",
576577
[vmw_dma_map_bind] = "Giving up DMA mappings early."};
577578

579+
/* TTM currently doesn't fully support SEV encryption. */
580+
if (mem_encrypt_active())
581+
return -EINVAL;
582+
578583
if (vmw_force_coherent)
579584
dev_priv->map_mode = vmw_dma_alloc_coherent;
580585
else if (vmw_restrict_iommu)

0 commit comments

Comments
 (0)