drm/amd: Taint the kernel when enabling overdrive
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 25 Sep 2024 20:05:07 +0000 (15:05 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Oct 2024 21:41:21 +0000 (17:41 -0400)
Some distributions have been patching amdgpu to enable overdrive by
default which may compromise stability.  Furthermore when bug reports
are brought upstream it's not obvious that the system has been tampered
with.

When overdrive is enabled taint the kernel and leave a critical message
in the logs for users so that it's obvious in a bug report it's been
tampered with.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index b997843..68f9c17 100644 (file)
@@ -2986,6 +2986,12 @@ static int __init amdgpu_init(void)
        /* Ignore KFD init failures. Normal when CONFIG_HSA_AMD is not set. */
        amdgpu_amdkfd_init();
 
+       if (amdgpu_pp_feature_mask & PP_OVERDRIVE_MASK) {
+               add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+               pr_crit("Overdrive is enabled, please disable it before "
+                       "reporting any bugs unrelated to overdrive.\n");
+       }
+
        /* let modprobe override vga console setting */
        return pci_register_driver(&amdgpu_kms_pci_driver);