From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.92.18.48]) by mx.groups.io with SMTP id smtpd.web10.229.1601655966250360218 for ; Fri, 02 Oct 2020 09:26:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=nXYSPBvx; spf=pass (domain: outlook.com, ip: 40.92.18.48, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vs2iK/tsCBPsPLMOr2NbbLA435zLmviXMjaA9tYfi5yGUUKtzTyyd0PLnxSp9RsNLc2VK1UKYYfoPjtONS7kFr7LSCoI3b3W+txogiwtW2ScZa8r4GkoOgzi2/xpn2cFOe019rG8/g3f1MgH+SpgjyjbCEp3YT4QGEXbLfN/JTI1V744N1B9YxiptSij56Udm93CgXRHIXz4OPz6aeQf1LFaHpjKU2ktW8Abt0MLwdTBX8M64v/Kx8gBqMb8QWN7vha2AFslqxQ/nWCGnNo+Ik8lXvuBIkBvrlzU0xHzLpURUDlduPFQ5pwjw0itF8VMU1RPF8aGJVYd9hrxsHGmVg== 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=zY82sa3b8leKofNQuc4AhgqZiY8SsxXZI+jUl7rmbhQ=; b=f8zucWqxN3LZ65W6wLly9XYMVJTNH74Hx1PBp3UIPLm4t9Ws82zjFLGaBYueMWF1/9wpu4zg/5/Y1fMVdSYVO9LFeCAi0JOt1KgRY2NN4HGX1m+X/i5cRkhw4aSy6lqTCJ0c8qCcUkVKGrakl7G63+nEKR48ceuSnsOIO2VuqFz0hBwR+NgJFMKY0VjMZNidGhewquQmMF0SeCi+CnlxNDdf9+dtcBSAl9EKlROuy9v2vX2Ho5KnZh+ImAfU/LxfdzbP0Lsx51dodpAebpY9Lxv6hto0csvKPl+/fJKvUKAxTcbeBwQf4OXyXW9LQSker5/8rsvQMQU4O3tD9p5spQ== 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=zY82sa3b8leKofNQuc4AhgqZiY8SsxXZI+jUl7rmbhQ=; b=nXYSPBvxhSfql29HikquY0SkpdVSJhOGe+BoK/GBw98qIZHjZg03Or7HgBjZHjw38ZGv8QUn8T1SUTrmZDLURiuZamlbpzsSdBgF9MXFQwTsChZymKRJTF9HUUZ+ivUdx4wwHJHFvKYVBakTiB93GXnoLJhZQBxiC4qgI4K9mes8BnCLK3F0SCxtwI/ssgKOJXFCPB5qU+opQYiG36ADE0161fgJE6ENthiffpDqCi61kcJLjoXUz/Hpcaw7c83Pz5/C64j8RZeLEznLWLN0eKKozvoIxSHyDGkiuTPqOCgYcvyET+XD20OaMzPF+CAMroMX2olNLFm1cMmfkl0a1Q== Received: from CO1NAM11FT063.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::47) by CO1NAM11HT131.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::354) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.35; Fri, 2 Oct 2020 16:26:05 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:3861::51) by CO1NAM11FT063.mail.protection.outlook.com (2a01:111:e400:3861::293) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.35 via Frontend Transport; Fri, 2 Oct 2020 16:26:05 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:59F6027D91461A30249BE27A1B0D7377826EA68882C45CF0E33D0253B695B744;UpperCasedChecksum:E1E769D7C610ED313B6F9D5053598BA9C1DD21566CF1B81E76572B71744D447C;SizeAsReceived:9100;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.3391.032; Fri, 2 Oct 2020 16:26:05 +0000 Subject: Re: [PATCH v4 0/6] Extend Last Attempt Status Usage From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu , Zhiguang Liu References: Message-ID: Date: Fri, 2 Oct 2020 09:26:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 In-Reply-To: X-ClientProxiedBy: MWHPR11CA0010.namprd11.prod.outlook.com (2603:10b6:301:1::20) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2001:4898:d8:39:7cad:ce5:3274:1d18] (2001:4898:80e8:3:fcd2:ce5:3274:1d18) by MWHPR11CA0010.namprd11.prod.outlook.com (2603:10b6:301:1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Fri, 2 Oct 2020 16:26:04 +0000 X-Microsoft-Original-Message-ID: X-TMN: [I+lrVoFPbu/D0KjI9EZ4KHyyRuRng7BcqxjhTVsfpVIPQTRQd0Bd5GlyfNvQSteb] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5692128f-56c8-462b-07f6-08d866efdbf6 X-MS-TrafficTypeDiagnostic: CO1NAM11HT131: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X49VZNxgBWElSFg8UTKgACzNs2RMEaFB96kzIB46H3j0SOFzW23JEZMpWMT8tgmXvjOMm3uVlwmD5plh7+nBJSc8FJTqVD0YWtL/K94kIs3gyWdZ9J7lnkVqSO/iERdlDfBph+CEbb8yf8iWaXYcHESw6rAw61ssBG09FbDEAs7VFLj5MoDnaGR+AG3x1W3GqMOrExGRC+yUrOfzkycmYSBViG9piqIJ2OJM9FHzLD8a6nat1rzHmwu1YT80nJnw X-MS-Exchange-AntiSpam-MessageData: hIVv6WjvPwgLFTLtKeIMTuy9MRF9mfZsJla9/Y/1FOK2WZnTFCEzwnn1ePSmiZCt002qnEzUBn/MGMEC1Rt7rxQLOSXIvK9ppQstKN9D7bpJKv8kM47Kf12Pa00S2h27nGH6tHhwf4UaZANTEqBecQzXbwD9e9280GiBVzDGomPC25pGRDCpyUX3sTIu4SIPMNMJFDfrgBxlmwNAnCdqUQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5692128f-56c8-462b-07f6-08d866efdbf6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2020 16:26:04.9654 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT063.eop-nam11.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: CO1NAM11HT131 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit It is going on a week now and I haven't seen a response to this patch series yet. Please review it when possible. On a somewhat related note, I made the changes that should be necessary in edk2-platforms for backward compatibility in this patch: https://edk2.groups.io/g/devel/message/65821 Thanks, Michael On 9/25/2020 7:19 PM, michael.kubacki@outlook.com wrote: > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2802 > > This patch series adds more granularity to Last Attempt Status > codes reported during FMP check image and set image operations > that greatly improve precision of the status codes. > > The unsuccessful vendor range (0x1000 - 0x4000) was introduced > in UEFI Specification 2.8. At a high-level, two subranges are > defined within that range in this patch series: > 1. The FMP Reserved range - reserved for components implemented > in FmpDevicePkg. > 2. The FMP Device Library Reserved range - reserved for > FmpDeviceLib instance-specific usage. > > The ranges are described in a public header file LastAttemptStatus.h > while the specific codes used within FmpDevicePkg implementation > are defined in a private header file FmpLastAttemptStatus.h. > > FmpDeviceLib instances should use the range definition from the > public header file to define Last Attempt Status codes local to > their library instance. > > Of note, there's multiple approaches to assigning private status > codes in the FMP Reserved range. For example, individual components > could define their last attempt status codes locally with the > range allocated to the component defined in a package-wide private > header file. However, one goal of the granularity being introduced > is to provide straightforward traceability to an error source. > > For that reason, it was chosen to define a constant set of codes at > the package level in FmpLastAttemptStatus.h. For example, if a new > FmpDependencyLib instance is added, it would not be able to reassign > status code values in the pre-existing FMP Dependency range; it > would reuse codes for the same error source and be able to add new > codes onto the range for its usage. > > V4 changes: > 1. Simplified range value definitions in LastAttemptStatus.h. > Directly assign the values in the macro definition instead > of using calculations. > 2. Adjusted range sizes to leave more room for future expansion. > > OLD: > START | END | Usage > ------------------------------------------------| > 0x1000 | 0x1FFF | FmpDevicePkg | > 0x1000 | 0x107F | FmpDxe driver | > 0x1080 | 0x109F | FMP dependency Libs | > 0x2000 | 0x3FFF | FmpDeviceLib instances | > > NEW: > START | END | Usage > ----------------------------------------------------------------| > 0x1000 | 0x17FF | FmpDevicePkg | > 0x1000 | 0x107F | FmpDxe driver | > 0x1080 | 0x109F | FmpDependencyLib | > 0x10A0 | 0x10BF | FmpDependencyCheckLib | > 0x10C0 | 0x17FF | Unused. Available for future expansion. | > 0x1800 | 0x1FFF | FmpDeviceLib instances implementation | > 0x2000 | 0x3FFF | Unused. Available for future expansion. | > > 3. Broke the single range in v3 for FMP Dependency libraries into > separate ranges. > 4. Clarified LastAttemptStatus return values in each function > description. > 5. Returned an expected LastAttemptStatus value for some functions > that previously did not return a value. > 6. Reverted changes in FmpDxe to call the new FmpDeviceLib APIs > for FmpDeviceCheckImage () and FmpDeviceSetImage (). These will > be added in a future series after impacted platforms in > edk2-platforms are updated to use the new APIs. > 7. Instead of directly changing the pre-existing APIs in > FmpDeviceLib to add a LastAttemptStatus parameter, the new > functions were added to the library interface: > * FmpDeviceCheckImageWithStatus () > * FmpDeviceSetImageWithStatus () > > V3 changes: > 1. Enhanced range definitions in LastAttemptStatus.h with more > completeness providing length, min, and max values. > 2. Moved the actual Last Attempt Status code assignments to a > private header file PrivateInclude/FmpLastAttemptStatus.h. > 3. Changed the value of > LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MAX > to 0x3FFF instead of 0x4000 even though 0x4000 is defined in > the UEFI specification. The length is 0x4000 but the max > allowed value should be 0x3FFF. This change was made now to > prevent implementation compatibility issues in the future. > 4. Included "DEVICE" in the following macro name to clearly > associate it with the FmpDeviceLib library class: > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_ERROR_xxx > 5. Included a map to help the reader better visualize the range > definitions in LastAttemptStatus.h. > 6. Included additional documentation describing the enum in > FmpLastAttemptStatus.h. An explicit statement stating that new > codes should be added onto the end of ranges to preserve the > values was added. > 7. Simplified error handling logic in FmpDxe for FmpDeviceLib > calls that return Last Attempt Status. > 8. V2 had a single memory allocation failure code used for > different memory allocations in CheckFmpDependency () in > FmpDependencyLib. Each potential allocation failure was > assigned a unique code. > > V2 changes: > 1. Consolidate all previous incremental updates to > LastAttemptStatus.h into one patch (patch 2) > 2. Move LastAttemptStatus.h from Include to PrivateInclude > 3. Correct patch 1 subject from "FmpDevicePkg" to "MdePkg" > > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Guomin Jiang > Cc: Wei6 Xu > Cc: Zhiguang Liu > Signed-off-by: Michael Kubacki > > Michael Kubacki (6): > MdePkg/SystemResourceTable.h: Add vendor range values > FmpDevicePkg: Add Last Attempt Status header files > FmpDevicePkg/FmpDxe: Add check image path Last Attempt Status > capability > FmpDevicePkg/FmpDxe: Improve set image path Last Attempt Status > granularity > FmpDevicePkg: Add Last Attempt Status support to dependency libs > FmpDevicePkg/FmpDeviceLib: Add Last Attempt Status to Check/Set API > > FmpDevicePkg/FmpDxe/FmpDxe.c | 146 +++++++++++++++++--- > FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c | 39 ++++-- > FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c | 14 +- > FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c | 93 +++++++++++-- > FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c | 132 +++++++++++++++++- > FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/EvaluateDependencyUnitTest.c | 7 +- > FmpDevicePkg/FmpDxe/FmpDxe.h | 4 +- > FmpDevicePkg/Include/LastAttemptStatus.h | 81 +++++++++++ > FmpDevicePkg/Include/Library/FmpDependencyCheckLib.h | 8 +- > FmpDevicePkg/Include/Library/FmpDependencyLib.h | 44 ++++-- > FmpDevicePkg/Include/Library/FmpDeviceLib.h | 121 +++++++++++++++- > FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h | 81 +++++++++++ > MdePkg/Include/Guid/SystemResourceTable.h | 13 ++ > 13 files changed, 718 insertions(+), 65 deletions(-) > create mode 100644 FmpDevicePkg/Include/LastAttemptStatus.h > create mode 100644 FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h >