From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.7636.1652796115598802868 for ; Tue, 17 May 2022 07:01:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=eu0pYoQd; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652796115; x=1684332115; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TV7NNwnKhAhAmlX3ZnmnnM++T0IDwPGaKZIzTxHAT7Q=; b=eu0pYoQdN6j6w0saiMdz3btOD7ZGDGiX5y+PY06QYUYiiNYUqIGA6U4I epZ4PkUz7vt4L/TEjUSF0XNA1IngmquvXoGIAw/UWfcXr1M48C4jqSwvb y/GiWIEAk36x59dhZTz0jgIZUn5HNpF4dd3dpe0QNZYSIdCTyEa749YWG H97wms8tldBFI4XMu2mGySvRuZZDLjcM8upAIYqhgWpp+OyRCJSTtbZSO WnJXMltqE76aWBavl+hsWxBVhe8I7nkbaH7wAXKRZ052GZCFtp737G3R/ QFaCDYjyQ0tbTKl7e4QHHK7T9oc52Eh75y28Fka42fBLGhqU2s+SAGN44 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="334235803" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="334235803" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 07:01:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="568906837" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 17 May 2022 07:01:28 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 17 May 2022 07:01:28 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 17 May 2022 07:01:28 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 17 May 2022 07:01:28 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 17 May 2022 07:01:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CIVqGKnKqueS6fjl8E0pHEydRHDz/3wF9+dUib6O8qfAB2ow54Mfiz2t/Cq6HwfXLUNrTKvO1YabACKJx+i4MaP62cpjAAEITR/EyUCvN7f4DbieDufsTn62Z1agO8fUAnW7SIhMzlXHCEJiPZaxmrm+t06tmuO8KM8tHctdnM+8MxvlxJJcuhqKFBFXHo7spqzvlGcn32Vg2/Lq6fF4KuCagMv7oHMSxb1e1UVeVkuZt8YdePWg1tlH5gkw87sIQSvFto6otRabxMYsUKLxJ14+h+WaKJyyunJYPRkXaC/kKUdG4yu0dGJT7WkoIyCIZp8OEHipukwShZZ1oSz6Bg== 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=ZfAHMtMJ9dt0+fvQiHe33YY71Fo74txdcaQKA+Yvmxw=; b=Z9TKkqIsZK8LbPZ+6Zj9rj+PL90zCHjyRW+pRGaRODzTncwxzHlb/ovYvrtzB/YlCiZGHi8aL1L4QeTNEj8vd0hh37djOo5IHj4HiyHheNmNEZSvKo9/JKrPZY/mGYRF90oxwHufmojoUrEO+56qXkvz4Rm4ipOp1HE0GyALnDG5R/VE9wpP9b65kJrd/4fvXexefblPLPExdBAR4SCfxSXhn0CTH3AAQ/9us5FojyHVbH4D6faQBak2G9LClMrpBE52UDOqndAYZxTRdoZp7yjRKvEaYTxxyNdewwZR9MYwWUwIxeD/C9pBGYSIjTWy3FoNREqyBA/xp2xOKUaF4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by BN6PR1101MB2308.namprd11.prod.outlook.com (2603:10b6:405:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.16; Tue, 17 May 2022 14:01:25 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::2d8b:3e7f:83d7:1e56]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::2d8b:3e7f:83d7:1e56%8]) with mapi id 15.20.5250.018; Tue, 17 May 2022 14:01:25 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: Matt DeVillier , "Wang, Jian J" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Thread-Topic: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Thread-Index: AQHYPQsPah/atvn590CnWrhGW4ClXa0jcuSQ Date: Tue, 17 May 2022 14:01:25 +0000 Message-ID: References: <86c451b6b340264ab6b78cb7f98d18b58e9c8bee.1647857029.git.sean@starlabs.systems> In-Reply-To: <86c451b6b340264ab6b78cb7f98d18b58e9c8bee.1647857029.git.sean@starlabs.systems> Accept-Language: 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=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 544d46e8-e9b3-4251-4060-08da380dbb1a x-ms-traffictypediagnostic: BN6PR1101MB2308:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OrFKVzyofkHgjf8FQxrW4MgKwGAEJh3RjagFYd3CUWuZD5cJi4jIlbNpEqQZqrGiVKUR+qAdGlo+Vt936TUx5dd20pJYOyM5PFQxlqz6WEVFq69j1lPsq08ghR5wNlvy1B5dKDR0Hl+Vp/s9bajxSomEX/hs+mD+HZU598l34FGZiTQBefePtfrRQ2XDBhl0BAVOf0uYNorJywnGr11T+FuSQR/2c9EuTRycnRKvNvWhT/v83Vn4Hx7EttasPQeaGDJkYnWqublW0BIhh3ZxuCdSeYEQXzCF6EdZI5ahaEjYLbkGY8auAedPJQmEzWNGDZrGjD8DTNiUN+7zbccaf6fbTTkR8HHDsraAEu4oibQtygtMxrfaORKbFp1ph4WvDp1o2rd8m8zgmK7IITfRlIi2h2ucCoCDb51NSL2bFGS0DNydz8DG6s6Kl03Gbx6m5Fgkq5F6f6xHUs4nMZkOHIRRucaiIuveOl46BJHah+K68s+mkT9kigRIQlrPPaa1EHSKB2cjrwRmkM/CVnvpdqefUkhlN6V5QT9Rs/CZemLT0SOsB/J3qWENCpba1E0EjvW9bWBFK0DR0ZWH/5k/yj2As6+WEbseekjFtG5LEeGaSTdaglBwSr3bhpZklXO1koQliTr/tI31NXjbgY4o3jfr/rY3YJXVkBjtDCfypBY0HURdEgh8Gwn8fC8UQQHTcBMqc3vLX1RnklU8VzRGSA9qonUwskALBnx/T6/oqYJSIdPWasQ9Xw/43XsOIDJZnHSskL65Fm9ifIRNlETJ8FXRieBGqImwZfItS/umBOUqhfKOtjJWWR9KvrY9BfBEyeOYlXWwGI7UbHwzWYkS7Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(316002)(82960400001)(122000001)(86362001)(54906003)(110136005)(7696005)(53546011)(6506007)(33656002)(55016003)(508600001)(38070700005)(38100700002)(64756008)(5660300002)(8676002)(52536014)(4326008)(76116006)(66556008)(66446008)(66476007)(83380400001)(66946007)(966005)(186003)(26005)(71200400001)(8936002)(2906002)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rDgujPZ+Qp/+LFqEiZmAKkcOI7m+2rpWxO/TSIhyht3hKBnltbGn3Y0hmET4?= =?us-ascii?Q?T3RcNTmTvYlLrYeSWQhNSfqTUKEaeM28HNaU1wnAC3Nr5iIfETdJ3Zvl4TVx?= =?us-ascii?Q?nfVXLRWq7rU9k7KwBj8YJwjgkWc4coKXq7UpHY44WwnpsQt+ENhRny9eeXak?= =?us-ascii?Q?XGk3yqAXNn7GcVGbFo7MaLPBLrMMwZvKU+a3r/J3lEexq8P3M87g9p14sOHH?= =?us-ascii?Q?rikqxgqA9gnVrpfq6Z9lcy6ZxWddn0omtJMSUDNhkJWqDDJ1sMnhXce8jm5X?= =?us-ascii?Q?Srvf5ENyNX6OPbjfDy5VwmRxE+xxH1UeYMX1yx9f2fmCPVlKmo4ItAx0c7UA?= =?us-ascii?Q?1gAgM/sBa21Xv4K3nrPutp7bckhMb20StA+d4nIIHBOODRW2OcgGLWh7sF2K?= =?us-ascii?Q?PCUBK8oWFHmKhdPk181Ib3MaUP+/2ApizEdtBdwATVtgBkfSKUJTbcaiUmtw?= =?us-ascii?Q?ecU4osNeyC9sYPS8f1KwgN/7CGUQjGY7RxPHmvQOLdrsqCnsi6dULPcWSy94?= =?us-ascii?Q?jKdRohJkj8PMUsGqrh/VqM5pzqpW/T5FssYRLadCwEw0RsYl86vTd/jdc6DO?= =?us-ascii?Q?xmqxc+QIag6/huDB2H91xrJVGH9utLBj88n65GUUctWKWF5f+bi0jziIAtDX?= =?us-ascii?Q?dCeHqI9IiZrWc5guAUrl2tiveAnycLwll3VVaeL+hUXfpxKG+5x06ACiGqbi?= =?us-ascii?Q?af1zEy6OZM/volVgWDwBr+6/ZOS9nIiViNViKpejMKIGT830PUeqSvKjV7ke?= =?us-ascii?Q?d9k/XVZ0Ek8aWiE2QmOBxeXZthvUXXobQUPnP/MQhW/F03MrOi9SS/nBc+DP?= =?us-ascii?Q?eemxEIsxLaAUl6xTtwTrUSgfKafyOBbldyWr122TNJPXrTT6sLAh+hccv9Wo?= =?us-ascii?Q?Tejpp1Pf1+gslJ9Db0jyA/joLzNcwhzoS0eVSUDARlgWnmW+vXEs21scsI5H?= =?us-ascii?Q?NidZqdnQcp9Bi+hMsnMFOZaRo6SUlrkrs8prfK/hSVk8E8nl83gTZwdK/K2+?= =?us-ascii?Q?oXZVflrf79Q1+hcE7LtBwugAp2wak7xFxmzBabO9AfoMA04wt8x8ccDvLXg9?= =?us-ascii?Q?dwNSQbG92tKLQBvj+aH7mHjqFFyoG8WVBCWN7J+o3wKhBpgbVywJNceIJLHu?= =?us-ascii?Q?MDXfHwwIr+zEkYYBKjLUwH59FdKnrhXnte/YVBNwWak9nAS3/loYer4EzVVd?= =?us-ascii?Q?NcJax8KCusSXEUjIE/+9j5v3MmpMYRVp+/kGUNZg+xqRe2kQQCIyWWNpBgLK?= =?us-ascii?Q?hm0dajvwc/GEnZHfjpgrLrAjhC6nd5N3dEGNK01yHGMnC/LwzvybBWTpS3v8?= =?us-ascii?Q?M0u8eYbguRku/k3tOeFVpq79OZnm9CWe889759xluKCCTdJoqzwQ6vTCFNpF?= =?us-ascii?Q?AWAcF1YJM30V09+YzyU3SOAnT7d5wQcdv0ZeK+awcDYeSVNX1xAFSh2EWkz6?= =?us-ascii?Q?DXOJ6Se9iBLQYoX3K7INkHWIzVZTNoLCnav+QcRZ6bdJaFg2gISUMxGX8Udo?= =?us-ascii?Q?fZdE2yZ2NY9NKoLufkMntIl5aWhvRQp+uO1Xmib6hYhW8wxjVSKY6EYy0ZBS?= =?us-ascii?Q?3A53oUm1ie2fzX//Wnf5X9EI5UDR8zt7Ic5iEvByQEZNf5wd7fzAe/VmrN4D?= =?us-ascii?Q?5oHymUI1QWZP8iSkeVAWhP3/9N02J/HDKg0AtbSu2DBoxFqWfhr+X1jDvUap?= =?us-ascii?Q?zciEF6wnK1r1A/TDeAYwZLm0tLenLQIzzYUYiP3l0chRrfsfy7a7Ls+tTCz0?= =?us-ascii?Q?/OPATM5o5g=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 544d46e8-e9b3-4251-4060-08da380dbb1a X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2022 14:01:25.0511 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: T6XC1nHgptr/KH6pFrlJMti/df05d3whd4l72IGoDnNxm0/ExHEE0P7YVNXcYaq51ZnHzM9PEtW9X0EvQDbS+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2308 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sean, Can you use EfiBootManagerSortLoadOptionVariable() to sort the boot options= from PlatformBootManagerLib? > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sean Rhode= s > Sent: Monday, March 21, 2022 6:04 PM > To: devel@edk2.groups.io > Cc: Matt DeVillier ; Wang, Jian J ; Gao, Liming > ; Rhodes, Sean > Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pc= d to prioritize internal devices >=20 > From: Matt DeVillier >=20 > Add Pcd to allow configuring internal devices to be prioritized over > internally-attached USB devices, such as card readers, over SATA, NVMe > and eMMC drives. >=20 > Cc: Jian J Wang > Cc: Liming Gao > Signed-off-by: Matt DeVillier > Signed-off-by: Sean Rhodes > --- > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++-- > .../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 + > MdeModulePkg/MdeModulePkg.dec | 4 ++++ > MdeModulePkg/MdeModulePkg.uni | 4 ++++ > 4 files changed, 17 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModule= Pkg/Library/UefiBootManagerLib/BmBoot.c > index 962892d38f..28c3cff471 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -2214,8 +2214,14 @@ BmEnumerateBootOptions ( > // >=20 > // Skip the fixed block io then the removable block io >=20 > // >=20 > - if (BlkIo->Media->RemovableMedia =3D=3D ((Removable =3D=3D 0) ? FA= LSE : TRUE)) { >=20 > - continue; >=20 > + if (FixedPcdGetBool (PcdPrioritizeInternal)) { >=20 > + if (BlkIo->Media->RemovableMedia =3D=3D (Removable =3D=3D 0)) { >=20 > + continue; >=20 > + } >=20 > + } else { >=20 > + if (BlkIo->Media->RemovableMedia =3D=3D ((Removable =3D=3D 0) ? = FALSE : TRUE)) { >=20 > + continue; >=20 > + } >=20 > } >=20 >=20 >=20 > Description =3D BmGetBootDescription (Handles[Index]); >=20 > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.i= nf > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > index fe05d5f1cc..207420e334 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > @@ -119,3 +119,4 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile = ## CONSUMES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm = ## SOMETIMES_CONSUMES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount = ## CONSUMES >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal >=20 > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.de= c > index 40601c9583..8b8b1f7033 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -1563,6 +1563,10 @@ > # @Prompt SD/MMC Host Controller Operations Timeout (us). >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UIN= T32|0x00000031 >=20 >=20 >=20 > + ## Inditicates if internal devices will be prioritized over external d= evices. >=20 > + # @prompt Prioritize internal devices. >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x0= 0000032 >=20 > + >=20 > [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] >=20 > ## This PCD defines the Console output row. The default value is 25 ac= cording to UEFI spec. >=20 > # This PCD could be set to 0 then console output would be at max colu= mn and max row. >=20 > diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.un= i > index b070f15ff2..7b8606f091 100644 > --- a/MdeModulePkg/MdeModulePkg.uni > +++ b/MdeModulePkg/MdeModulePkg.uni > @@ -1177,6 +1177,10 @@ >=20 >=20 > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_H= ELP #language en-US "Indicates the > default timeout value for SD/MMC Host Controller operations in microsecon= ds." >=20 >=20 >=20 > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_PROMPT = #language en-US "Enable booting from > internal devices before external devices." >=20 > + >=20 > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_HELP = #language en-US "Indicates the if internal > devices will be prioritized in boot order." >=20 > + >=20 > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMP= T #language en-US "Capsule On Disk > relocation device path." >=20 >=20 >=20 > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP = #language en-US "Full device path of > platform specific device to store Capsule On Disk temp relocation file." >=20 > -- > 2.32.0 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#87789): https://edk2.groups.io/g/devel/message/87789 > Mute This Topic: https://groups.io/mt/89924426/1712937 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20