From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.83]) by mx.groups.io with SMTP id smtpd.web08.59844.1629315767889338886 for ; Wed, 18 Aug 2021 12:42:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=b4OvkuRV; spf=pass (domain: arm.com, ip: 40.107.15.83, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ikI3+HMCcWa8fvg4ThRb28PQ3WNAZ5G68M1wV5/On98=; b=b4OvkuRVauQphaDVFPPL+gQykaNhhZLIursrvb7wgzP0Ia8xuc11XFPS6jZoDJnoZChr6Yxor8I9fRnS4+vauyXPuhjahZFgqTQVpk2tX7qF62d+LbqxM7x9e14w4zfTgbpxEY1iYIqOSN2wnGwtirIAnGI/VhlqCJneuhRdtM8= Received: from AM6PR02CA0029.eurprd02.prod.outlook.com (2603:10a6:20b:6e::42) by VI1PR0802MB2558.eurprd08.prod.outlook.com (2603:10a6:800:ae::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Wed, 18 Aug 2021 19:42:40 +0000 Received: from AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:6e:cafe::44) by AM6PR02CA0029.outlook.office365.com (2603:10a6:20b:6e::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 18 Aug 2021 19:42:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT016.mail.protection.outlook.com (10.152.16.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 18 Aug 2021 19:42:39 +0000 Received: ("Tessian outbound 32695b2df2f8:v103"); Wed, 18 Aug 2021 19:42:39 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8b12b48e85111348 X-CR-MTA-TID: 64aa7808 Received: from 4fcfd340f80f.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 303B5312-0C9A-4BEE-8B87-FBCBF1FA1F76.1; Wed, 18 Aug 2021 19:42:33 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4fcfd340f80f.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Aug 2021 19:42:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E8v0tuzFLvc8mILjlgSWlPaQjRNPBTH/JPlu1YC2q4C/yiz1WS53f0hS8Kl+SdSKrmkzbFGyASnAHrWeZcWWK2U+BI2NrlgvSnZQ3LheXUQTsGWNzSQ/fKHalzGKOOvjjYVx7eqBliIVE0/XUx/FRUap023vdA0K7u5w4pZhXEbQhCyLR0YZRbs4UjN+w/7kaFN1dLwP9eoED/urkJcbZwjRQ1tnj5nA1yKgZHpBCZ11xb4+Azzp/w481kkvKkTP2FbNhUdWfW8BwVbPkE18PXcaSKRQGTl2nHxjLi43bOZ8RP5BQm0hhc43nNoYxJGqDScYjlN8jVA22Ic2MOIZiA== 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=ikI3+HMCcWa8fvg4ThRb28PQ3WNAZ5G68M1wV5/On98=; b=XFvTDpsxgQaNjIN1tXpQYS4//SslkozuBVJSUDz99bsarL4d7ATf/UXqz5iZ8TNRhH6ObKAw4F4u29YnD5FfKV+T2Yn+s78TwVt+/vSvaCRlBx1s4S+jOcLP0Nr4Ku1KYHT5eLezmPmUk+ufqIeg360pXXkUO0SfhrC4gMpf45yJ4EYEBWfRHXnMPUu+z9Xn9RUJxmjPllHpP95jg1Ts9xBWJeUrGNg5b/JAzXIzhreTBoe1YTwcA63wXdV1i3Y4xrQrRVnfzgvr2kBhW8xlErQFuUlha3/F3EOwMlF7E4dwZ1R+CUqTxy6mb9GI79jxM0n5VaISgWtz9xJdlgkkfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ikI3+HMCcWa8fvg4ThRb28PQ3WNAZ5G68M1wV5/On98=; b=b4OvkuRVauQphaDVFPPL+gQykaNhhZLIursrvb7wgzP0Ia8xuc11XFPS6jZoDJnoZChr6Yxor8I9fRnS4+vauyXPuhjahZFgqTQVpk2tX7qF62d+LbqxM7x9e14w4zfTgbpxEY1iYIqOSN2wnGwtirIAnGI/VhlqCJneuhRdtM8= Received: from PAXPR08MB6987.eurprd08.prod.outlook.com (2603:10a6:102:1df::15) by PAXPR08MB6509.eurprd08.prod.outlook.com (2603:10a6:102:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 18 Aug 2021 19:42:23 +0000 Received: from PAXPR08MB6987.eurprd08.prod.outlook.com ([fe80::8888:874d:364:7237]) by PAXPR08MB6987.eurprd08.prod.outlook.com ([fe80::8888:874d:364:7237%5]) with mapi id 15.20.4415.024; Wed, 18 Aug 2021 19:42:22 +0000 From: "Samer El-Haj-Mahmoud" To: Grzegorz Bernacki , "devel@edk2.groups.io" CC: "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , Sunny Wang , "mw@semihalf.com" , "upstream@semihalf.com" , "pete@akeo.ie" , Samer El-Haj-Mahmoud Subject: Re: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot Discovery Policy change. Thread-Topic: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot Discovery Policy change. Thread-Index: AQHXlAQLZhhzOlB+aU2ftZWPuWnWf6t5qi2Q Date: Wed, 18 Aug 2021 19:42:22 +0000 Message-ID: References: <20210818073811.3571796-1-gjb@semihalf.com> In-Reply-To: <20210818073811.3571796-1-gjb@semihalf.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: semihalf.com; dkim=none (message not signed) header.d=none;semihalf.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 06d937e6-6086-4415-0309-08d962805694 x-ms-traffictypediagnostic: PAXPR08MB6509:|VI1PR0802MB2558: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2733;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6MH+rAn0fRY5DNfZOSY8KBM2czYCXGuP0ZGvrrFKfO+h88TxzfCstPnMyNsyGRjq5onWl2mTSMccc5F169GCX/C57BqaYkcRSnwXqV4Ttb0BxHBPzkbCWn/Y9QivVTkwZZCKQqGbPzaj9VTgs6Ey0CKnku9yykFb3zEiz90Jr28TkYN3ckk9DsCSmvAzIhaOnV8kyKSN+xqW53PZNx+sYtvuC435sCiZRZPUC+Rla3lRSD1SW5hM38c5ZV+i7IcrmmWe4vy6tnr+pJbmKNscxZlMRrjOckB9QapQJ+9i6iEP5J0JCec7cZjlg6R/CnbimcRiUIsGyg9fm/8n73KDgG+M/HpdcZbc9o1KAh96VXH5Z96svyj0JKn1qYSgINsZK6XwK6NI4Hy4GyE0fn6qJDul7m3iEB6XL3a2uMw6JPw5WFq800ChNntHSnsXHGdKF14Y8npln6BkDm30EEgzCf1D6FSL3H8WByKdXQDEwNsFYjOS1XDmkDv0711C3nIFiP+JTMGG/HmL0iiKIhla6rYV+5WDvjmTZRu2w6i9hDFOj4FsmfsTY0quBW3A/VseveNOcMz6/ORJ7EDaICEcvCOXEa42oj9r9XPkSDBfc+PLHywNWl8Od83Weewl6lBdtW3Q5oHh5Vhdv1tLmr53PYkZ4ByFXwIAm1NEW4EDuJpjW4XNPQDCOjo/G70tXXLE1r4ULZffvhlGVoiu4kxvew== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6987.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(39850400004)(396003)(366004)(136003)(316002)(186003)(8676002)(38100700002)(122000001)(9686003)(4326008)(55016002)(71200400001)(2906002)(83380400001)(110136005)(54906003)(478600001)(66476007)(76116006)(66446008)(64756008)(7696005)(52536014)(6506007)(26005)(66556008)(8936002)(53546011)(86362001)(5660300002)(66946007)(33656002)(38070700005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hGpnN3rD9s7dL6cPEs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= =?us-ascii?Q?UhjROElM3g6a0YS06qTlDn99ktaZV+oroQ75RFcqFRbpb9hfiCepXp5sOEMr?= =?us-ascii?Q?wxrdyF6YVGcCTPTk31WqQbZz8LqYwOlsGNoBTrz36Idm3tVr45ixlMqarKl4?= =?us-ascii?Q?yaK56JgfvXe0QCzo9vv8svtWlBB8NgMIkCGNUZjCpY0yuhZPUgqUGJcrxws9?= =?us-ascii?Q?Gr34vj29uXmIr4OMqlGWK0uAuh/1WqClImVk0B3pUqWdfjK/hF2YtMcl/qLZ?= =?us-ascii?Q?i7yQ7Y5EyveRQw16hrdCQsh4NheVG80tmPbX360WMVQYD7MdBmVoVRFIkbEi?= =?us-ascii?Q?UN0ONyoTt7pRGUtZxRzhxGF05Itz1dV5tg1SHq9ZH6WvY0k0sVjqQuq283Uj?= =?us-ascii?Q?Vy57sQFfLhOPDFBnR0BgfGFPHOLdFnzO0Bo7RU44ATkMataznpwFMprRencx?= =?us-ascii?Q?gvICT2lZmdFu6tb1aD9zRjsv?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6509 Original-Authentication-Results: semihalf.com; dkim=none (message not signed) header.d=none;semihalf.com; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: dc82d92c-3960-4789-1599-08d962804c93 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 45QKWaO56plGaONlHe/sbAhEzf+Vh62DMMK2TVe8eox3gP3aJxGt1DqNUrnfovqhQorcFP8+kfpTbzBgY7WX6qIYwVKiGwIIBvfol+C4tNKOloEfslpVj7zJi3mMX1l8O6sbZ5+u2WBw1bGLJ7nor4qP56nY2lLvltqpQe4HTJNZClr1bSCSoTzAVLK+Pxs2j/9W6YMkmDUnhGwZutT3/B5VQd6wpMZAg2PLCegF3ZnaDSD8vjVoBp4qgedSzbn8UdrIcpZOwkJDOUC9dQKeG6Ab70zSxXCM9eQSMbFqf68m3ee14W9inD+1TjoJHn7Kvw7FnC8Hhzt49XxoUvFfVYIDtC8+M7/nckCWWOY+VoiMfC96W8HPX3j1YxYPMBAHqEzEW0mswc0Xd0108UEbJqhRPB5pOzWP0WAUcvRd4RN78r/YzNQfY5SkxLumpV5dvzjTGVR91iGVwMqFoTx6xBL1MSPVVLnShqui6JN5fq1GwV+03REbxrdXqiFRp5W081k+qqRriDlg9d5x8T5rBjPkNNNVHGjTrikVfW0iYk7efuC5Qoo7fhfE3jpBN01vcVOwpLGmlAVMi+yIIHbeu2FmXrefTzMp0FI6oDdZ/e3wjPJqz75GURI9uZmIl/jN49rWxc1sq0pwU+ql0T8JL0bp7Y3tmVBOV1Je8fvV8cKX34MFBsZsXk9bjE4rLF1PIWoXZJfnpf3eiXXjUEG0fg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(346002)(396003)(376002)(39860400002)(136003)(46966006)(36840700001)(54906003)(47076005)(478600001)(5660300002)(81166007)(52536014)(26005)(8676002)(8936002)(53546011)(83380400001)(33656002)(6506007)(36860700001)(110136005)(316002)(2906002)(9686003)(82740400003)(86362001)(356005)(186003)(70206006)(55016002)(336012)(82310400003)(70586007)(4326008)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2021 19:42:39.6982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06d937e6-6086-4415-0309-08d962805694 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2558 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the patch! Reviewed-By: Samer El-Haj-Mahmoud > -----Original Message----- > From: Grzegorz Bernacki > Sent: Wednesday, August 18, 2021 3:38 AM > To: devel@edk2.groups.io > Cc: leif@nuviainc.com; ardb+tianocore@kernel.org; Samer El-Haj-Mahmoud > ; Sunny Wang > ; mw@semihalf.com; upstream@semihalf.com; > pete@akeo.ie; Grzegorz Bernacki > Subject: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot > Discovery Policy change. > > This patch adds checks if Boot Discovery Policy has been > changed. Only in that case EfiBootManagerRefreshAllBootOption() > should be called. > > Signed-off-by: Grzegorz Bernacki > --- > Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 24 > +++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > index c8305ce4f5..378ba0ebf4 100644 > --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > @@ -617,6 +617,7 @@ BootDiscoveryPolicyHandler ( > { > EFI_STATUS Status; > UINT32 DiscoveryPolicy; > + UINT32 DiscoveryPolicyOld; > UINTN Size; > EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy; > EFI_GUID *Class; > @@ -678,7 +679,28 @@ BootDiscoveryPolicyHandler ( > return Status; > } > > - EfiBootManagerRefreshAllBootOption(); > + // > + // Refresh Boot Options if Boot Discovery Policy has been changed > + // > + Size =3D sizeof (DiscoveryPolicyOld); > + Status =3D gRT->GetVariable ( > + BOOT_DISCOVERY_POLICY_OLD_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + NULL, > + &Size, > + &DiscoveryPolicyOld > + ); > + if ((Status =3D=3D EFI_NOT_FOUND) || (DiscoveryPolicyOld !=3D Discover= yPolicy)) > { > + EfiBootManagerRefreshAllBootOption(); > + > + Status =3D gRT->SetVariable ( > + BOOT_DISCOVERY_POLICY_OLD_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + EFI_VARIABLE_NON_VOLATILE | > EFI_VARIABLE_BOOTSERVICE_ACCESS, > + sizeof (DiscoveryPolicyOld), > + &DiscoveryPolicy > + ); > + } > > return EFI_SUCCESS; > } > -- > 2.25.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.