From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: suse.com, ip: 15.124.64.68, mailfrom: glin@suse.com) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) by groups.io with SMTP; Tue, 30 Jul 2019 01:19:03 -0700 Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Tue, 30 Jul 2019 08:18:59 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 30 Jul 2019 08:16:15 +0000 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (15.124.72.14) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 30 Jul 2019 08:16:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTs+slakhgaA4y8WCSgdUDI6Oirj4ZJyXj7LXN47wp7NHXKtRc0t3XiUBMDsjdEsu/r2yYDylo2H1X3sWrpDYHgT3Yigo0E3JWpWHYq93xupJ9GnZt2nKJkE1DIDlWBFG3cikfcWvu+aukFVaC2TT+/0GwdvtIERtlUNO9ZiJjmPYqpeWx3wv9HT0buwk6m4l3NM2crvVJGO9xP6vrltmqKr3Fmw+G4Vp9+tCdyH7rniucabMojEBgSrF2OL+rPWGZPW8+DGahVetCstxVtVHnGU+Rgucz/lNZPn9PnO1z+8g9eWYD14yxeNROoFT/2npbtMueRMS31cXhmOjnzvag== 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=/dO38PpVZXLGcmXz5y08XxAU4v0LMb35PyDyqCNPHw8=; b=HnAzhkm74z9DCnEwJDmj+Cba+1zjjPRQpVE54dPq1AMnMoUI0XQKmrl/h6sSSCMiUPMTO2tekJ2SU7olqOa3luVRolnYi+Vbd61fpOAkbEQlHp7eUn0ncmgLaDL/EA5G7lyNqibCbqPnXfZjYVdU0BGuMzhzmEXMSotMTfGud/NRZix78IQDG5F0xKhTnWltcxnoiv528dkNazs+NGcxMhNA8Ke2DoEGrN2EtmaWTTB1c3rkkTTYhyKCcjyl3dRHuRp8AB/d/lTF+rx9SucQnxhy8i8p+MH2fThr/fhNY8CdM/3ad9J9tMJs6cQd3Dn3zFIiThwmp6aMkgQ5OdcgJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none Received: from DM6PR18MB2489.namprd18.prod.outlook.com (20.179.105.16) by DM6PR18MB3068.namprd18.prod.outlook.com (20.179.48.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.14; Tue, 30 Jul 2019 08:16:14 +0000 Received: from DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::ac83:47c9:cebd:9f0]) by DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::ac83:47c9:cebd:9f0%7]) with mapi id 15.20.2115.005; Tue, 30 Jul 2019 08:16:14 +0000 From: "Gary Lin" To: "devel@edk2.groups.io" CC: Zailiang Sun , Yi Qian , Michael D Kinney Subject: [edk2-platforms] [PATCH v2 3/6] Vlv2TbltDevicePkg: Only sort boot options when necessary Thread-Topic: [edk2-platforms] [PATCH v2 3/6] Vlv2TbltDevicePkg: Only sort boot options when necessary Thread-Index: AQHVRq8Ozud1h4iku02k8XAwPqnAsw== Date: Tue, 30 Jul 2019 08:16:14 +0000 Message-ID: <20190730081518.16349-4-glin@suse.com> References: <20190730081518.16349-1-glin@suse.com> In-Reply-To: <20190730081518.16349-1-glin@suse.com> Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6PR1001CA0031.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::17) To DM6PR18MB2489.namprd18.prod.outlook.com (2603:10b6:5:184::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=GLin@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.22.0 x-originating-ip: [202.47.205.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 972cdf24-ba51-4206-16ff-08d714c63060 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:DM6PR18MB3068; x-ms-traffictypediagnostic: DM6PR18MB3068: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0114FF88F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(189003)(199004)(5660300002)(6436002)(76176011)(52116002)(25786009)(2351001)(3846002)(14444005)(53936002)(71200400001)(26005)(6916009)(486006)(476003)(71190400001)(446003)(11346002)(4326008)(6486002)(68736007)(8676002)(5640700003)(186003)(2616005)(2501003)(316002)(86362001)(66446008)(66066001)(478600001)(50226002)(81156014)(14454004)(1730700003)(256004)(6116002)(64756008)(36756003)(66556008)(81166006)(54906003)(102836004)(6512007)(66946007)(2906002)(80792005)(7736002)(99286004)(6506007)(386003)(305945005)(1076003)(8936002)(66476007);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR18MB3068;H:DM6PR18MB2489.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Vn+sQ5VNWOY41VAlSBoG0O32FDZyzGdxqMUczWmvOSI7eKesQCkaNcQdU6n2oj3UPaC+ENyaKjIHje8xqEiFVeR7nDtTdJp392nViKTFP2JoPpWVCc5qt4+LbjJr5f+kRg99zNtMZNK4xxzsi8otUJEPi18mgLveNfa9gP7Abewnqa+Tv5RU3aohx8JKuhCi8AKn6HcnjWF46jVv1t74vePAGnpH8nCRluPLVqzW/LtGlPTC98FvVjwxD5ZMhlpD18EftpQRmTohv2GcpHlEwnaQxvmhhy1WNOZY9lLOIH6cD7J8A5nVuTSDHCyUZU/LToNxmtKZXJk2e9SjT24lei6SqDrz5O1XFYHxWjCrBbBRapwzR0v08OI06Sd4Ik7tkcQYFNFjFGez+diqrk/VJElBZXisdxJMwYvOhh9+prA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 972cdf24-ba51-4206-16ff-08d714c63060 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2019 08:16:14.7476 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GLin@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3068 Return-Path: GLin@suse.com X-OriginatorOrg: suse.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable * PlatformBootManagerAfterConsole() always sorted the boot options at the end, and this would invalidate the BootOrder created by the user. Besides, the current implementation would sort the boot options twice, and this is not efficient. We should just sort the boot options once at the end of the function only for the very first boot. * Update the string in IsNeedSortBootOption() to match the description of BootManagerMenuApp. Cc: Zailiang Sun Cc: Yi Qian Cc: Michael D Kinney Signed-off-by: Gary Lin --- Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/BdsPlat= form.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManage= rLib/BdsPlatform.c b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBo= otManagerLib/BdsPlatform.c index 7fbbf281c6..a5423013a5 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/Bd= sPlatform.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/Bd= sPlatform.c @@ -1299,7 +1299,7 @@ IsNeedSortBootOption ( // if ((BootOptionCount > 1) && (((StrnCmp (BootOptions->Description, L"Enter Setup", StrLen (L"Ente= r Setup"))) =3D=3D 0) || - ((StrnCmp (BootOptions->Description, L"BootManagerMenuApp", StrLen = (L"BootManagerMenuApp"))) =3D=3D 0))) { + ((StrnCmp (BootOptions->Description, L"Boot Device List", StrLen (L= "Boot Device List"))) =3D=3D 0))) { return TRUE; } =20 @@ -1374,9 +1374,6 @@ PlatformBootManagerAfterConsole ( // EfiBootManagerRefreshAllBootOption (); =20 - if (IsNeedSortBootOption()) { - EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBoo= tOption); - } // // PXE boot option may appear after boot option enumeration // @@ -1400,7 +1397,9 @@ PlatformBootManagerAfterConsole ( Print (L"Press F7 for BootMenu!\n"); =20 EfiBootManagerRefreshAllBootOption (); - EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOpt= ion); + if (IsNeedSortBootOption()) { + EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootO= ption); + } } =20 /** --=20 2.22.0