]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: use vm_update_mode=0 as default in sriov for gfx10.3 onwards
authorDanijel Slivka <danijel.slivka@amd.com>
Wed, 27 Mar 2024 22:56:23 +0000 (23:56 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 02:02:37 +0000 (22:02 -0400)
Apply this rule to all newer asics in sriov case.
For asic with VF MMIO access protection avoid using CPU for VM table updates.
CPU pagetable updates have issues with HDP flush as VF MMIO access protection
blocks write to BIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL register
during sriov runtime.
Moved the check to amdgpu_device_init() to ensure it is done after
amdgpu_device_ip_early_init() where the IP versions are discovered.

Signed-off-by: Danijel Slivka <danijel.slivka@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

index 12dc71a6b5db67d0d6eaa12dd10dbd206850adea..66a5979e075dacb5cf584d8e3234d870119f627d 100644 (file)
@@ -4072,6 +4072,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        /* Enable TMZ based on IP_VERSION */
        amdgpu_gmc_tmz_set(adev);
 
+       if (amdgpu_sriov_vf(adev) &&
+           amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(10, 3, 0))
+               /* VF MMIO access (except mailbox range) from CPU
+                * will be blocked during sriov runtime
+                */
+               adev->virt.caps |= AMDGPU_VF_MMIO_ACCESS_PROTECT;
+
        amdgpu_gmc_noretry_set(adev);
        /* Need to get xgmi info early to decide the reset behavior*/
        if (adev->gmc.xgmi.supported) {
index aed60aaf1a554e083d112e062c8bc2eb23a48146..6f01de220c44c96b640a115e3ba99954f2eaddb5 100644 (file)
@@ -724,12 +724,6 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
                        adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
        }
 
-       if (amdgpu_sriov_vf(adev) && adev->asic_type == CHIP_SIENNA_CICHLID)
-               /* VF MMIO access (except mailbox range) from CPU
-                * will be blocked during sriov runtime
-                */
-               adev->virt.caps |= AMDGPU_VF_MMIO_ACCESS_PROTECT;
-
        /* we have the ability to check now */
        if (amdgpu_sriov_vf(adev)) {
                switch (adev->asic_type) {