* [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning
@ 2023-05-10 18:36 Ashutosh Dixit
2023-05-11 0:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Ashutosh Dixit @ 2023-05-10 18:36 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel, Rodrigo Vivi
Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL)
causes the following warning:
UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2
load of value 255 is not a valid value for type '_Bool'
Call Trace:
dump_stack_lvl+0x57/0x7d
ubsan_epilogue+0x5/0x40
__ubsan_handle_load_invalid_value.cold+0x43/0x48
__uc_init_hw+0x76a/0x903 [i915]
...
i915_driver_probe+0xfb1/0x1eb0 [i915]
i915_pci_probe+0xbe/0x2d0 [i915]
The warning happens because during probe i915_hwmon is still not available
which results in the output boolean variable *old remaining
uninitialized. Silence the warning by initializing the variable to an
arbitrary value.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/i915/i915_hwmon.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c
index a3bdd9f68a458..685663861bc0b 100644
--- a/drivers/gpu/drm/i915/i915_hwmon.c
+++ b/drivers/gpu/drm/i915/i915_hwmon.c
@@ -502,8 +502,11 @@ void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old)
struct i915_hwmon *hwmon = i915->hwmon;
u32 r;
- if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit))
+ if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) {
+ /* Fix uninitialized bool variable warning */
+ *old = false;
return;
+ }
mutex_lock(&hwmon->hwmon_lock);
--
2.38.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-10 18:36 [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Ashutosh Dixit @ 2023-05-11 0:20 ` Patchwork 2023-05-11 3:56 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2023-05-11 0:20 UTC (permalink / raw) To: Ashutosh Dixit; +Cc: intel-gfx [-- Attachment #1: Type: text/plain, Size: 5908 bytes --] == Series Details == Series: drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning URL : https://patchwork.freedesktop.org/series/117591/ State : success == Summary == CI Bug Log - changes from CI_DRM_13131 -> Patchwork_117591v1 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/index.html Participating hosts (40 -> 40) ------------------------------ Additional (1): bat-mtlp-6 Missing (1): fi-snb-2520m Known issues ------------ Here are the changes found in Patchwork_117591v1 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1: - bat-dg2-8: [PASS][1] -> [FAIL][2] ([i915#7932]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html #### Possible fixes #### * igt@dmabuf@all-tests@dma_fence: - fi-kbl-7567u: [DMESG-FAIL][3] -> [PASS][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/fi-kbl-7567u/igt@dmabuf@all-tests@dma_fence.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/fi-kbl-7567u/igt@dmabuf@all-tests@dma_fence.html * igt@dmabuf@all-tests@sanitycheck: - fi-kbl-7567u: [ABORT][5] -> [PASS][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/fi-kbl-7567u/igt@dmabuf@all-tests@sanitycheck.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/fi-kbl-7567u/igt@dmabuf@all-tests@sanitycheck.html * igt@i915_hangman@error-state-basic: - fi-kbl-soraka: [INCOMPLETE][7] -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/fi-kbl-soraka/igt@i915_hangman@error-state-basic.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/fi-kbl-soraka/igt@i915_hangman@error-state-basic.html * igt@i915_selftest@live@requests: - {bat-mtlp-8}: [ABORT][9] ([i915#4983] / [i915#7920] / [i915#7953]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-mtlp-8/igt@i915_selftest@live@requests.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/bat-mtlp-8/igt@i915_selftest@live@requests.html #### Warnings #### * igt@i915_selftest@live@reset: - bat-rpls-1: [ABORT][11] ([i915#4983] / [i915#7461] / [i915#7953] / [i915#7981] / [i915#8347] / [i915#8384]) -> [ABORT][12] ([i915#4983] / [i915#7461] / [i915#7953] / [i915#8347] / [i915#8384]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-rpls-1/igt@i915_selftest@live@reset.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/bat-rpls-1/igt@i915_selftest@live@reset.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285 [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072 [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845 [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582 [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546 [i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595 [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637 [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708 [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077 [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079 [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083 [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212 [i915#4342]: https://gitlab.freedesktop.org/drm/intel/issues/4342 [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579 [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613 [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983 [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190 [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274 [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367 [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621 [i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645 [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456 [i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920 [i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932 [i915#7953]: https://gitlab.freedesktop.org/drm/intel/issues/7953 [i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981 [i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347 [i915#8368]: https://gitlab.freedesktop.org/drm/intel/issues/8368 [i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384 Build changes ------------- * Linux: CI_DRM_13131 -> Patchwork_117591v1 CI-20190529: 20190529 CI_DRM_13131: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7285: d1cbf2bad9c2664ab8bd3bd0946510a52800912f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_117591v1: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux ### Linux commits 6ff4700f83c0 drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/index.html [-- Attachment #2: Type: text/html, Size: 5569 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-10 18:36 [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Ashutosh Dixit 2023-05-11 0:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork @ 2023-05-11 3:56 ` Patchwork 2023-05-11 17:43 ` [Intel-gfx] [PATCH] " Dixit, Ashutosh 2023-05-12 9:41 ` Andrzej Hajda 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2023-05-11 3:56 UTC (permalink / raw) To: Ashutosh Dixit; +Cc: intel-gfx [-- Attachment #1: Type: text/plain, Size: 11545 bytes --] == Series Details == Series: drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning URL : https://patchwork.freedesktop.org/series/117591/ State : failure == Summary == CI Bug Log - changes from CI_DRM_13131_full -> Patchwork_117591v1_full ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with Patchwork_117591v1_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_117591v1_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (7 -> 7) ------------------------------ No changes in participating hosts Possible new issues ------------------- Here are the unknown changes that may have been introduced in Patchwork_117591v1_full: ### IGT changes ### #### Possible regressions #### * igt@kms_flip@flip-vs-suspend@c-dp1: - shard-apl: [PASS][1] -> [ABORT][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl3/igt@kms_flip@flip-vs-suspend@c-dp1.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl6/igt@kms_flip@flip-vs-suspend@c-dp1.html Known issues ------------ Here are the changes found in Patchwork_117591v1_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_barrier_race@remote-request@rcs0: - shard-apl: [PASS][3] -> [ABORT][4] ([i915#7461] / [i915#8211] / [i915#8234]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl1/igt@gem_barrier_race@remote-request@rcs0.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl1/igt@gem_barrier_race@remote-request@rcs0.html * igt@gem_exec_fair@basic-pace-solo@rcs0: - shard-glk: [PASS][5] -> [FAIL][6] ([i915#2842]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-glk1/igt@gem_exec_fair@basic-pace-solo@rcs0.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-glk8/igt@gem_exec_fair@basic-pace-solo@rcs0.html * igt@gen9_exec_parse@allowed-single: - shard-glk: [PASS][7] -> [ABORT][8] ([i915#5566]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-glk5/igt@gen9_exec_parse@allowed-single.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-glk1/igt@gen9_exec_parse@allowed-single.html * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions: - shard-glk: [PASS][9] -> [FAIL][10] ([i915#2346]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size: - shard-apl: [PASS][11] -> [FAIL][12] ([i915#2346]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html * igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1: - shard-apl: [PASS][13] -> [FAIL][14] ([i915#1188]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl7/igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl2/igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1.html * igt@perf@stress-open-close@0-rcs0: - shard-apl: [PASS][15] -> [ABORT][16] ([i915#5213]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl1/igt@perf@stress-open-close@0-rcs0.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl4/igt@perf@stress-open-close@0-rcs0.html #### Possible fixes #### * igt@gem_exec_fair@basic-none-solo@rcs0: - shard-apl: [FAIL][17] ([i915#2842]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-apl6/igt@gem_exec_fair@basic-none-solo@rcs0.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-apl7/igt@gem_exec_fair@basic-none-solo@rcs0.html * igt@gem_exec_fair@basic-none@vecs0: - {shard-rkl}: [FAIL][19] ([i915#2842]) -> [PASS][20] +2 similar issues [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-rkl-3/igt@gem_exec_fair@basic-none@vecs0.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-rkl-7/igt@gem_exec_fair@basic-none@vecs0.html * igt@gem_exec_fair@basic-pace-share@rcs0: - shard-glk: [FAIL][21] ([i915#2842]) -> [PASS][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-glk4/igt@gem_exec_fair@basic-pace-share@rcs0.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-glk3/igt@gem_exec_fair@basic-pace-share@rcs0.html * igt@gem_exec_suspend@basic-s4-devices@smem: - {shard-tglu}: [ABORT][23] ([i915#7953] / [i915#7975] / [i915#8213]) -> [PASS][24] [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-tglu-10/igt@gem_exec_suspend@basic-s4-devices@smem.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-tglu-9/igt@gem_exec_suspend@basic-s4-devices@smem.html * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a: - {shard-rkl}: [SKIP][25] ([i915#1937]) -> [PASS][26] [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-rkl-3/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-rkl-7/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a.html * igt@i915_pm_rc6_residency@rc6-idle@vecs0: - {shard-dg1}: [FAIL][27] ([i915#3591]) -> [PASS][28] [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-dg1-12/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-dg1-12/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html * igt@i915_pm_rpm@dpms-mode-unset-lpsp: - {shard-rkl}: [SKIP][29] ([i915#1397]) -> [PASS][30] +2 similar issues [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-rkl-6/igt@i915_pm_rpm@dpms-mode-unset-lpsp.html [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-rkl-7/igt@i915_pm_rpm@dpms-mode-unset-lpsp.html * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip: - {shard-rkl}: [FAIL][31] ([i915#3743]) -> [PASS][32] [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-rkl-7/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-rkl-1/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2: - shard-glk: [FAIL][33] ([i915#79]) -> [PASS][34] [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-glk8/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2.html [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-glk9/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2.html * igt@perf_pmu@idle@rcs0: - {shard-dg1}: [FAIL][35] ([i915#4349]) -> [PASS][36] [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-dg1-17/igt@perf_pmu@idle@rcs0.html [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-dg1-16/igt@perf_pmu@idle@rcs0.html - {shard-rkl}: [FAIL][37] ([i915#4349]) -> [PASS][38] [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/shard-rkl-6/igt@perf_pmu@idle@rcs0.html [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/shard-rkl-3/igt@perf_pmu@idle@rcs0.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280 [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189 [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614 [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615 [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072 [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188 [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397 [i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937 [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346 [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681 [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842 [i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315 [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591 [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689 [i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743 [i915#3778]: https://gitlab.freedesktop.org/drm/intel/issues/3778 [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349 [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579 [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176 [i915#5213]: https://gitlab.freedesktop.org/drm/intel/issues/5213 [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235 [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286 [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354 [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439 [i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493 [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566 [i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245 [i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461 [i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79 [i915#7953]: https://gitlab.freedesktop.org/drm/intel/issues/7953 [i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975 [i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011 [i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211 [i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213 [i915#8234]: https://gitlab.freedesktop.org/drm/intel/issues/8234 [i915#8420]: https://gitlab.freedesktop.org/drm/intel/issues/8420 Build changes ------------- * Linux: CI_DRM_13131 -> Patchwork_117591v1 CI-20190529: 20190529 CI_DRM_13131: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7285: d1cbf2bad9c2664ab8bd3bd0946510a52800912f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_117591v1: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117591v1/index.html [-- Attachment #2: Type: text/html, Size: 11460 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-10 18:36 [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Ashutosh Dixit 2023-05-11 0:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 2023-05-11 3:56 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork @ 2023-05-11 17:43 ` Dixit, Ashutosh 2023-05-12 9:33 ` Andi Shyti 2023-05-12 9:41 ` Andrzej Hajda 3 siblings, 1 reply; 7+ messages in thread From: Dixit, Ashutosh @ 2023-05-11 17:43 UTC (permalink / raw) To: intel-gfx; +Cc: dri-devel, Rodrigo Vivi On Wed, 10 May 2023 11:36:06 -0700, Ashutosh Dixit wrote: > > Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL) > causes the following warning: > > UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2 > load of value 255 is not a valid value for type '_Bool' > Call Trace: > dump_stack_lvl+0x57/0x7d > ubsan_epilogue+0x5/0x40 > __ubsan_handle_load_invalid_value.cold+0x43/0x48 > __uc_init_hw+0x76a/0x903 [i915] > ... > i915_driver_probe+0xfb1/0x1eb0 [i915] > i915_pci_probe+0xbe/0x2d0 [i915] > > The warning happens because during probe i915_hwmon is still not available > which results in the output boolean variable *old remaining > uninitialized. Note that the variable was uninitialized in this case but it was never used uninitialized (the variable was not needed when it was uninitialized). So there was no bug in the code. UBSAN warning is just complaining about the uninitialized variable being passed into a function (where it is not used). Also the variable can be initialized in the caller (__uc_init_hw) too and it will fix this issue. However in __uc_init_hw the assumption is that the variable will be initialized in the callee (i915_hwmon_power_max_disable), so that is how I have done it in this patch. I thought these clarifications will help with the review. Thanks. -- Ashutosh > Silence the warning by initializing the variable to an arbitrary value. > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > --- > drivers/gpu/drm/i915/i915_hwmon.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c > index a3bdd9f68a458..685663861bc0b 100644 > --- a/drivers/gpu/drm/i915/i915_hwmon.c > +++ b/drivers/gpu/drm/i915/i915_hwmon.c > @@ -502,8 +502,11 @@ void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old) > struct i915_hwmon *hwmon = i915->hwmon; > u32 r; > > - if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) > + if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) { > + /* Fix uninitialized bool variable warning */ > + *old = false; > return; > + } > > mutex_lock(&hwmon->hwmon_lock); > > -- > 2.38.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-11 17:43 ` [Intel-gfx] [PATCH] " Dixit, Ashutosh @ 2023-05-12 9:33 ` Andi Shyti 2023-05-12 20:40 ` Dixit, Ashutosh 0 siblings, 1 reply; 7+ messages in thread From: Andi Shyti @ 2023-05-12 9:33 UTC (permalink / raw) To: Dixit, Ashutosh; +Cc: intel-gfx, dri-devel, Rodrigo Vivi Hi Ashutosh, On Thu, May 11, 2023 at 10:43:30AM -0700, Dixit, Ashutosh wrote: > On Wed, 10 May 2023 11:36:06 -0700, Ashutosh Dixit wrote: > > > > Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL) > > causes the following warning: > > > > UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2 > > load of value 255 is not a valid value for type '_Bool' > > Call Trace: > > dump_stack_lvl+0x57/0x7d > > ubsan_epilogue+0x5/0x40 > > __ubsan_handle_load_invalid_value.cold+0x43/0x48 > > __uc_init_hw+0x76a/0x903 [i915] > > ... > > i915_driver_probe+0xfb1/0x1eb0 [i915] > > i915_pci_probe+0xbe/0x2d0 [i915] > > > > The warning happens because during probe i915_hwmon is still not available > > which results in the output boolean variable *old remaining > > uninitialized. > > Note that the variable was uninitialized in this case but it was never used > uninitialized (the variable was not needed when it was uninitialized). So > there was no bug in the code. UBSAN warning is just complaining about the > uninitialized variable being passed into a function (where it is not used). > > Also the variable can be initialized in the caller (__uc_init_hw) too and > it will fix this issue. However in __uc_init_hw the assumption is that the > variable will be initialized in the callee (i915_hwmon_power_max_disable), > so that is how I have done it in this patch. > > I thought these clarifications will help with the review. I think we should not just consider what's now but also what can come later. The use of pl1en is not 100% future proof and therefore your patch, even though now is not fixing anything, might avoid wrong uses in the future. I'm just wondering, though, why not initializing the variable at it's declaration. As you wish. Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Andi > Thanks. > -- > Ashutosh > > > Silence the warning by initializing the variable to an arbitrary value. > > > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > > --- > > drivers/gpu/drm/i915/i915_hwmon.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c > > index a3bdd9f68a458..685663861bc0b 100644 > > --- a/drivers/gpu/drm/i915/i915_hwmon.c > > +++ b/drivers/gpu/drm/i915/i915_hwmon.c > > @@ -502,8 +502,11 @@ void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old) > > struct i915_hwmon *hwmon = i915->hwmon; > > u32 r; > > > > - if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) > > + if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) { > > + /* Fix uninitialized bool variable warning */ > > + *old = false; > > return; > > + } > > > > mutex_lock(&hwmon->hwmon_lock); > > > > -- > > 2.38.0 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-12 9:33 ` Andi Shyti @ 2023-05-12 20:40 ` Dixit, Ashutosh 0 siblings, 0 replies; 7+ messages in thread From: Dixit, Ashutosh @ 2023-05-12 20:40 UTC (permalink / raw) To: Andi Shyti; +Cc: intel-gfx, dri-devel, Rodrigo Vivi On Fri, 12 May 2023 02:33:33 -0700, Andi Shyti wrote: > Hi Andi, > > On Thu, May 11, 2023 at 10:43:30AM -0700, Dixit, Ashutosh wrote: > > On Wed, 10 May 2023 11:36:06 -0700, Ashutosh Dixit wrote: > > > > > > Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL) > > > causes the following warning: > > > > > > UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2 > > > load of value 255 is not a valid value for type '_Bool' > > > Call Trace: > > > dump_stack_lvl+0x57/0x7d > > > ubsan_epilogue+0x5/0x40 > > > __ubsan_handle_load_invalid_value.cold+0x43/0x48 > > > __uc_init_hw+0x76a/0x903 [i915] > > > ... > > > i915_driver_probe+0xfb1/0x1eb0 [i915] > > > i915_pci_probe+0xbe/0x2d0 [i915] > > > > > > The warning happens because during probe i915_hwmon is still not available > > > which results in the output boolean variable *old remaining > > > uninitialized. > > > > Note that the variable was uninitialized in this case but it was never used > > uninitialized (the variable was not needed when it was uninitialized). So > > there was no bug in the code. UBSAN warning is just complaining about the > > uninitialized variable being passed into a function (where it is not used). > > > > Also the variable can be initialized in the caller (__uc_init_hw) too and > > it will fix this issue. However in __uc_init_hw the assumption is that the > > variable will be initialized in the callee (i915_hwmon_power_max_disable), > > so that is how I have done it in this patch. > > > > I thought these clarifications will help with the review. > > I think we should not just consider what's now but also what can > come later. The use of pl1en is not 100% future proof and > therefore your patch, even though now is not fixing anything, > might avoid wrong uses in the future. > > I'm just wondering, though, why not initializing the variable at > it's declaration. As you wish. OK, in v2 I went ahead and did just that (initializing the variable at the declaration). I was splitting hair too much :/ > Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Thanks. -- Ashutosh > > > > > Silence the warning by initializing the variable to an arbitrary value. > > > > > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > > > --- > > > drivers/gpu/drm/i915/i915_hwmon.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c > > > index a3bdd9f68a458..685663861bc0b 100644 > > > --- a/drivers/gpu/drm/i915/i915_hwmon.c > > > +++ b/drivers/gpu/drm/i915/i915_hwmon.c > > > @@ -502,8 +502,11 @@ void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old) > > > struct i915_hwmon *hwmon = i915->hwmon; > > > u32 r; > > > > > > - if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) > > > + if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) { > > > + /* Fix uninitialized bool variable warning */ > > > + *old = false; > > > return; > > > + } > > > > > > mutex_lock(&hwmon->hwmon_lock); > > > > > > -- > > > 2.38.0 > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning 2023-05-10 18:36 [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Ashutosh Dixit ` (2 preceding siblings ...) 2023-05-11 17:43 ` [Intel-gfx] [PATCH] " Dixit, Ashutosh @ 2023-05-12 9:41 ` Andrzej Hajda 3 siblings, 0 replies; 7+ messages in thread From: Andrzej Hajda @ 2023-05-12 9:41 UTC (permalink / raw) To: Ashutosh Dixit, intel-gfx; +Cc: dri-devel, Rodrigo Vivi On 10.05.2023 20:36, Ashutosh Dixit wrote: > Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL) > causes the following warning: > > UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2 > load of value 255 is not a valid value for type '_Bool' > Call Trace: > dump_stack_lvl+0x57/0x7d > ubsan_epilogue+0x5/0x40 > __ubsan_handle_load_invalid_value.cold+0x43/0x48 > __uc_init_hw+0x76a/0x903 [i915] > ... > i915_driver_probe+0xfb1/0x1eb0 [i915] > i915_pci_probe+0xbe/0x2d0 [i915] > > The warning happens because during probe i915_hwmon is still not available > which results in the output boolean variable *old remaining > uninitialized. Silence the warning by initializing the variable to an > arbitrary value. > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Regards Andrzej > --- > drivers/gpu/drm/i915/i915_hwmon.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c > index a3bdd9f68a458..685663861bc0b 100644 > --- a/drivers/gpu/drm/i915/i915_hwmon.c > +++ b/drivers/gpu/drm/i915/i915_hwmon.c > @@ -502,8 +502,11 @@ void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old) > struct i915_hwmon *hwmon = i915->hwmon; > u32 r; > > - if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) > + if (!hwmon || !i915_mmio_reg_valid(hwmon->rg.pkg_rapl_limit)) { > + /* Fix uninitialized bool variable warning */ > + *old = false; > return; > + } > > mutex_lock(&hwmon->hwmon_lock); > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-05-12 20:40 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-05-10 18:36 [Intel-gfx] [PATCH] drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Ashutosh Dixit 2023-05-11 0:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 2023-05-11 3:56 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork 2023-05-11 17:43 ` [Intel-gfx] [PATCH] " Dixit, Ashutosh 2023-05-12 9:33 ` Andi Shyti 2023-05-12 20:40 ` Dixit, Ashutosh 2023-05-12 9:41 ` Andrzej Hajda
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox