/* * The GSC will return PXP_STATUS_OP_NOT_PERMITTED if the HuC is already * loaded. If the same error is ever returned with HuC not loaded we'll * still catch it when we check the authentication bit later.
*/ if (msg_out->huc_out.header.status != PXP_STATUS_SUCCESS &&
msg_out->huc_out.header.status != PXP_STATUS_OP_NOT_PERMITTED) {
huc_err(huc, "auth failed with GSC error = 0x%x\n",
msg_out->huc_out.header.status);
err = -EIO; goto out_unpin;
}
if (!huc_fw->has_gsc_headers) {
huc_err(huc, "Invalid FW type for GSC header parsing!\n"); return -EINVAL;
}
if (size < sizeof(*header)) {
huc_err(huc, "FW too small! %zu < %zu\n", size, min_size); return -ENODATA;
}
/* * The GSC-enabled HuC binary starts with a directory header, followed * by a series of entries. Each entry is identified by a name and * points to a specific section of the binary containing the relevant * data. The entries we're interested in are: * - "HUCP.man": points to the GSC manifest header for the HuC, which * contains the version info. * - "huc_fw": points to the legacy-style binary that can be used for * load via the DMA. This entry only contains a valid CSS * on binaries for platforms that support 2-step HuC load * via dma and auth via GSC (like MTL). * * -------------------------------------------------- * [ intel_gsc_cpd_header_v2 ] * -------------------------------------------------- * [ intel_gsc_cpd_entry[] ] * [ entry1 ] * [ ... ] * [ entryX ] * [ "HUCP.man" ] * [ ... ] * [ offset >----------------------------]------o * [ ... ] | * [ entryY ] | * [ "huc_fw" ] | * [ ... ] | * [ offset >----------------------------]----------o * -------------------------------------------------- | | * | | * -------------------------------------------------- | | * [ intel_gsc_manifest_header ]<-----o | * [ ... ] | * [ intel_gsc_version fw_version ] | * [ ... ] | * -------------------------------------------------- | * | * -------------------------------------------------- | * [ data[] ]<---------o * [ ... ] * [ ... ] * --------------------------------------------------
*/
if (header->header_marker != INTEL_GSC_CPD_HEADER_MARKER) {
huc_err(huc, "invalid marker for CPD header: 0x%08x!\n",
header->header_marker); return -EINVAL;
}
/* we only have binaries with header v2 and entry v1 for now */ if (header->header_version != 2 || header->entry_version != 1) {
huc_err(huc, "invalid CPD header/entry version %u:%u!\n",
header->header_version, header->entry_version); return -EINVAL;
}
for (i = 0; i < header->num_of_entries; i++, entry++) { if (strcmp(entry->name, "HUCP.man") == 0)
intel_uc_fw_version_from_gsc_manifest(&huc_fw->file_selected.ver,
data + entry_offset(entry));
if (strcmp(entry->name, "huc_fw") == 0) {
u32 offset = entry_offset(entry);
int intel_huc_fw_load_and_auth_via_gsc(struct intel_huc *huc)
{ int ret;
if (!intel_huc_is_loaded_by_gsc(huc)) return -ENODEV;
if (!intel_uc_fw_is_loadable(&huc->fw)) return -ENOEXEC;
/* * If we abort a suspend, HuC might still be loaded when the mei * component gets re-bound and this function called again. If so, just * mark the HuC as loaded.
*/ if (intel_huc_is_authenticated(huc, INTEL_HUC_AUTH_BY_GSC)) {
intel_uc_fw_change_status(&huc->fw, INTEL_UC_FIRMWARE_RUNNING); return 0;
}
GEM_WARN_ON(intel_uc_fw_is_loaded(&huc->fw));
ret = intel_pxp_huc_load_and_auth(huc_to_gt(huc)->i915->pxp); if (ret) return ret;
/** * intel_huc_fw_upload() - load HuC uCode to device via DMA transfer * @huc: intel_huc structure * * Called from intel_uc_init_hw() during driver load, resume from sleep and * after a GPU reset. Note that HuC must be loaded before GuC. * * The firmware image should have already been fetched into memory, so only * check that fetch succeeded, and then transfer the image to the h/w. * * Return: non-zero code on error
*/ int intel_huc_fw_upload(struct intel_huc *huc)
{ if (intel_huc_is_loaded_by_gsc(huc)) return -ENODEV;
/* HW doesn't look at destination address for HuC, so set it to 0 */ return intel_uc_fw_upload(&huc->fw, 0, HUC_UKERNEL);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.