#include <drm/ttm/ttm_placement.h>
 #include <generated/utsrelease.h>
 
+#ifdef CONFIG_X86
+#include <asm/hypervisor.h>
+#endif
 #include <linux/cc_platform.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
                                 cap2_names, ARRAY_SIZE(cap2_names));
        }
 
+       if (!vmwgfx_supported(dev_priv)) {
+               vmw_disable_backdoor();
+               drm_err_once(&dev_priv->drm,
+                            "vmwgfx seems to be running on an unsupported hypervisor.");
+               drm_err_once(&dev_priv->drm,
+                            "This configuration is likely broken.");
+               drm_err_once(&dev_priv->drm,
+                            "Please switch to a supported graphics device to avoid problems.");
+       }
+
        ret = vmw_dma_select_mode(dev_priv);
        if (unlikely(ret != 0)) {
                drm_info(&dev_priv->drm,
        vmw_kms_legacy_hotspot_clear(dev_priv);
 }
 
+bool vmwgfx_supported(struct vmw_private *vmw)
+{
+#if defined(CONFIG_X86)
+       return hypervisor_is_type(X86_HYPER_VMWARE);
+#elif defined(CONFIG_ARM64)
+       /*
+        * On aarch64 only svga3 is supported
+        */
+       return vmw->pci_id == VMWGFX_PCI_ID_SVGA3;
+#else
+       drm_warn_once(&vmw->drm,
+                     "vmwgfx is running on an unknown architecture.");
+       return false;
+#endif
+}
+
 /**
  * __vmw_svga_enable - Enable SVGA mode, FIFO and use of VRAM.
  *
 
 
 extern void vmw_svga_enable(struct vmw_private *dev_priv);
 extern void vmw_svga_disable(struct vmw_private *dev_priv);
+bool vmwgfx_supported(struct vmw_private *vmw);
 
 
 /**
                    struct vmw_diff_cpy *diff);
 
 /* Host messaging -vmwgfx_msg.c: */
+void vmw_disable_backdoor(void);
 int vmw_host_get_guestinfo(const char *guest_info_param,
                           char *buffer, size_t *length);
 __printf(1, 2) int vmw_host_printf(const char *fmt, ...);