* [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
@ 2019-09-24 14:02 brandon.hong
2019-09-24 14:59 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev2) Patchwork
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: brandon.hong @ 2019-09-24 14:02 UTC (permalink / raw)
To: igt-dev
From: Brandon Hong <brandon.hong@intel.com>
270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
resolver resolve_half_to_float() tries to call unbound global function
igt_x86_features(). This patch fixes the issue by adding a F16C checking
local function.
Signed-off-by: Brandon Hong <brandon.hong@intel.com>
---
lib/igt_halffloat.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
index 08ab05fc..fa7ad2e0 100644
--- a/lib/igt_halffloat.c
+++ b/lib/igt_halffloat.c
@@ -24,6 +24,7 @@
#include <assert.h>
#include <math.h>
+#include <stdbool.h>
#include "igt_halffloat.h"
#include "igt_x86.h"
@@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val)
}
#if defined(__x86_64__) && !defined(__clang__)
+#include <cpuid.h>
+
#pragma GCC push_options
#pragma GCC target("f16c")
@@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
#pragma GCC pop_options
+static bool f16c_is_supported(void)
+{
+ unsigned max = __get_cpuid_max(0, NULL);
+ unsigned eax, ebx, ecx, edx;
+
+ if (max >= 1) {
+ __cpuid(1, eax, ebx, ecx, edx);
+
+ if (ecx & bit_F16C)
+ return true;
+ }
+ return false;
+}
+
static void float_to_half(const float *f, uint16_t *h, unsigned int num)
{
for (int i = 0; i < num; i++)
@@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
f[i] = _half_to_float(h[i]);
}
+
static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
{
- if (igt_x86_features() & F16C)
+ if (f16c_is_supported())
return float_to_half_f16c;
return float_to_half;
@@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
{
- if (igt_x86_features() & F16C)
+ if (f16c_is_supported())
return half_to_float_f16c;
return half_to_float;
--
2.23.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread* [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev2) 2019-09-24 14:02 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong @ 2019-09-24 14:59 ` Patchwork 2019-09-25 4:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2019-09-27 17:26 ` [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function Ville Syrjälä 2 siblings, 0 replies; 5+ messages in thread From: Patchwork @ 2019-09-24 14:59 UTC (permalink / raw) To: Hong, Brandon; +Cc: igt-dev == Series Details == Series: Fix global symbol loading failure in resolve function (rev2) URL : https://patchwork.freedesktop.org/series/67150/ State : success == Summary == CI Bug Log - changes from IGT_5202 -> IGTPW_3496 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/67150/revisions/2/mbox/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_3496: ### IGT changes ### #### Suppressed #### The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@gem_ctx_switch@rcs0: - {fi-tgl-u}: [PASS][1] -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/fi-tgl-u/igt@gem_ctx_switch@rcs0.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/fi-tgl-u/igt@gem_ctx_switch@rcs0.html Known issues ------------ Here are the changes found in IGTPW_3496 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_exec_suspend@basic-s4-devices: - fi-blb-e6850: [PASS][3] -> [INCOMPLETE][4] ([fdo#107718]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/fi-blb-e6850/igt@gem_exec_suspend@basic-s4-devices.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/fi-blb-e6850/igt@gem_exec_suspend@basic-s4-devices.html * igt@kms_frontbuffer_tracking@basic: - fi-hsw-peppy: [PASS][5] -> [DMESG-WARN][6] ([fdo#102614]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html #### Possible fixes #### * igt@gem_ctx_switch@rcs0: - {fi-icl-guc}: [INCOMPLETE][7] ([fdo#107713]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/fi-icl-guc/igt@gem_ctx_switch@rcs0.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/fi-icl-guc/igt@gem_ctx_switch@rcs0.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-kbl-7500u: [FAIL][9] ([fdo#111045] / [fdo#111096]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614 [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713 [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718 [fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566 [fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045 [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096 Participating hosts (53 -> 46) ------------------------------ Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus Build changes ------------- * CI: CI-20190529 -> None * IGT: IGT_5202 -> IGTPW_3496 CI-20190529: 20190529 CI_DRM_6948: 485ca160d8ffac7ffb5be5e76fa12ad46a7e5a19 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_3496: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/ IGT_5202: 3499c5eb17054e2abd88023fe962768140d24302 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 5+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for Fix global symbol loading failure in resolve function (rev2) 2019-09-24 14:02 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong 2019-09-24 14:59 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev2) Patchwork @ 2019-09-25 4:29 ` Patchwork 2019-09-27 17:26 ` [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function Ville Syrjälä 2 siblings, 0 replies; 5+ messages in thread From: Patchwork @ 2019-09-25 4:29 UTC (permalink / raw) To: Hong, Brandon; +Cc: igt-dev == Series Details == Series: Fix global symbol loading failure in resolve function (rev2) URL : https://patchwork.freedesktop.org/series/67150/ State : failure == Summary == CI Bug Log - changes from IGT_5202_full -> IGTPW_3496_full ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_3496_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_3496_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://patchwork.freedesktop.org/api/1.0/series/67150/revisions/2/mbox/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_3496_full: ### IGT changes ### #### Possible regressions #### * igt@kms_flip@modeset-vs-vblank-race-interruptible: - shard-snb: [PASS][1] -> [FAIL][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-snb2/igt@kms_flip@modeset-vs-vblank-race-interruptible.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-snb4/igt@kms_flip@modeset-vs-vblank-race-interruptible.html Known issues ------------ Here are the changes found in IGTPW_3496_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_exec_schedule@preempt-contexts-bsd2: - shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#109276]) +11 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb4/igt@gem_exec_schedule@preempt-contexts-bsd2.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb3/igt@gem_exec_schedule@preempt-contexts-bsd2.html * igt@gem_exec_schedule@preempt-other-chain-bsd: - shard-iclb: [PASS][5] -> [SKIP][6] ([fdo#111325]) +5 similar issues [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb7/igt@gem_exec_schedule@preempt-other-chain-bsd.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@gem_exec_schedule@preempt-other-chain-bsd.html * igt@gem_tiled_swapping@non-threaded: - shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([fdo#108686]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-kbl3/igt@gem_tiled_swapping@non-threaded.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-kbl6/igt@gem_tiled_swapping@non-threaded.html * igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled: - shard-iclb: [PASS][9] -> [FAIL][10] ([fdo#103184] / [fdo#103232]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb6/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb5/igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled.html * igt@kms_flip@flip-vs-suspend-interruptible: - shard-kbl: [PASS][11] -> [DMESG-WARN][12] ([fdo#108566]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-kbl1/igt@kms_flip@flip-vs-suspend-interruptible.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-kbl3/igt@kms_flip@flip-vs-suspend-interruptible.html * igt@kms_flip@modeset-vs-vblank-race: - shard-apl: [PASS][13] -> [FAIL][14] ([fdo#111609]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl5/igt@kms_flip@modeset-vs-vblank-race.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl5/igt@kms_flip@modeset-vs-vblank-race.html * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt: - shard-iclb: [PASS][15] -> [FAIL][16] ([fdo#103167]) +8 similar issues [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt.html * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-wc: - shard-glk: [PASS][17] -> [FAIL][18] ([fdo#103167]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-glk7/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-wc.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-glk6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-wc.html * igt@kms_psr@psr2_sprite_blt: - shard-iclb: [PASS][19] -> [SKIP][20] ([fdo#109441]) +1 similar issue [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb1/igt@kms_psr@psr2_sprite_blt.html * igt@kms_vblank@pipe-a-ts-continuation-suspend: - shard-apl: [PASS][21] -> [DMESG-WARN][22] ([fdo#108566]) +4 similar issues [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl8/igt@kms_vblank@pipe-a-ts-continuation-suspend.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl6/igt@kms_vblank@pipe-a-ts-continuation-suspend.html * igt@kms_vblank@pipe-b-ts-continuation-suspend: - shard-hsw: [PASS][23] -> [INCOMPLETE][24] ([fdo#103540]) +1 similar issue [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-hsw4/igt@kms_vblank@pipe-b-ts-continuation-suspend.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-hsw8/igt@kms_vblank@pipe-b-ts-continuation-suspend.html #### Possible fixes #### * igt@gem_ctx_isolation@bcs0-s3: - shard-apl: [DMESG-WARN][25] ([fdo#108566]) -> [PASS][26] +2 similar issues [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl1/igt@gem_ctx_isolation@bcs0-s3.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl3/igt@gem_ctx_isolation@bcs0-s3.html * igt@gem_exec_schedule@preempt-bsd1: - shard-iclb: [SKIP][27] ([fdo#109276]) -> [PASS][28] +14 similar issues [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb6/igt@gem_exec_schedule@preempt-bsd1.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@gem_exec_schedule@preempt-bsd1.html * igt@gem_exec_schedule@wide-bsd: - shard-iclb: [SKIP][29] ([fdo#111325]) -> [PASS][30] +5 similar issues [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb2/igt@gem_exec_schedule@wide-bsd.html [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb5/igt@gem_exec_schedule@wide-bsd.html * igt@kms_cursor_edge_walk@pipe-c-256x256-top-edge: - shard-apl: [TIMEOUT][31] -> [PASS][32] [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl6/igt@kms_cursor_edge_walk@pipe-c-256x256-top-edge.html [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl2/igt@kms_cursor_edge_walk@pipe-c-256x256-top-edge.html * igt@kms_flip@plain-flip-ts-check-interruptible: - shard-glk: [FAIL][33] ([fdo#100368]) -> [PASS][34] [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-glk6/igt@kms_flip@plain-flip-ts-check-interruptible.html [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-glk5/igt@kms_flip@plain-flip-ts-check-interruptible.html - shard-hsw: [INCOMPLETE][35] ([fdo#103540]) -> [PASS][36] [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-hsw1/igt@kms_flip@plain-flip-ts-check-interruptible.html [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-hsw5/igt@kms_flip@plain-flip-ts-check-interruptible.html * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render: - shard-iclb: [FAIL][37] ([fdo#103167]) -> [PASS][38] [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render.html [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render.html * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a: - shard-iclb: [DMESG-WARN][39] -> [PASS][40] [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb6/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html * igt@kms_plane@pixel-format-pipe-a-planes-source-clamping: - shard-apl: [INCOMPLETE][41] ([fdo#103927]) -> [PASS][42] [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl5/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl6/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html * igt@kms_psr@no_drrs: - shard-iclb: [FAIL][43] ([fdo#108341]) -> [PASS][44] [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb1/igt@kms_psr@no_drrs.html [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@kms_psr@no_drrs.html * igt@kms_psr@psr2_cursor_plane_onoff: - shard-iclb: [SKIP][45] ([fdo#109441]) -> [PASS][46] +2 similar issues [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-iclb1/igt@kms_psr@psr2_cursor_plane_onoff.html [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html * igt@perf_pmu@cpu-hotplug: - shard-apl: [DMESG-WARN][47] -> [PASS][48] [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5202/shard-apl6/igt@perf_pmu@cpu-hotplug.html [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/shard-apl8/igt@perf_pmu@cpu-hotplug.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368 [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167 [fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184 [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232 [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341 [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566 [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686 [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276 [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441 [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325 [fdo#111609]: https://bugs.freedesktop.org/show_bug.cgi?id=111609 [fdo#111795 ]: https://bugs.freedesktop.org/show_bug.cgi?id=111795 Participating hosts (7 -> 6) ------------------------------ Missing (1): shard-skl Build changes ------------- * CI: CI-20190529 -> None * IGT: IGT_5202 -> IGTPW_3496 CI-20190529: 20190529 CI_DRM_6948: 485ca160d8ffac7ffb5be5e76fa12ad46a7e5a19 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_3496: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/ IGT_5202: 3499c5eb17054e2abd88023fe962768140d24302 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3496/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function 2019-09-24 14:02 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong 2019-09-24 14:59 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev2) Patchwork 2019-09-25 4:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork @ 2019-09-27 17:26 ` Ville Syrjälä 2019-09-30 9:04 ` Hong, Brandon 2 siblings, 1 reply; 5+ messages in thread From: Ville Syrjälä @ 2019-09-27 17:26 UTC (permalink / raw) To: brandon.hong; +Cc: igt-dev On Tue, Sep 24, 2019 at 10:02:29PM +0800, brandon.hong@intel.com wrote: > From: Brandon Hong <brandon.hong@intel.com> > > 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc > resolver resolve_half_to_float() tries to call unbound global function > igt_x86_features(). This patch fixes the issue by adding a F16C checking > local function. The rules for this stuff seem to be poorly documented. But I did find some docs that support this. So generally lgtm, just a few nitpicks below... > > Signed-off-by: Brandon Hong <brandon.hong@intel.com> > --- > lib/igt_halffloat.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c > index 08ab05fc..fa7ad2e0 100644 > --- a/lib/igt_halffloat.c > +++ b/lib/igt_halffloat.c > @@ -24,6 +24,7 @@ > > #include <assert.h> > #include <math.h> > +#include <stdbool.h> > > #include "igt_halffloat.h" > #include "igt_x86.h" > @@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val) > } > > #if defined(__x86_64__) && !defined(__clang__) > +#include <cpuid.h> igt_x86.c has HAVE_CPUID_H protection around this stuff. I suppose we'd want the same here? > + > #pragma GCC push_options > #pragma GCC target("f16c") > > @@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num) > > #pragma GCC pop_options > > +static bool f16c_is_supported(void) > +{ > + unsigned max = __get_cpuid_max(0, NULL); > + unsigned eax, ebx, ecx, edx; > + > + if (max >= 1) { > + __cpuid(1, eax, ebx, ecx, edx); > + > + if (ecx & bit_F16C) > + return true; > + } > + return false; > +} > + > static void float_to_half(const float *f, uint16_t *h, unsigned int num) > { > for (int i = 0; i < num; i++) > @@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num) > f[i] = _half_to_float(h[i]); > } > > + Spurious newline. > static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num) > { > - if (igt_x86_features() & F16C) > + if (f16c_is_supported()) > return float_to_half_f16c; > > return float_to_half; > @@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num) > > static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num) > { > - if (igt_x86_features() & F16C) > + if (f16c_is_supported()) > return half_to_float_f16c; > > return half_to_float; > -- > 2.23.0 > > _______________________________________________ > igt-dev mailing list > igt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/igt-dev -- Ville Syrjälä Intel _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function 2019-09-27 17:26 ` [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function Ville Syrjälä @ 2019-09-30 9:04 ` Hong, Brandon 0 siblings, 0 replies; 5+ messages in thread From: Hong, Brandon @ 2019-09-30 9:04 UTC (permalink / raw) To: Ville Syrjälä; +Cc: igt-dev@lists.freedesktop.org > On 28 Sep 2019, at 2:26 AM, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote: > > On Tue, Sep 24, 2019 at 10:02:29PM +0800, brandon.hong@intel.com wrote: >> From: Brandon Hong <brandon.hong@intel.com> >> >> 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc >> resolver resolve_half_to_float() tries to call unbound global function >> igt_x86_features(). This patch fixes the issue by adding a F16C checking >> local function. > > The rules for this stuff seem to be poorly documented. But I did find > some docs that support this. So generally lgtm, just a few nitpicks > below… > >> >> Signed-off-by: Brandon Hong <brandon.hong@intel.com> >> --- >> lib/igt_halffloat.c | 22 ++++++++++++++++++++-- >> 1 file changed, 20 insertions(+), 2 deletions(-) >> >> diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c >> index 08ab05fc..fa7ad2e0 100644 >> --- a/lib/igt_halffloat.c >> +++ b/lib/igt_halffloat.c >> @@ -24,6 +24,7 @@ >> >> #include <assert.h> >> #include <math.h> >> +#include <stdbool.h> >> >> #include "igt_halffloat.h" >> #include "igt_x86.h" >> @@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val) >> } >> >> #if defined(__x86_64__) && !defined(__clang__) >> +#include <cpuid.h> > > igt_x86.c has HAVE_CPUID_H protection around this stuff. > I suppose we'd want the same here? Thanks for pointing it out. Will add HAVE_CPUID_H as same as igt_x86.c file. > >> + >> #pragma GCC push_options >> #pragma GCC target("f16c") >> >> @@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num) >> >> #pragma GCC pop_options >> >> +static bool f16c_is_supported(void) >> +{ >> + unsigned max = __get_cpuid_max(0, NULL); >> + unsigned eax, ebx, ecx, edx; >> + >> + if (max >= 1) { >> + __cpuid(1, eax, ebx, ecx, edx); >> + >> + if (ecx & bit_F16C) >> + return true; >> + } >> + return false; >> +} >> + >> static void float_to_half(const float *f, uint16_t *h, unsigned int num) >> { >> for (int i = 0; i < num; i++) >> @@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num) >> f[i] = _half_to_float(h[i]); >> } >> >> + > > Spurious newline. Will remove it and re-submit. > >> static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num) >> { >> - if (igt_x86_features() & F16C) >> + if (f16c_is_supported()) >> return float_to_half_f16c; >> >> return float_to_half; >> @@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num) >> >> static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num) >> { >> - if (igt_x86_features() & F16C) >> + if (f16c_is_supported()) >> return half_to_float_f16c; >> >> return half_to_float; >> -- >> 2.23.0 >> >> _______________________________________________ >> igt-dev mailing list >> igt-dev@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/igt-dev > > -- > Ville Syrjälä > Intel _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-09-30 9:04 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-09-24 14:02 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong 2019-09-24 14:59 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev2) Patchwork 2019-09-25 4:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2019-09-27 17:26 ` [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function Ville Syrjälä 2019-09-30 9:04 ` Hong, Brandon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox