drm/amd/amdgpu: Not request init data for MS_HYPERV with vega10
authorYongqiang Sun <yongqiang.sun@amd.com>
Fri, 8 Apr 2022 14:53:14 +0000 (10:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Apr 2022 13:14:22 +0000 (09:14 -0400)
MS_HYPERV with vega10 doesn't have the interface to process
request init data msg.

Check hypervisor type to not send the request for MS_HYPERV.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Alice Wong <shiwei.wong@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

index 9aa355a5ac3ceb42b191c6221bb8faebc8cf8afc..ab95beac630706cb96845b39f4b936fa6c6711b7 100644 (file)
 
 #include <linux/module.h>
 
+#ifdef CONFIG_X86
+#include <asm/hypervisor.h>
+#endif
+
 #include <drm/drm_drv.h>
 
 #include "amdgpu.h"
@@ -723,8 +727,12 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
                        break;
                case CHIP_VEGA10:
                        soc15_set_virt_ops(adev);
-                       /* send a dummy GPU_INIT_DATA request to host on vega10 */
-                       amdgpu_virt_request_init_data(adev);
+#ifdef CONFIG_X86
+                       /* not send GPU_INIT_DATA with MS_HYPERV*/
+                       if (!hypervisor_is_type(X86_HYPER_MS_HYPERV))
+#endif
+                               /* send a dummy GPU_INIT_DATA request to host on vega10 */
+                               amdgpu_virt_request_init_data(adev);
                        break;
                case CHIP_VEGA20:
                case CHIP_ARCTURUS: