From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.4859.1593756136614437684 for ; Thu, 02 Jul 2020 23:02:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=rpwZiz58; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: liming.gao@intel.com) IronPort-SDR: 8ydQgNM56P4fsDKs6oyp1ErbXaFlnN5kgNfgzxdyyZof1fvd4RZmm4viwY/2ufiycDmEkTnicS Y1N0xIGyj2nQ== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="231962277" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="231962277" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 23:02:16 -0700 IronPort-SDR: THki/n0Ly02vg4vFxalmucDKg3L7m8ueOPes/WDKayzmo5bEY7WN6aADGkfLZ3fvuq1am+j5ND +ioWjFb5RIAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="304483946" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 23:02:15 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jul 2020 23:02:15 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 2 Jul 2020 23:02:15 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 2 Jul 2020 23:02:14 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jul 2020 23:02:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JtvebdGW5a0x30uC1wGuZ8jcQQFe3hMBSXDAJqCNGp5emsnqwYAiUTvxV1k+RrViKQswoeVjIuHkvO+UaBbxNxiH+FJRfuw0n1AaqgNBp7AreidZ0BBt0EVrbOAXk6e7l4oQ48PDoRf+9di8SCH0d6dQVcsZ6xrdbs/13T6lt3UM9agtrqLyMSovQDvrhRDKonnMzpWEwNkF5kpqtXmZ+UwLWRj0CatHGgsb3DsJw/jCv2fHrHnhcGT4vorGU0bIutea8LJhO3UQU+AFMc21PuQqxeSoUF9xUJ1jC3rAn5mowfyaXZow6ivkX0b/sqokFj1VcNaeBcfN0h/pDrREfA== 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=zHXuM4PZsSKu7In71EJIVGE8YiEK6vpLwEivui1lqiE=; b=HQA+UcXLvt3FpUQzu44jEjOeVv2qEkSrciZfyRvAo5M4F8JL8io5M7kV6Ief/K4tPENICYLdxiFLEc0Uc/AV34+io+++uk8HIz1Osa6TlsBcMcEtaRhm8m6aNZuw4b42quBNMHGeAnqsos2T4Fh92X1vy/xLXGVEUpIHJTfZ5iRFO4UMck5P5RKSpq3wZ/Aov6CCBTrDl+MiwTs37iMsA2IqTwONBxyGlLBK5ZXsnsFnzNpGZprYUTVmwnU6W6F8C99FBAIpGxHclaCtSlyeelWWs4L4vJi2+2sKn4pX9y2R+Qmm3VNnguvpayRV7+XYC08aIcaEUFhBlSGdG2Kz5Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zHXuM4PZsSKu7In71EJIVGE8YiEK6vpLwEivui1lqiE=; b=rpwZiz584PSaiXHapMWcIYMLogqhverQmxvFVNndMcBgCKKBYagcu3dmlU6bpwDJTmegO2QgIvKzEMR7wGze+EsiC6LC/v1Seu9uomBDC6WlIqK+YvBQZ/TA2LdNuMeSBFa6CkW3rDLlfko8x7GfyC2S9AAuC30fSckAtXTIGaU= Received: from BN6PR11MB1619.namprd11.prod.outlook.com (2603:10b6:405:10::20) by BN6PR11MB1537.namprd11.prod.outlook.com (2603:10b6:405:c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Fri, 3 Jul 2020 06:02:13 +0000 Received: from BN6PR11MB1619.namprd11.prod.outlook.com ([fe80::b079:fd10:b939:ae6]) by BN6PR11MB1619.namprd11.prod.outlook.com ([fe80::b079:fd10:b939:ae6%6]) with mapi id 15.20.3131.036; Fri, 3 Jul 2020 06:02:13 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "Veliyathuparambil Prakashan, KrishnadasX" , "leif@nuviainc.com" , Laszlo Ersek , "afish@apple.com" , "Kinney, Michael D" CC: "Gao, Zhichao" , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg: Upon BootOption failure, Destroy RamDisk memory before RSC. Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg: Upon BootOption failure, Destroy RamDisk memory before RSC. Thread-Index: AQHWRjnhoCuDDgmVsEGyqbfoSuExFKj1cORw Date: Fri, 3 Jul 2020 06:02:12 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.219] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 292aa15c-5512-41fe-6893-08d81f16a177 x-ms-traffictypediagnostic: BN6PR11MB1537: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 045315E1EE x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 36HewfvXwgpZINRjJZ9ORlXvk+GgssqlrKNMMMm7fDo4FLq6hxOPmdzHYt+k0HfW7GvTjG3lNB3w5pALq59T0wK6H5YUOi6jGpQ9mQwjhsYSxk7/BAcWcJmum83XANK1KozVHmo8DE3ptE0tS/d1VM+KeEmWXEuA5LzRWRiXl0rT8R/gDnkIBQx1CqDwguC4H4RlsIG0Hac1EQbuTDTBdLa5V39dhKxCGgWmTjsEhCwky3/20Ctegfi2ce0+n2PRWTk/Bod/w22aOziUwr01pOpcJ5fYlFsiGlFjFDZQdxmC7K4LAMNn/sONdzGmIALPUweyuIWZAXW+TnRP7KhhTYZuzAAbDocOXgWgmFCMEJUrF80Q2hQesvJcltPFf4SIBIknlwpxPfP6ezcghFGloA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB1619.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(396003)(39860400002)(346002)(366004)(376002)(76116006)(8676002)(186003)(7696005)(26005)(478600001)(6636002)(5660300002)(55016002)(6506007)(52536014)(53546011)(966005)(9686003)(8936002)(316002)(71200400001)(4326008)(83380400001)(66446008)(107886003)(64756008)(66476007)(66946007)(66556008)(86362001)(2906002)(110136005)(33656002)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: veXvBQ8y4XAjw1NWQrw473t6/zXpU7oxrKMSH4K8L9L53Pkk/O0sSTFxDXxPhZNBPHh1ciHBETd0DK40vUtm23oPEvv5Gqhhc23frsgo2FNfrKivcdlaH4gDaB81eq/ZWinybZGpZYyzkXb1T903oRkjc/sLIlbKSLFhdIAWpvrKsOoX7RYFQfgim3xG5WfO3fFWAUI2X5+lmR7q405xjtgyjogLgnBEabyLoN4Ae6YGogvQLP7FwZIRnGlIOYTPcFpveXzOHw2CODOfR5/C4P1JnHUjZg6NXwMkpkgoYFIfjtBlRldh0vl1KoADq555/qdnX/woK5GV7YfdkupTOdE78tSeBJsQLydrCV8Jlm0rmEU9Cogm6Cbpr9JLW3J/SNx8rwQM6+QTHj+B2C9ypZ3BjBXVwFtPlp9HLMnSJYu8e4ib52y5AC81Qiivwu2ibwW2FUK0ZKyz4kooIx2rJLJAxnkiqnJ9bCn2QxKotKG4oxHxfmwIF3ZEF2js6fT0 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1619.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 292aa15c-5512-41fe-6893-08d81f16a177 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2020 06:02:13.0044 (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: cn+A6ZlzfMOVfHR6VOFj+NlmydNlhYzkGoSR8SgGk+Q9u0XVv408p2j93eFdRWaIjue1bWO2/+18t9wKamq00w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1537 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Signed-off-by line is too long and exceeds 80 characters requirement. But, = it is valid.=20 So, I suggest to enhance PatchCheck.py and skip the check for the lines wit= h Signed-off-by, Ack-by:, Reviewed-by:, and Tested-By:.=20 Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Krishnadas= X Veliyathuparambil Prakashan > Sent: Friday, June 19, 2020 10:40 AM > To: devel@edk2.groups.io > Cc: Gao, Zhichao ; Ni, Ray > Subject: [edk2-devel] [PATCH] MdeModulePkg: Upon BootOption failure, Dest= roy RamDisk memory before RSC. >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2818 >=20 > For better memory management, re-ordered the DestroyRamDisk and > ReportStatusCode calls inside the EfiBootManagerBoot() function. >=20 > This will help to clean the unused memory before reporting the > failure status, so that OEMs can use RSC Listener to launch > custom boot option or application for recovering the failed > hard drive. >=20 > This change will help to ensure that the allocated pool of memory > for the failed boot option is freed before executing OEM's RSC > listener callback to handle every boot option failure. >=20 > Signed-off-by: KrishnadasX Veliyathuparambil Prakashan > Cc: "Gao, Zhichao" > Cc: "Ni, Ray" > --- > .../Library/UefiBootManagerLib/BmBoot.c | 28 ++++++++++--------- > 1 file changed, 15 insertions(+), 13 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModule= Pkg/Library/UefiBootManagerLib/BmBoot.c > index 540d169ec1..aff620ad52 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -2,7 +2,7 @@ > Library functions which relates with booting. >=20 >=20 >=20 > Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. >=20 > -Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.
>=20 > (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > @@ -1903,17 +1903,17 @@ EfiBootManagerBoot ( > gBS->UnloadImage (ImageHandle); >=20 > } >=20 > // >=20 > - // Report Status Code with the failure status to indicate that the= failure to load boot option >=20 > - // >=20 > - BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR, Stat= us); >=20 > - BootOption->Status =3D Status; >=20 > - // >=20 > // Destroy the RAM disk >=20 > // >=20 > if (RamDiskDevicePath !=3D NULL) { >=20 > BmDestroyRamDisk (RamDiskDevicePath); >=20 > FreePool (RamDiskDevicePath); >=20 > } >=20 > + // >=20 > + // Report Status Code with the failure status to indicate that the= failure to load boot option >=20 > + // >=20 > + BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR, Stat= us); >=20 > + BootOption->Status =3D Status; >=20 > return; >=20 > } >=20 > } >=20 > @@ -1982,13 +1982,6 @@ EfiBootManagerBoot ( > Status =3D gBS->StartImage (ImageHandle, &BootOption->ExitDataSize, &B= ootOption->ExitData); >=20 > DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status =3D %r\n", Statu= s)); >=20 > BootOption->Status =3D Status; >=20 > - if (EFI_ERROR (Status)) { >=20 > - // >=20 > - // Report Status Code with the failure status to indicate that boot = failure >=20 > - // >=20 > - BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED, Status); >=20 > - } >=20 > - PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumbe= r); >=20 >=20 >=20 > // >=20 > // Destroy the RAM disk >=20 > @@ -1998,6 +1991,15 @@ EfiBootManagerBoot ( > FreePool (RamDiskDevicePath); >=20 > } >=20 >=20 >=20 > + if (EFI_ERROR (Status)) { >=20 > + // >=20 > + // Report Status Code with the failure status to indicate that boot = failure >=20 > + // >=20 > + BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED, Status); >=20 > + } >=20 > + PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumbe= r); >=20 > + >=20 > + >=20 > // >=20 > // Clear the Watchdog Timer after the image returns >=20 > // >=20 > -- > 2.27.0.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#61517): https://edk2.groups.io/g/devel/message/61517 > Mute This Topic: https://groups.io/mt/74978785/1759384 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [liming.gao@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D