Skip to contentSkip to conversation

drm/amd/amdgpu: Not request init data for MS_HYPERV with vega10

PATCH In review Yongqiang Sun 2 participants 2 messages Apr 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Not request init data for MS_HYPERV with vega10

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +10 -2
index 933c41f77c92..56b130ec44a9 100644
@@ -23,6 +23,10 @@
 
 #include <linux/module.h>
 
+#ifdef CONFIG_X86
+#include <asm/hypervisor.h>
+#endif
+
 #include <drm/drm_drv.h>
 
 #include "amdgpu.h"
@@ -721,8 +725,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) == false)
+#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:
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Yongqiang Sun

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +4 -0
index 933c41f77c92..56b130ec44a9 100644
@@ -23,6 +23,10 @@
 
 #include <linux/module.h>
 
+#ifdef CONFIG_X86
+#include <asm/hypervisor.h>
+#endif
+
 #include <drm/drm_drv.h>
 
 #include "amdgpu.h"

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c void amdgpu_detect_virtualization(struct amdgpu_device *adev) · line 730

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +3 -2
@@ -721,8 +725,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) == false)

Preferred coding style would be:
if (!hypervisor_is_type(X86_HYPER_MS_HYPERV))
With that fixed:

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +3 -1
+#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:
--

2.25.1