From nobody Fri May 17 03:00:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113052+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704243566635364.48595557901797; Tue, 2 Jan 2024 16:59:26 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=noZgXohYsUhCMyJ3x+wuX0kjS3sFq9PQdQU8MUrtGII=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704243566; v=1; b=R61AqdefD2Jn6OyoJanv33UCqUtljFDDLw/lT7x9UcR6lBVF5v5/CJkT5HGTYCJ2ve3DpdzZ iV2RUQHqBJ9H/t9Qy66U0JLY99siy+VrGZ2VwiNwcgTZDf4KgdWLJY3yHefTZitCK7XhHKNUiwz KngHklcB0fcwCAdkMyiTpZsw= X-Received: by 127.0.0.2 with SMTP id 1hSPYY1788612xqAtM9QS6LJ; Tue, 02 Jan 2024 16:59:26 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.52]) by mx.groups.io with SMTP id smtpd.web10.24041.1704176853513145269 for ; Mon, 01 Jan 2024 22:27:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UsZNPc2vJfnmdbaIMXYrqKjn39CYT71n7rVoPQJvmyJXcbbelAlrHfyFfYw/krq/qeKemgHJskk/v3YwZRm9E+Hezaklpqe4fEZqzj1/UH9tCfLiWhR4ZqIQXtbuSMcjusYjl9RO5fCiyArnXauUxIBedA7odb8EuGaRQqiwx6v7QiwoIcPWeWqVHAvuRhwaP+X7r0mdEXrdovGoJCawPzGfpFCwbAyyLttcuVZzaCbKcndnWZpQZLWVmBoObyOeG5suRvifN7cKIM29OFJkTvkklnaVpCtnPO2tIzaVWK2SCyKbd/cNGwtoXqz0RyJIgGCAFZO23VQ8ZPSk3CCidA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VUCxEX8AD0ewmbkyyzZdKmxTgYd44oxuLnMrO7XaiAU=; b=UJmHC3Qr8Z6LcfjDY0NDoFIY/UO+E9Gce1BQkJReXSrxq3SsA6B9u1pqMULA6/8jo9/n4gDCHg2battqxBlYdk0QRXPVygVEbSRlTI+p0xdKQxrtMWQ30r2ml94KlNac2bbenK9pQ7kVFvzSCSjDbJrHul0UfeGNrrWa2fZuRT28hCdkUPiXQoWNVy4ORNmXU+XGHz90P6o5b8fm0a0hYy5A6Qj8o9A6AB0Cd4NQpudTmPvv19iByTrmC9KfhJAD/T4/e+bR5+6GewZjbhPD/tbq7vEah3gnVls8K/lvCYfu25FlDJ4BvRX0xqUapaI/fzFM7QDcRS9B/F+ec5rUbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from SN7P222CA0015.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:124::29) by CO6PR12MB5476.namprd12.prod.outlook.com (2603:10b6:303:138::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Tue, 2 Jan 2024 06:27:31 +0000 X-Received: from SN1PEPF0002529D.namprd05.prod.outlook.com (2603:10b6:806:124:cafe::8f) by SN7P222CA0015.outlook.office365.com (2603:10b6:806:124::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25 via Frontend Transport; Tue, 2 Jan 2024 06:27:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113052+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002529D.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Tue, 2 Jan 2024 06:27:30 +0000 X-Received: from MSDN-L-IGNICUFU.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 2 Jan 2024 00:27:28 -0600 From: "Igniculus.Fu via groups.io" To: CC: Bob Feng , Liming Gao , Yuwei Chen , Abner Chang , "Eric Xing" , Abdul Lateef Attar Subject: [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation. Date: Tue, 2 Jan 2024 14:27:11 +0800 Message-ID: <20240102062711.180-1-igniculus.fu@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529D:EE_|CO6PR12MB5476:EE_ X-MS-Office365-Filtering-Correlation-Id: bd3af8e2-a923-4c47-d70c-08dc0b5be5ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 9DwJoPFotcNV5N98qfDtsVJAcXbbECqL2FHkuSNeqSrSWil3ih00sKvDqvKPhBN0+N0ExHsmIaowNs3shQzlzufhSF6xZlWP6x8ltOgyWWdo7VcHsW4xsdNp7021hJOLIL81jQfr4i3tSHmEOBxWh60ah+XLl/NQ+TpSdffe+auv9GOVt+kApj3TFnbiNqcZgA35BhAcLwSf3j9xJvnsMOX6OxG0TkSfKlJq6s1hpEQDsem9DebQxwfV10PrK/qlUGmNEa/aFx3b+Ua6iKX5k7N8Asy6Bq5LEaF4JJEx5tlFVqs/XFkVxuaBx1QsktYxUw2W1eiVri2TyAF/IcXrq/iFUeWG5RYEiruSPUVysyhNc6vSQTAZcDvkUlVGBbd8S0P0q7dkM9ja1H0AEP2YqkhqU3cMD0IPNIUsv6PTaOk3MNhh/xhbeXionHSLO1Ka49yhqRpzDdFhsHX8SLLed0Qw9N/FgKewbJew8NkTXrS739JzW6XQLGVlCFVB1LUUYPjxlHeKqUgiJ/nEblN4zuye8vxtTESG1WBlCfYz8IqZXMI1gQNy12BoiJnGvdtaM3WoHmksFixMFwAMks7M4zvYXk+CbbGh8oPGAfGXXjlpdZer2uE3KpOVKRrlwUXX11+h4G0Hi66uuCCTa2gMFq3/unovGKFDbpnyW3/tk27gXP3Hrxed7fSnL7ggE1BldFBkpLdMxpnJ8PLIKohJHZysP1Ga0wVi66wWEVJ0ISFFSyOFhvPW8t9VccIk1r30FH+ESSO5Wosz9/1hv+duSg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2024 06:27:30.4766 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd3af8e2-a923-4c47-d70c-08dc0b5be5ce X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002529D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5476 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,Igniculus.Fu@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3HzzJJs8qU0xFMHwqTxxn8cQx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704243568505100014 Content-Type: text/plain; charset="utf-8" From: Igniculus Fu Bugzilla ticket #4633 FdfParser.py has defined a key named OEM_CAPSULE_FLAGS to set the lower 16 bits of EFI_CAPSULE_HEADER.Flags. However, this key is totally "forgotten" in Capsule.py, making it impossible to set lower 16 bits of this field, and leading to an always FALSE when comparing to gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag in MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c: ProcessTheseCapsules(). This patch ORs the value of OEM_CAPSULE_FLAGS with previously calculated CAPSULE_FLAGS value, making the lower 16 bits of value being correctly set. Signed-off-by: Igniculus Fu Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Abner Chang Cc: Eric Xing Cc: Abdul Lateef Attar Reviewed-by: Liming Gao --- BaseTools/Source/Python/GenFds/Capsule.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/P= ython/GenFds/Capsule.py index f4bfc74e55..d274d8f03e 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -1,6 +1,7 @@ ## @file # generate capsule # +# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -78,6 +79,8 @@ class Capsule (CapsuleClassObject): Flags |=3D 0x00010000 elif flag =3D=3D 'InitiateReset': Flags |=3D 0x00040000 + if 'OEM_CAPSULE_FLAGS' in self.TokensDict: + Flags |=3D int(self.TokensDict['OEM_CAPSULE_FLAGS'],16) Header.write(pack('=3DI', Flags)) # # typedef struct { -- 2.38.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113052): https://edk2.groups.io/g/devel/message/113052 Mute This Topic: https://groups.io/mt/103494173/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-