From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.518.1593788566624322972 for ; Fri, 03 Jul 2020 08:02:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kHQZUIY2; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: liming.gao@intel.com) IronPort-SDR: kqYpaf4vBZxX2Gr+zfX7bkxgZDGEzoJ3tIsxTpTcYYuJzV3l41lracSwojo8/+PBpkuzQJ6yKQ OYRkTaYsF+5A== X-IronPort-AV: E=McAfee;i="6000,8403,9671"; a="148677477" X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="148677477" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 08:02:45 -0700 IronPort-SDR: tc7S1EFDRdup89m46dkXonCit2mSiqOzm6Bwr2E+BvcMMpy6WI39WZV854kc/4O9+J9GnYAQe2 NVB3FkuBvN7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="304603178" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 03 Jul 2020 08:02:45 -0700 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jul 2020 08:02:45 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jul 2020 08:02:45 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jul 2020 08:02:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SNEA7XwDWZsb5jJrPYV1mEchMIaMFVKlU0XAHPXLHJQIXb/p/iwO2WK0M2n2dhYxLiKtMd6M8qLfNlvUlK0//dqpuXmhL7d/5mR9QbyqvStRCzWmDqqRLdotB5aJhlQoXutoQDCXfPYWKlheLNZWQ9bitzWGtnWlc2w2/VZh9nOBV7WytNvJ7AO7jPoKC7z4tqwoFO+B7k9E+PV2btOA795v3OqDI/wbhvIFp85TFb9SaDVO4y+aunK1AdzunRyueXp3bwtL44MSC9oiQwcvJBS0pBAUIffxxOqpzujahK8BS9I2EIB6mixZ5enRNZJrgFhquYtoBwt1k8uAlq3Vmg== 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=a8LazLTXYvOjibFpNvVwodzQvRrntpzudZIGlmdyRPM=; b=G+26j3POwahBUxernKY/LwBkToPVFtUeUyDBPwNQz79r12qySevjeWZ2pyO2Hqq8jXz0JgnLIyqhCzSjvzHM9UkUrxFaiJukIvHv7Qf7VW7G0nBaRofNIkjRZKMRJLAYmINNQk22qMcUJVvE+kn1sD27KY7Y0Kn93lWA2nvKL282zPCnzN6mFt6sYC+wNDWv9siYPRMu3jBQc99614JtPHa7aZWt7rbJurMtNyhWwiWUIudfsYCVd9I1qywPTkvpzI1viqI4oSbO85Ml+199GyKd2daxNehGmYfZ+9awB4pKPCmkEPUos6OtKSOdlrFL9HIek4DyrDgeCYxjmBOmxg== 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=a8LazLTXYvOjibFpNvVwodzQvRrntpzudZIGlmdyRPM=; b=kHQZUIY2JA6nCzxJo9hWvu7j4ML/KgswNDDyaw+O3xx5SzJlVmQlGpAb4Ld2JpSAjxQC6ujWtZAtGC8m/AIQjSkVl9Ybjl6C4i2wdlziYIY82sWt5rXZVL1JdoTDne2VL74Osi1vYm0ijjyC62YtE2B/avjknobY/l1j0PCC9SY= Received: from MWHPR11MB1630.namprd11.prod.outlook.com (2603:10b6:301:e::7) by MWHPR11MB1312.namprd11.prod.outlook.com (2603:10b6:300:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21; Fri, 3 Jul 2020 15:02:42 +0000 Received: from MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e]) by MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e%6]) with mapi id 15.20.3153.028; Fri, 3 Jul 2020 15:02:42 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "leif@nuviainc.com" CC: "Veliyathuparambil Prakashan, KrishnadasX" , Laszlo Ersek , "afish@apple.com" , "Kinney, Michael D" , "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: AQHWRjnhoCuDDgmVsEGyqbfoSuExFKj1cORwgABQMwCAAEhWoA== Date: Fri, 3 Jul 2020 15:02:42 +0000 Message-ID: References: <20200703104322.GV6739@vanye> In-Reply-To: <20200703104322.GV6739@vanye> 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: 61eeba51-dde0-440a-d335-08d81f622300 x-ms-traffictypediagnostic: MWHPR11MB1312: 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:8882; x-forefront-prvs: 045315E1EE x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K+q/3HHVvaaz/vs1Wz3dmjjHT0pSEn3YkoPk4XcKehTrcnqCBOPqctjKG4nCw312apLGGvzSAJQxdZSz8gKgAiom3LmD2cAfwvJ/Kus59/i0I6lJmSNbJrbpUtPhXgh6yzS4r5yTnKP935wnaXpax/S2IOdE9CdrNT5Dzcpkjo+KhljscRMcRvlTyCkvdBorVFS7+F0hbzmyhNkXCJp7J1sa2BEZYbGVR9VR27hEh6vGx8AXAJiKUl1FoW/sBHTPHtBhi419SPSiFAi8aI0qihqf2y/Po01Dv5ADUhnLaTrEimDDyEqizZSPiL+MsoLdqjgQvyU6ZWaXGHwftwUUd8H9UTOQThIA+dAEEYkj151X20pV+LuVAWa9xVdPv7xQuIfYQQ2wm5/UGwmlZPhN4Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1630.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(376002)(396003)(39860400002)(346002)(366004)(186003)(2906002)(5660300002)(52536014)(9686003)(71200400001)(54906003)(55016002)(8676002)(966005)(53546011)(66446008)(66556008)(64756008)(33656002)(66476007)(83380400001)(26005)(316002)(110136005)(7696005)(4326008)(6506007)(107886003)(8936002)(66946007)(76116006)(478600001)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: GC0EYXhF5vYVgpD4yuubnSJhc/EwCne+fOiUxEUTlkRsHAmhEpUxniKLQgiMz/dnIvtjWhZXAb8Ebu630eMSyCNiTyRQK8TYJpUa1vNgp4mZQ9UtMO/ZJbf7Jv9i4RhPvTedcR8IwTL56BOoIxxrHaehqpFV7ONtanlaYN54mDED0FcU7aJtVl/MXRecRBrZKJy8vU8pVgA9AJfc44vq8Rv/C1Bhl8d46tTltA51Z0KLx0trKpgvoTRFP/5qDh9hry/XBixBo3+mvSzMWNW824mfEMa1otFlhaiOwD2K9+UyX3TsL/VVEB7WBFTOQDiwuij+Cdh7TlwlP4ImssM+x5BTn2vBRlWIwVyLGjtNncMqdp5zV/WqY8SXRTnnL8/AbeawdGdTzV2Y/JLFGh/3CaaK0BF1Kw8+dYiR76w37dIPV6M6eW4ZbJRoWdB3Z1oHjWgHKOqXo7O2tTy0/YWH7rpLVCE4lKa6njxHq85QwxWwVfMY/JO/yzls9aT0EeO+ MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1630.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61eeba51-dde0-440a-d335-08d81f622300 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2020 15:02:42.4968 (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: jPoSASzyrTY0N9NS40FTl/d4F3P9gVfdBvuupZYQmaqzf2b4yo79ih93UZw9/fs7tmUgbktGCn/8YipgiNu+xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1312 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 BZ to enhance PatchCheck is submitted. https://bugzilla.tianocore.org/show_= bug.cgi?id=3D2836 Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Leif Lind= holm > Sent: Friday, July 3, 2020 6:43 PM > To: Gao, Liming > Cc: devel@edk2.groups.io; Veliyathuparambil Prakashan, KrishnadasX ; Laszlo > Ersek ; afish@apple.com; Kinney, Michael D ; Gao, Zhichao > ; Ni, Ray > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg: Upon BootOption failure,= Destroy RamDisk memory before RSC. >=20 > On Fri, Jul 03, 2020 at 06:02:12 +0000, Gao, Liming wrote: > > Signed-off-by line is too long and exceeds 80 characters requirement. = But, it is valid. > > > > So, I suggest to enhance PatchCheck.py and skip the check for the line= s with Signed-off-by, Ack-by:, Reviewed-by:, and Tested-By:. >=20 > Acked-by, not Ack-by, but yes, I completely agree. Restricting the > lenght of these tag lines is not correct. > We may want to consider adding "Cc:" to the list also. >=20 > Regards, >=20 > Leif >=20 > > Thanks > > Liming > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of Krish= nadasX 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,= Destroy RamDisk memory before RSC. > > > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2818 > > > > > > For better memory management, re-ordered the DestroyRamDisk and > > > ReportStatusCode calls inside the EfiBootManagerBoot() function. > > > > > > 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. > > > > > > 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. > > > > > > Signed-off-by: KrishnadasX Veliyathuparambil Prakashan > > > Cc: "Gao, Zhichao" > > > Cc: "Ni, Ray" > > > --- > > > .../Library/UefiBootManagerLib/BmBoot.c | 28 ++++++++++------= --- > > > 1 file changed, 15 insertions(+), 13 deletions(-) > > > > > > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeM= odulePkg/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. > > > > > > > > > > > > Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > > > > > > -Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<= BR> > > > > > > +Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<= BR> > > > > > > (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > > > @@ -1903,17 +1903,17 @@ EfiBootManagerBoot ( > > > gBS->UnloadImage (ImageHandle); > > > > > > } > > > > > > // > > > > > > - // Report Status Code with the failure status to indicate tha= t the failure to load boot option > > > > > > - // > > > > > > - BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR,= Status); > > > > > > - BootOption->Status =3D Status; > > > > > > - // > > > > > > // Destroy the RAM disk > > > > > > // > > > > > > if (RamDiskDevicePath !=3D NULL) { > > > > > > BmDestroyRamDisk (RamDiskDevicePath); > > > > > > FreePool (RamDiskDevicePath); > > > > > > } > > > > > > + // > > > > > > + // Report Status Code with the failure status to indicate tha= t the failure to load boot option > > > > > > + // > > > > > > + BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR,= Status); > > > > > > + BootOption->Status =3D Status; > > > > > > return; > > > > > > } > > > > > > } > > > > > > @@ -1982,13 +1982,6 @@ EfiBootManagerBoot ( > > > Status =3D gBS->StartImage (ImageHandle, &BootOption->ExitDataSiz= e, &BootOption->ExitData); > > > > > > DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status =3D %r\n", = Status)); > > > > > > BootOption->Status =3D Status; > > > > > > - if (EFI_ERROR (Status)) { > > > > > > - // > > > > > > - // Report Status Code with the failure status to indicate that = boot failure > > > > > > - // > > > > > > - BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED, Statu= s); > > > > > > - } > > > > > > - PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) Option= Number); > > > > > > > > > > > > // > > > > > > // Destroy the RAM disk > > > > > > @@ -1998,6 +1991,15 @@ EfiBootManagerBoot ( > > > FreePool (RamDiskDevicePath); > > > > > > } > > > > > > > > > > > > + if (EFI_ERROR (Status)) { > > > > > > + // > > > > > > + // Report Status Code with the failure status to indicate that = boot failure > > > > > > + // > > > > > > + BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED, Statu= s); > > > > > > + } > > > > > > + PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) Option= Number); > > > > > > + > > > > > > + > > > > > > // > > > > > > // Clear the Watchdog Timer after the image returns > > > > > > // > > > > > > -- > > > 2.27.0.windows.1 > > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > > Groups.io Links: You receive all messages sent to this group. > > > > > > View/Reply Online (#61517): https://edk2.groups.io/g/devel/message/6= 1517 > > > 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 > > >=20 >=20