From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web11.7703.1593773006405442022 for ; Fri, 03 Jul 2020 03:43:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=F6gTEsnL; spf=pass (domain: nuviainc.com, ip: 209.85.128.67, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f67.google.com with SMTP id q15so31585525wmj.2 for ; Fri, 03 Jul 2020 03:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uTlhg5KfSasoBKfCRW2CYfeIdckuVZP8Rp2eNHtPnIA=; b=F6gTEsnLY7S3XejBKxEie3fUtrVevydN3IX/5am2TcriU97Rj4CEFwfDcWZpjhPhxA YK1kEajObTmZ2LLBig5liyu49fI/6Hzr0w6CsH/qA6OICmTmOg+a+v5c8KGx+D1vcK4s ivcFnhYUo0g+CXfwz4pHstWKq6Wki/Wc2DCjQXGrzmqDB5OkiT3TTZKhrr8gEJAmK3Ll 29SUeVGXlU4j6a+Dqe0t02zNAeiieSv0XOFDI1OKsOfeqkWX/C60XQA9cMZTgepGr8re BvTavKOKD8UxP5kudhgYT1Ui0tC8j4VUpCDDe81Trw+elBlyTrjB9BZqSd45NJ15rFwH MWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uTlhg5KfSasoBKfCRW2CYfeIdckuVZP8Rp2eNHtPnIA=; b=HqKMYiWD/sBPhTMH1S5HFL2VF8mKIZEd6kxHn2gprVxiBD8G/tzrqxuLu57NvQo98R seXeoYbejIDBgWKBXLTtKMKX/EvJxER7FvVmnZjtZKmfK1RRyjUSxUQJ+CZG3OMsP0o+ GZy8tYjBr+06iQgE/51Ankf4hloSSmUU1Istv/osxA6HS+RBw9KdTtCZGNPQfg6LNGQy ZLZH4XCeY0sEzyyAqyoVEnXvoGeYACUuHvv/B4sqQzVaz2JSmIoEwRvt54SDB3sgoakK QVZfYO2C6HVWnmdVnk9Etgvpr7b84huWWIUJ0uO0qSrIJf3UARb29fob2q/zNMvehuOC 4+Bw== X-Gm-Message-State: AOAM532eWn4bUwU1+cO0WNq6UafBLFDwK1Ye/1RovObRWxJK2bO/9x1/ QvFARTbh6Z4DXtrVzsF6K1A8yg== X-Google-Smtp-Source: ABdhPJx2uy7qfij2M+/Zkwl7qk1uAdv+iMw5LhAx0FXdvcBPxJdqDt/FH3rXLeD66mnFLatDzkTanA== X-Received: by 2002:a1c:2d4b:: with SMTP id t72mr35405565wmt.105.1593773004882; Fri, 03 Jul 2020 03:43:24 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id x185sm13747969wmg.41.2020.07.03.03.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 03:43:24 -0700 (PDT) Date: Fri, 3 Jul 2020 11:43:22 +0100 From: "Leif Lindholm" 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. Message-ID: <20200703104322.GV6739@vanye> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 lines with Signed-off-by, Ack-by:, Reviewed-by:, and Tested-By:. 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. Regards, Leif > Thanks > Liming > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of KrishnadasX 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=2818 > > > > 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/MdeModulePkg/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.
> > > > +Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.
> > > > (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 that the failure to load boot option > > > > - // > > > > - BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR, Status); > > > > - BootOption->Status = Status; > > > > - // > > > > // Destroy the RAM disk > > > > // > > > > if (RamDiskDevicePath != NULL) { > > > > BmDestroyRamDisk (RamDiskDevicePath); > > > > FreePool (RamDiskDevicePath); > > > > } > > > > + // > > > > + // Report Status Code with the failure status to indicate that the failure to load boot option > > > > + // > > > > + BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR, Status); > > > > + BootOption->Status = Status; > > > > return; > > > > } > > > > } > > > > @@ -1982,13 +1982,6 @@ EfiBootManagerBoot ( > > Status = gBS->StartImage (ImageHandle, &BootOption->ExitDataSize, &BootOption->ExitData); > > > > DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status)); > > > > BootOption->Status = 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, Status); > > > > - } > > > > - PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber); > > > > > > > > // > > > > // 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, Status); > > > > + } > > > > + PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber); > > > > + > > > > + > > > > // > > > > // Clear the Watchdog Timer after the image returns > > > > // > > > > -- > > 2.27.0.windows.1 > > > > > > -=-=-=-=-=-= > > Groups.io Links: You receive all messages sent to this group. > > > > 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] > > -=-=-=-=-=-= >