* [igt-dev] [PATCH i-g-t v2] intel-gfx-fw-info: Make it compatible with HuC via GSC
@ 2023-04-25 15:39 Lucas De Marchi
2023-04-25 19:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for intel-gfx-fw-info: Make it compatible with HuC via GSC (rev2) Patchwork
0 siblings, 1 reply; 2+ messages in thread
From: Lucas De Marchi @ 2023-04-25 15:39 UTC (permalink / raw)
To: igt-dev; +Cc: Lucas De Marchi, Balasubramani Vivekanandan
When HuC is loaded via GSC, the firmware format is different and there
is no information for kernel to parse except the version, that is in
a different location. Check for the magic field as the first dword and
parse the blob differently based on that.
Tesetd with
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915/dg2_huc_gsc.bin?id=8f86b5ab3e051170ea240fc409d457e16e24bc21,
with output "version: 7.10.3" as expected. Also checked with a couple
of GuC firmware blobs and CSS-based HuC firmware blobs to guarantee
this doesn't regress.
v2: Add explicit ver_hi and ver_lo field to better visualize dump (Bala)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
---
tools/intel-gfx-fw-info | 85 +++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 20 deletions(-)
diff --git a/tools/intel-gfx-fw-info b/tools/intel-gfx-fw-info
index 77903bbb7..5eb733120 100755
--- a/tools/intel-gfx-fw-info
+++ b/tools/intel-gfx-fw-info
@@ -59,6 +59,25 @@ struct uc_css_header {
} rsvd;
u32 header_info;
};
+
+#define HUC_GSC_VERSION_HI_DW 44
+#define HUC_GSC_MAJOR_VER_HI_MASK (0xFF << 0)
+#define HUC_GSC_MINOR_VER_HI_MASK (0xFF << 16)
+#define HUC_GSC_VERSION_LO_DW 45
+#define HUC_GSC_PATCH_VER_LO_MASK (0xFF << 0)
+
+// Add a fake definition for the GSC's header so this script can still
+// check the version
+
+struct uc_huc_gsc_header {
+ u32 rsvd[HUC_GSC_VERSION_HI_DW];
+ u32 ver_hi;
+ u32 ver_lo;
+};
+
+struct magic {
+ char data[4];
+};
"""
logging.basicConfig(format="%(levelname)s: %(message)s")
@@ -83,26 +102,47 @@ def FIELD_GET(mask: int, value: int) -> int:
return (value & mask) >> ffs(mask)
-def decode(fw) -> str:
- data = []
+class Fw:
+ def __init__(self, fw):
+ self.fw = fw
+
+
+class FwCss(Fw):
+ def decode(self):
+ data = []
+
+ CSS_SW_VERSION_UC_MAJOR = 0xFF << 16
+ CSS_SW_VERSION_UC_MINOR = 0xFF << 8
+ CSS_SW_VERSION_UC_PATCH = 0xFF
+ major = FIELD_GET(CSS_SW_VERSION_UC_MAJOR, self.fw.sw_version)
+ minor = FIELD_GET(CSS_SW_VERSION_UC_MINOR, self.fw.sw_version)
+ patch = FIELD_GET(CSS_SW_VERSION_UC_PATCH, self.fw.sw_version)
+ data += [f"version: {major}.{minor}.{patch}"]
+
+ CSS_DATE_DAY = 0xFF
+ CSS_DATE_MONTH = 0xFF << 8
+ CSS_DATE_YEAR = 0xFFFF << 16
+ day = FIELD_GET(CSS_DATE_DAY, self.fw.date)
+ month = FIELD_GET(CSS_DATE_MONTH, self.fw.date)
+ year = FIELD_GET(CSS_DATE_YEAR, self.fw.date)
+ data += [f"date: {year:02x}-{month:02x}-{day:02x}"]
+
+ return data
+
- CSS_SW_VERSION_UC_MAJOR = 0xFF << 16
- CSS_SW_VERSION_UC_MINOR = 0xFF << 8
- CSS_SW_VERSION_UC_PATCH = 0xFF
- major = FIELD_GET(CSS_SW_VERSION_UC_MAJOR, fw.sw_version)
- minor = FIELD_GET(CSS_SW_VERSION_UC_MINOR, fw.sw_version)
- patch = FIELD_GET(CSS_SW_VERSION_UC_PATCH, fw.sw_version)
- data += [f"version: {major}.{minor}.{patch}"]
+class FwGsc(Fw):
+ def decode(self):
+ data = []
- CSS_DATE_DAY = 0xFF
- CSS_DATE_MONTH = 0xFF << 8
- CSS_DATE_YEAR = 0xFFFF << 16
- day = FIELD_GET(CSS_DATE_DAY, fw.date)
- month = FIELD_GET(CSS_DATE_MONTH, fw.date)
- year = FIELD_GET(CSS_DATE_YEAR, fw.date)
- data += [f"date: {year:02x}-{month:02x}-{day:02x}"]
+ HUC_GSC_MINOR_VER_HI_MASK = 0xFF << 16
+ HUC_GSC_MAJOR_VER_HI_MASK = 0xFF
+ HUC_GSC_PATCH_VER_LO_MASK = 0xFF
+ major = FIELD_GET(HUC_GSC_MAJOR_VER_HI_MASK, self.fw.ver_hi)
+ minor = FIELD_GET(HUC_GSC_MINOR_VER_HI_MASK, self.fw.ver_hi)
+ patch = FIELD_GET(HUC_GSC_PATCH_VER_LO_MASK, self.fw.ver_lo)
+ data += [f"version: {major}.{minor}.{patch}"]
- return data
+ return data
def parse_args(argv: typing.List[str]) -> argparse.Namespace:
@@ -122,14 +162,19 @@ def main(argv: typing.List[str]) -> int:
try:
with open(args.filename, mode="rb") as f:
- fw = cparser.uc_css_header(f)
+ magic = cparser.magic(f)
+ f.seek(0, 0)
+ if magic.data == b"$CPD":
+ fw = FwGsc(cparser.uc_huc_gsc_header(f))
+ else:
+ fw = FwCss(cparser.uc_css_header(f))
except FileNotFoundError as e:
logging.fatal(e)
return 1
- print(*decode(fw), sep="\n")
+ print(*fw.decode(), sep="\n")
print("raw dump:", end="")
- cstruct.dumpstruct(fw, color=sys.stdout.isatty())
+ cstruct.dumpstruct(fw.fw, color=sys.stdout.isatty())
return 0
--
2.39.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for intel-gfx-fw-info: Make it compatible with HuC via GSC (rev2)
2023-04-25 15:39 [igt-dev] [PATCH i-g-t v2] intel-gfx-fw-info: Make it compatible with HuC via GSC Lucas De Marchi
@ 2023-04-25 19:53 ` Patchwork
0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2023-04-25 19:53 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 5138 bytes --]
== Series Details ==
Series: intel-gfx-fw-info: Make it compatible with HuC via GSC (rev2)
URL : https://patchwork.freedesktop.org/series/116500/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_13062 -> IGTPW_8857
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_8857 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_8857, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/index.html
Participating hosts (39 -> 37)
------------------------------
Missing (2): fi-kbl-soraka fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_8857:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_suspend@basic-s3@smem:
- bat-rpls-1: NOTRUN -> [ABORT][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html
* igt@i915_selftest@live@slpc:
- bat-rpls-1: NOTRUN -> [FAIL][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-rpls-1/igt@i915_selftest@live@slpc.html
#### Warnings ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-tgl-1115g4: [INCOMPLETE][3] ([i915#7443]) -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13062/fi-tgl-1115g4/igt@i915_suspend@basic-s3-without-i915.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/fi-tgl-1115g4/igt@i915_suspend@basic-s3-without-i915.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* igt@i915_selftest@live@slpc:
- {bat-mtlp-8}: NOTRUN -> [FAIL][5] +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-mtlp-8/igt@i915_selftest@live@slpc.html
Known issues
------------
Here are the changes found in IGTPW_8857 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_suspend@basic-s3-without-i915:
- bat-adls-5: [PASS][6] -> [FAIL][7] ([fdo#103375]) +7 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13062/bat-adls-5/igt@i915_suspend@basic-s3-without-i915.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-adls-5/igt@i915_suspend@basic-s3-without-i915.html
* igt@kms_pipe_crc_basic@read-crc:
- bat-dg2-11: NOTRUN -> [SKIP][8] ([i915#5354])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-dg2-11/igt@kms_pipe_crc_basic@read-crc.html
#### Possible fixes ####
* igt@i915_selftest@live@requests:
- {bat-mtlp-8}: [ABORT][9] -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13062/bat-mtlp-8/igt@i915_selftest@live@requests.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/bat-mtlp-8/igt@i915_selftest@live@requests.html
* igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][11] ([i915#8384]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13062/bat-rpls-1/igt@i915_selftest@live@reset.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/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#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#7443]: https://gitlab.freedesktop.org/drm/intel/issues/7443
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7270 -> IGTPW_8857
CI-20190529: 20190529
CI_DRM_13062: 5a0333cf630a335d7e8f60fd2b8526ed0895900c @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8857: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/index.html
IGT_7270: 3bd8bf9bca97bbfb7b4b408f9fccd0cf6f742d4c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
-igt@xe_gpgpu_fill@basic
-igt@xe_intel_bb@add-remove-objects
-igt@xe_intel_bb@bb-with-allocator
-igt@xe_intel_bb@blit-reloc
-igt@xe_intel_bb@blit-simple
-igt@xe_intel_bb@create-in-region
-igt@xe_intel_bb@delta-check
-igt@xe_intel_bb@destroy-bb
-igt@xe_intel_bb@full-batch
-igt@xe_intel_bb@intel-bb-blit-none
-igt@xe_intel_bb@intel-bb-blit-x
-igt@xe_intel_bb@intel-bb-blit-y
-igt@xe_intel_bb@lot-of-buffers
-igt@xe_intel_bb@offset-control
-igt@xe_intel_bb@purge-bb
-igt@xe_intel_bb@render
-igt@xe_intel_bb@reset-bb
-igt@xe_intel_bb@simple-bb
-igt@xe_intel_bb@simple-bb-ctx
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8857/index.html
[-- Attachment #2: Type: text/html, Size: 5943 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-25 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 15:39 [igt-dev] [PATCH i-g-t v2] intel-gfx-fw-info: Make it compatible with HuC via GSC Lucas De Marchi
2023-04-25 19:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for intel-gfx-fw-info: Make it compatible with HuC via GSC (rev2) Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox