drm/amdgpu: do not use passthrough mode in Xen dom0
authorjsg <jsg@openbsd.org>
Fri, 13 May 2022 03:17:30 +0000 (03:17 +0000)
committerjsg <jsg@openbsd.org>
Fri, 13 May 2022 03:17:30 +0000 (03:17 +0000)
From Marek Marczykowski-Gorecki
1a78d8fe6606aabcbdecef1745446f5a923a8e0a in linux 5.15.y/5.15.39
19965d8259fdabc6806da92adda49684f5bcbec5 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.c

index 71b4f13..cb37575 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 
 #include <drm/drm_drv.h>
+#include <xen/xen.h>
 
 #include "amdgpu.h"
 #include "amdgpu_ras.h"
@@ -695,7 +696,8 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
                adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
 
        if (!reg) {
-               if (is_virtual_machine())       /* passthrough mode exclus sriov mod */
+               /* passthrough mode exclus sriov mod */
+               if (is_virtual_machine() && !xen_initial_domain())
                        adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
        }