From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (NAM02-CY1-obe.outbound.protection.outlook.com [40.92.4.107]) by mx.groups.io with SMTP id smtpd.web10.76079.1597785428257324655 for ; Tue, 18 Aug 2020 14:17:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=aadMs5AP; spf=pass (domain: outlook.com, ip: 40.92.4.107, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gq+wlbvHzV6sca/lvKdV1SWLlPCyXx1yz59JwDROD5Pk2Pi3SJEDq7745kQAheQoeWYMvilMrxJ3W00bpw/RghoSigi2+rMq9swww50WgbyL5S4YzDZGQkle+WT0yGpMSqkc+be8SEJK4EnylFw7HcPyMcD9rn6Kdx/MbehghGgYbzpR23BkmAODlU4s9eLyD8Lk0RFpYIe0AgKCLowYalCB4P9qSLjzsZGHgdihgYanCmdq7emrDY4Qovehzbx5HbEe7N6PPPkz9GFqMCEuXWPnp7v8TFJWUN8NctLTkWmr5LUEyGPgljslGQJO0DkEtNSFdJNQOz4nMtWGA+7G+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8ANfWbXH2EnT9C8MQqBV96OkER/ESktNT1ybcKt0/s=; b=RJv8fN8zBjxnNVKH8xaZ3ZXtYpmo7/8gKcetSIPL+6gcaPkpOdfwx2hbDAs42LgVLcdhy6z27pDbtncbW9UOZSUWo0bftT8SrCkMQtpEZf8h3c26h1jlcuX9NAaQbzz38tuZ0mQ1bKYwA/G53D8uaMStpN/m1woMGmgulwXxFWyk44YmNfRIo62/g0slLQtrjVw7e0uxZtr1TNkhw4D7cA7z+XQ29UaHdFC3fYLgEogIyGEfyyBayoIB6wTtuBMOl2j8PF2FVuti0Op1wl7wwFqUdr7temy/euECV/bwIRFHycW6I2+AdDPwZ1OhcyQGJK6G9L7eCPcfkjJXD80pWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8ANfWbXH2EnT9C8MQqBV96OkER/ESktNT1ybcKt0/s=; b=aadMs5APV98r7t+Gujs/8PRlT645zzRZ50feAFBsvrR/t9fYT4rVhRu5RapslgfUzMpqOo9rNgqG9MRDJfSeA6wSV+XwEpMz51z/k95SP/yA7YkHQLEvql3Oz61fTQotXITaNPCM7kYeZvKFwcv+BZU0RjOIHU8dICl/XxL+D/WoAwk4zlDgT5A+EAgaRoMJ7fxeHWNyL1KV4xsTcnwkvKAGpUku6qrqRwTZ+DjfIsBrKKOO9r7EogOamovdJZbtNIdvQtLPp9vRk3UQC/xDcc3uJpblgtgqYX0P75bEPr8DRV199zXpSq2tfmOjrAqjovSxE3slINBCWEr0CbeeDQ== Received: from SN1NAM02FT007.eop-nam02.prod.protection.outlook.com (10.152.72.53) by SN1NAM02HT152.eop-nam02.prod.protection.outlook.com (10.152.73.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Tue, 18 Aug 2020 21:17:07 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:7e44::4e) by SN1NAM02FT007.mail.protection.outlook.com (2a01:111:e400:7e44::88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Tue, 18 Aug 2020 21:17:07 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:E7C96030B5B5B714873199627B5B3075898317035DCA8CBF4171557136A874A9;UpperCasedChecksum:F39A2F615E0D987330C6EBBD249955AC2888D7E7FB533D3E040067BC26F55F8B;SizeAsReceived:7794;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::eda9:ccc8:2ef:2471]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::eda9:ccc8:2ef:2471%7]) with mapi id 15.20.3283.027; Tue, 18 Aug 2020 21:17:07 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io CC: Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu Subject: [PATCH v3 2/6] FmpDevicePkg: Add Last Attempt Status header files Date: Tue, 18 Aug 2020 14:16:25 -0700 Message-ID: X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200818211629.1193-1-michael.kubacki@outlook.com> References: <20200818211629.1193-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR14CA0033.namprd14.prod.outlook.com (2603:10b6:300:12b::19) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200818211629.1193-3-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:1:e4ef:ebe4:8509:47e7) by MWHPR14CA0033.namprd14.prod.outlook.com (2603:10b6:300:12b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24 via Frontend Transport; Tue, 18 Aug 2020 21:17:06 +0000 X-Mailer: git-send-email 2.28.0.windows.1 X-Microsoft-Original-Message-ID: <20200818211629.1193-3-michael.kubacki@outlook.com> X-TMN: [8G2MudcD3pX9WWGNZ+YXsv4nlNrOJ6h+nJ6VF5CH0NSkJ6OtJFUoC7DvxEbqjmel] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 28d15501-7f7f-46b1-525b-08d843bc0f93 X-MS-TrafficTypeDiagnostic: SN1NAM02HT152: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s21qJsmqj0pybQ+tXxKEqP8CtJecE8f+mhBMe0AJxWlj2PGXvLo7mS/zmDtc5RCMSxJYMqeZt6fuacwKkPsnr5ZLqBj/+GbyTnENWH5oqwa7Iyv+eVibDvqGYKdHTVtGDR8Xj9KYjyF+AwM3iG5mAxpTTlpBzYfQytUvAIgfiVcqKKR+sua45EQ85OLSI2O5pduQpUVcI0C2sjQI/19xtg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: 5YtBpnfvpFQVAXqTBo430nqTB0glcLe9ZUTrSoosTdRdKFpWfCsrnxBQ8HIuJ+pIlkuceXM7r09itug1IsDZT6w010sfxyzLRJrcv7AgDu1N5sriBZJls8rywBoVN0j7xyvq+5Cn5LdjC235+bj/gDg6TtS5B84jKEeaxz0C0RypngOo0O5rMo/IbOw0D0EZEjcA/GbUEf8FycNaXAEGJA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28d15501-7f7f-46b1-525b-08d843bc0f93 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2020 21:17:07.1598 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT007.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT152 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Michael Kubacki Introduces a public and a private header file to define more granular usage of the UEFI Specification defined unsuccessful vendor range for Last Attempt Status codes. The unsuccessful vendor range is described in UEFI Specification 2.8A section 23.4. The public header file Include/LastAttemptStatus.h defines ranges within the unsuccessful vendor range. At a high-level, the two main ranges are defined are the FMP Reserved range and the Device Library Reserved range. The FMP Reserved range is reserved for usage of components within FmpDevicePkg. PrivateInclude/FmpLastAttemptStatus.h contains usage details and specific Last Attempt Status code definitions. The Device Library Reserved range is reserved for usage by FmpDeviceLib instances. Each library may define custom Last Attempt Status codes within the bounds defined in Include/LastAttemptStatus.h: [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE] Cc: Liming Gao Cc: Michael D Kinney Cc: Guomin Jiang Cc: Wei6 Xu Signed-off-by: Michael Kubacki --- FmpDevicePkg/Include/LastAttemptStatus.h | 96 ++++++++++++++++++= ++ FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h | 80 ++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/FmpDevicePkg/Include/LastAttemptStatus.h b/FmpDevicePkg/Includ= e/LastAttemptStatus.h new file mode 100644 index 000000000000..aded6f3633cf --- /dev/null +++ b/FmpDevicePkg/Include/LastAttemptStatus.h @@ -0,0 +1,96 @@ +/** @file + Defines last attempt status code ranges within the UEFI Specification + defined unsuccessful vendor range. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __LAST_ATTEMPT_STATUS_H__ +#define __LAST_ATTEMPT_STATUS_H__ + +/// +/// Last Attempt Status Unsuccessful Vendor Range Map +/// +/// Update this map any time new ranges are added. Pre-existing range defi= nitions cannot be modified +/// to keep status code definitions consistent over time. +/// +/// START | END | Usage +/// ----------------------------------------------------------------------= ----------------------------------------| +/// 0x1000 | 0x1FFF | FmpDxe and other core infrastructure/libraries= implemented in FmpDevicePkg | +/// 0x1000 | 0x107F | FmpDxe driver = | +/// 0x1080 | 0x109F | Functionality that determines FMP dependencies= (e.g. FmpDependencyLib) | +/// 0x2000 | 0x3FFF | FMP device-specific codes defined locally in a= n FmpDeviceLib instance implementation | +/// + +/// +/// Total length of the unsuccessful vendor range reserved for FMP ranges = to be +/// defined for FmpDevicePkg usage. +/// +#define LAST_ATTEMPT_STATUS_FMP_RESERVED_RANGE_LENGTH 0x1000 + +/// +/// The minimum value of the FMP reserved range. +/// +#define LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MIN + +/// +/// The maximum value of the FMP reserved range. +/// +#define LAST_ATTEMPT_STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_FMP_RESERVED_RANGE_LENGTH - 1 + +/// +/// Length of the error code range for FmpDxe driver-specific errors. +/// +#define LAST_ATTEMPT_STATUS_DRIVER_ERROR_RANGE_LENGTH 0x80 + +/// +/// The minimum value allowed for FmpDxe driver-specific errors. +/// +#define LAST_ATTEMPT_STATUS_DRIVER_MIN_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + +/// +/// The maximum value allowed for FmpDxe driver-specific errors. +/// +#define LAST_ATTEMPT_STATUS_DRIVER_MAX_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_DRIVER_ERROR_RANGE_LENGTH - 1 +/// +/// Length of the error code range for FMP dependency related errors. +/// +#define LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_RANGE_LENGTH 0x20 + +/// +/// The maximum value allowed for FMP dependency related errors. +/// +#define LAST_ATTEMPT_STATUS_DEPENDENCY_MIN_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_DRIVER_ERROR_RANGE_LENGTH + +/// +/// The maximum value allowed for FMP dependency related errors. +/// +#define LAST_ATTEMPT_STATUS_DEPENDENCY_MAX_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_DRIVER_ERROR_RANGE_LENGTH + \ + LAST_ATT= EMPT_STATUS_DEPENDENCY_ERROR_RANGE_LENGTH - 1 + +/// +/// Total length of the unsuccessful vendor range reserved for FMP device = library +/// usage. +/// +#define LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_RESERVED_RANGE_LENGTH 0x2000 + +/// +/// The minimum value allowed for FMP device library errors. +/// +#define LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_FMP_RESERVED_RANGE_LENGTH + +/// +/// The maximum value allowed for FMP device library errors. +/// +#define LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE LAST_ATTEM= PT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE + \ + LAST_ATT= EMPT_STATUS_DEVICE_LIBRARY_RESERVED_RANGE_LENGTH - 1 + +#endif diff --git a/FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h b/FmpDevice= Pkg/PrivateInclude/FmpLastAttemptStatus.h new file mode 100644 index 000000000000..1da99378c01b --- /dev/null +++ b/FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h @@ -0,0 +1,80 @@ +/** @file + Defines private last attempt status codes used in FmpDevicePkg. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __FMP_LAST_ATTEMPT_STATUS_H__ +#define __FMP_LAST_ATTEMPT_STATUS_H__ + +/// +/// Last attempt status codes defined for additional granularity in FmpDev= icePkg components. +/// +/// These codes are defined within the last attempt status FMP reserved ra= nge which extends from +/// LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE to LAST_ATTEMPT_= STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE. +/// +/// The following last attempt status code ranges are currently defined fo= r the corresponding component: +/// * LAST_ATTEMPT_STATUS_DRIVER - FMP driver +/// * LAST_ATTEMPT_STATUS_DEPENDENCY - FMP dependency functionality +/// +/// Future last attempt status code additions in FmpDevicePkg should be ad= ded as follows: +/// * FmpDxe driver: Onto the end of the LAST_ATTEMPT_STATUS_DRIVER_ERRO= R range +/// * FMP dependency functionality: Onto the end of the LAST_ATTEMPT_STA= TUS_DEPENDENCY_ERROR range +/// * Other components: Add a new range onto the end of the last existin= g range in the enum within the limits of +/// [LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE,LAST_ATTEMP= T_STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE] +/// +/// The value of pre-existing last attempt status codes should never be mo= dified to ensure the values remain +/// consistent over time. +/// +enum LAST_ATTEMPT_STATUS_EXPANDED_ERROR_LIST +{ + /// + /// Last attempt status codes used in FmpDxe + /// + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER =3D LAST= _ATTEMPT_STATUS_DRIVER_MIN_ERROR_CODE_VALUE, + LAST_ATTEMPT_STATUS_DRIVER_ERROR_PROGRESS_CALLBACK_ERROR , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_POWER_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_SYS_THERMAL_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_THERMAL , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_SYS_ENV_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_SYSTEM_ENV , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER_SIZE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_ALL_HEADER_SIZE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER_VERSION , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_NOT_PROVIDED , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_NOT_UPDATABLE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_CERTIFICATE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_IMAGE_INDEX , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_KEY_LENGTH , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_KEY_LENGTH_VALUE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_VERSION_TOO_LOW , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_DEVICE_LOCKED , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_AUTH_FAILURE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_PROTOCOL_ARG_MISSING , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_MAX_ERROR_CODE =3D LAST= _ATTEMPT_STATUS_DRIVER_MAX_ERROR_CODE_VALUE, + + /// + /// Last attempt status codes used in FMP dependency related functionali= ty + /// + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_GET_DEPEX_FAILURE = =3D LAST_ATTEMPT_STATUS_DEPENDENCY_MIN_ERROR_CODE_VALUE, + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_NO_END_OPCODE = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_UNKNOWN_OPCODE = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_FMP_PROTOCOL_NOT_FOUND = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_MEM_ALLOC_FMP_INFO_BUFFER_FAILED = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_MEM_ALLOC_DESC_VER_BUFFER_FAILED = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_MEM_ALLOC_DESC_SIZE_BUFFER_FAILED = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_MEM_ALLOC_FMP_VER_BUFFER_FAILED = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_GUID_BEYOND_DEPEX = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_VERSION_BEYOND_DEPEX = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_VERSION_STR_BEYOND_DEPEX = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_FMP_NOT_FOUND = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_PUSH_FAILURE = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_POP_FAILURE = , + LAST_ATTEMPT_STATUS_DEPENDENCY_ERROR_MAX_ERROR_CODE = =3D LAST_ATTEMPT_STATUS_DEPENDENCY_MAX_ERROR_CODE_VALUE + +}; + +#endif --=20 2.28.0.windows.1