From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.86]) by mx.groups.io with SMTP id smtpd.web08.2688.1663061770230252806 for ; Tue, 13 Sep 2022 02:36:11 -0700 Authentication-Results: mx.groups.io; dkim=fail, err=mail: missing word in phrase: charset not supported: "iso-2022-jp"; spf=pass (domain: ami.com, ip: 40.107.92.86, mailfrom: jameswang@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDBc43P7LvLEswWPQKuXfZ7ISFfQoTNgG+6185qxP1DEyfhVUNNBndIyhBgxjWkPaAlEmewpOlyQP5x/28z+YUTNfeikyQi1c6HQcHRohGD42gx8z0eyRWvu9xbcilIrP2eBQZGlsRr2ZhjusVFrIEsX3t/ZM+iWF4OgJEvH0F6aI+obIVvccHx/43S2JGMpjDVriNc5mro8dZU5HmDcrbKixxOVO5bn9mmFoudFgkubn5z4oSQIBMY2K0TlRRcDij8fiMrkLUVCk+udr//jLcC2tUiK7SPuBIXLUHLOso/1ikESIyPPMUx19RAY9A7HU39hPRLyzDEwdoYVDnvyzQ== 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=Q+JlZukxntGgfvG2+J2uUvo08C+zLT1x1eCzvcEWPuE=; b=JDmEAHHjUH2ttx9DoUZRMIVoasFHAHttgh/DmuSlyXflU9cOIYZ+MxWB1xsNO06gay3UYmpCcto+4fGme4fhliP6BjlAtsfiA07fe0F/Pfm5StuRDWWolNoxomb6xvxFJHpwecBRRGEALqtNh4PbCxYZkZ9b3GXwXlO08aDB9khXU9xvTKihv3ZXjREsiP70jfeUeV3YtEWqZtAdPiat5ANb+IWVWpL2HE1C7d+GbByBJmF6mKk9WmNdL1RJoVqAhhZshH8yp3eD0A3VshibwO9YGg0bmbaVQvYpiyWY4Z8n7JSR+IHqzUB8uR3eyOPed6Ta82mlgqBTr560s7TikQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q+JlZukxntGgfvG2+J2uUvo08C+zLT1x1eCzvcEWPuE=; b=a5g1b4Czuq2O5GxV55ZB7FeamuMMNjzktaPJ6tF5Fjxm8jsw4Hk8GovzXsjLwwjTE1CwyP/odFGoVxe7fY1rh8+TgxEKr627yVL5j6kLAT1RnDl+lu84tXTkBm5KBZIDYRrW6VYyhmN56oRL0QgT1k227VUBmaKtHFPLJm9jnF8= Received: from PH0PR10MB5756.namprd10.prod.outlook.com (2603:10b6:510:146::19) by BLAPR10MB5313.namprd10.prod.outlook.com (2603:10b6:208:331::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 13 Sep 2022 09:36:08 +0000 Received: from PH0PR10MB5756.namprd10.prod.outlook.com ([fe80::b859:eada:b670:6de5]) by PH0PR10MB5756.namprd10.prod.outlook.com ([fe80::b859:eada:b670:6de5%5]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 09:36:08 +0000 From: =?iso-2022-jp?B?SmFtZXNXYW5nIFsbJEIyJjJITEAbKEJd?= To: "devel@edk2.groups.io" CC: Eric Dong , Isaac Oram , Liming Gao Subject: [PATCH v2 1/1] BoardModulePkg/BoardBdsHookLib: Fix F7 overwrites Boot0000 Thread-Topic: [PATCH v2 1/1] BoardModulePkg/BoardBdsHookLib: Fix F7 overwrites Boot0000 Thread-Index: AQHYx1RAHieo4gTSRUykmZOZ+v41CQ== Date: Tue, 13 Sep 2022 09:36:07 +0000 Message-ID: <20220913093457.14644-2-jameswang@ami.com> References: <20220913093457.14644-1-jameswang@ami.com> In-Reply-To: <20220913093457.14644-1-jameswang@ami.com> Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ami.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR10MB5756:EE_|BLAPR10MB5313:EE_ x-ms-office365-filtering-correlation-id: 9d6ce312-c98b-4ef3-656c-08da956b630e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xarcr/WYHKI0lFE3x7PWKUEwPHouR3NRECuyjZMT/zG3XCWzDmvHj0ameIpbE+qjSHeK62RqwcYPqzEuNPvcpIegar3AH8qR+tSRY7/mos2pXxseed0sUk1tASlvVYqVMW7P2JlCoLVLnh3NgvBRCv1KNeYYY9jws83MisQCfNSTINQnWwpZfKtt8Kc3w/8G+lZt+hUf4JacGZhRj2BS8l6Hh85sWHZwwlBe17XECKQlpZqh8OovIJR54reEI3rYdh+pPKtUlmR43x5JnSvgLgiXGu8ipLhvBzN4d3KCv6BfIXwKUXrK2YVsxVwfm03kRWeBZ+T4k6O9pe46MFcNeymZ5s15xc6yV3HFGZpwOKPiq6f4lpYaY5AEBnZ5IcP2Cg9EClxBqaqgxGzarr/Z/x5ko0NyDHDlfZFrNdntk08mP/mKcij88y/FpIQseSW8q5i+j9zaXdtkvw/3uSrdd9d1adtMC6M872HnU3XVPMBZofIXns9wZd/aafIAmgkRJLzP7Wmqdj5d6l5tK+kRvM2+NYHnIZzai5HtORLEigWdlnUrjNOYKkvTEXUbzwu89M8U/C16qXTmKeB/MhgwTFcjh57PW73pxl1lumI4Z2Jix/tHRyExYP1El3V2DdQQSpeaGHVs2sH5ui0QPvqU6JRLON+gl/WwcjzRsvQWzJUZNJ8JpDdq/Rpe/Ib/tBGPugkP2TKW11r8ZghGPWHoXmbxJENw5YiQh+fv1EjX+jZA6aU4WLJ9t/cs1DndVG61YAnGDunOK6z1+Wqvazf3qg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5756.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39850400004)(346002)(366004)(136003)(376002)(396003)(451199015)(38070700005)(8936002)(186003)(86362001)(6916009)(26005)(41300700001)(6486002)(36756003)(6506007)(5660300002)(478600001)(38100700002)(316002)(66446008)(40140700001)(19627235002)(8676002)(66946007)(54906003)(4326008)(66556008)(66476007)(91956017)(2906002)(85182001)(64756008)(76116006)(122000001)(6512007)(1076003)(83380400001)(71200400001)(2616005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?aDZXMkY0QVZZZjRDWHVibGhyQkVXT0hwSkJrWFJPK0FzNGM2Y1J1akFv?= =?iso-2022-jp?B?dnlyejVKZktrMVZMZC9sRDVnZFdOWmV5WUhUWUhhTEtyMm1jU1AvN2I3?= =?iso-2022-jp?B?OXl2UVdjZ3dOUnhlall2SGY2ZHhEUUp2a2hMaXFYRUFjaW9LTC91ZkIr?= =?iso-2022-jp?B?MVp3S3ljNUo4czJFSk9xSnZhaXhaMUJKdC9SeCtXeVNLaU5WZ3Uyd05U?= =?iso-2022-jp?B?YkRaSG41OUg3SitGL3l0bU5obThDb3FVdTlWOUJlOXlPOFg1OVBkRFc0?= =?iso-2022-jp?B?cHB3QTZicmoyK0tKbGh6K010cllobzc0OGNMWm5pcUNGL1puVDRCb1lw?= =?iso-2022-jp?B?eUhIcFR5Zm1XakpVa0FrakRmckdDZmM3SFdTTFRLMHJsZ2w0dG1rNkVY?= =?iso-2022-jp?B?elJYa2VSY3NqTzFMbGZZNFhOd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= =?iso-2022-jp?B?ZmxTclF3U3lQc3BxRlNGck1xVVFzdUUycWw0cGV2TytYTGRkOXRNQkNV?= =?iso-2022-jp?B?dlNwUg==?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5756.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d6ce312-c98b-4ef3-656c-08da956b630e X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2022 09:36:07.9149 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZlcOt6QpjK743RsvN7W4rsWPtkOiksztRbjWMy8t4D5ipZly5V1bJtNH0hOWZmgEa580mWGKRPvr1U2KlvV6Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5313 Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Check if mBootMenuOptionNumber is valid or not before calling RegisterBootOptionHotkey to avoid overwriting Boot0000 Cc: Eric Dong Cc: Isaac Oram Cc: Liming Gao Signed-off-by: James Wang --- Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c | = 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBoo= tOption.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBoot= Option.c index 6e3c21f4f052..34c971f3780b 100644 --- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption= .c +++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption= .c @@ -461,12 +461,17 @@ RegisterStaticHotkey ( RegisterBootOptionHotkey ((UINT16) mSetupOptionNumber, &F2.Key, TRUE); } - F7.Key.ScanCode =3D SCAN_F7; - F7.Key.UnicodeChar =3D CHAR_NULL; - F7.KeyState.KeyShiftState =3D EFI_SHIFT_STATE_VALID; - F7.KeyState.KeyToggleState =3D 0; - mBootMenuBoot =3D !EnterSetup; - RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7.Key, mBoot= MenuBoot); + // + // Register F7 only when the mBootMenuOptionNumber is valid + // + if (mBootMenuOptionNumber !=3D LoadOptionNumberUnassigned) { + F7.Key.ScanCode =3D SCAN_F7; + F7.Key.UnicodeChar =3D CHAR_NULL; + F7.KeyState.KeyShiftState =3D EFI_SHIFT_STATE_VALID; + F7.KeyState.KeyToggleState =3D 0; + mBootMenuBoot =3D !EnterSetup; + RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7.Key, mBo= otMenuBoot); + } } -- 2.13.2.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= .