debugfs access is restricted when secure boot is enabled
On systems with secure boot enabled the intel_gpu_frequency
tool fails to start with assertion exception throwed:
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Test assertion failure function igt_drop_caches_set, file ../lib/igt_debugfs.c:1142:
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Failed assertion: igt_sysfs_printf(dir, "i915_gem_drop_caches", "0x%" PRIx64, val) > 0
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Last errno: 1, Operation not permitted
Stack trace:
#0 ../lib/igt_core.c:1756 __igt_fail_assert()
#1 ../lib/igt_debugfs.c:1142 .annobin_cancel_work_at_exit_render.start()
#2 ../lib/drmtest.c:583 drm_open_driver()
#3 ../tools/intel_gpu_frequency.c:286 main()
#4 ../sysdeps/nptl/libc_start_call_main.h:74 __libc_start_call_main()
#5 ../csu/libc-start.c:128 __libc_start_main@@GLIBC_2.34()
#6 [<unknown>+0x401825]
Test (null) failed.
**** DEBUG ****
(intel_gpu_frequency:14896) drmtest-DEBUG: Test requirement passed: !(fd<0)
(intel_gpu_frequency:14896) igt_debugfs-DEBUG: Opening debugfs directory '/sys/kernel/debug/dri/1'
(intel_gpu_frequency:14896) igt_sysfs-DEBUG: Condition fd < 0 occurred in function igt_sysfs_vprintf, file ../lib/igt_sysfs.c:458
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Test assertion failure function igt_drop_caches_set, file ../lib/igt_debugfs.c:1142:
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Failed assertion: igt_sysfs_printf(dir, "i915_gem_drop_caches", "0x%" PRIx64, val) > 0
(intel_gpu_frequency:14896) igt_debugfs-CRITICAL: Last errno: 1, Operation not permitted
(intel_gpu_frequency:14896) igt_core-INFO: Stack trace:
(intel_gpu_frequency:14896) igt_core-INFO: #0 ../lib/igt_core.c:1756 __igt_fail_assert()
(intel_gpu_frequency:14896) igt_core-INFO: #1 ../lib/igt_debugfs.c:1142 .annobin_cancel_work_at_exit_render.start()
(intel_gpu_frequency:14896) igt_core-INFO: #2 ../lib/drmtest.c:583 drm_open_driver()
(intel_gpu_frequency:14896) igt_core-INFO: #3 ../tools/intel_gpu_frequency.c:286 main()
(intel_gpu_frequency:14896) igt_core-INFO: #4 ../sysdeps/nptl/libc_start_call_main.h:74 __libc_start_call_main()
(intel_gpu_frequency:14896) igt_core-INFO: #5 ../csu/libc-start.c:128 __libc_start_main@@GLIBC_2.34()
(intel_gpu_frequency:14896) igt_core-INFO: #6 [<unknown>+0x401825]
**** END ****
FAIL (-1.000s)
The DMESG output shows that the access to /sys/kernel/debug/dri/?/i915_gem_drop_caches
is restricted and causing the error:
# dmesg | tail -n 1
[ 3553.930373] Lockdown: intel_gpu_frequ: debugfs access is restricted; see man kernel_lockdown.7
Secure boot state:
# cat /sys/kernel/security/lockdown
none [integrity] confidentiality
Is it possible to use the tool without disabling secure boot?
Edited by Francesco Antognazza