public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@Intel.com>
To: Dandan Bi <dandan.bi@intel.com>, edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: Re: [patch 2/3] MdeModulePkg/BdsDxe: Remove useless Pref Code
Date: Thu, 25 Jan 2018 12:54:03 +0800	[thread overview]
Message-ID: <b5c962f5-2cc8-e88e-e7f2-748b4096d277@Intel.com> (raw)
In-Reply-To: <1516780916-6364-3-git-send-email-dandan.bi@intel.com>

On 1/24/2018 4:01 PM, Dandan Bi wrote:
> Our new performance infrastructure can support to dump performance
> date form ACPI table in OS. So we can remove the old pref code to
> write performance data to OS.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>   MdeModulePkg/Universal/BdsDxe/Bds.h      |  3 +-
>   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  3 +-
>   MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 57 +-------------------------------
>   3 files changed, 3 insertions(+), 60 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/Bds.h b/MdeModulePkg/Universal/BdsDxe/Bds.h
> index 5658e61..63d961f 100644
> --- a/MdeModulePkg/Universal/BdsDxe/Bds.h
> +++ b/MdeModulePkg/Universal/BdsDxe/Bds.h
> @@ -1,9 +1,9 @@
>   /** @file
>     Head file for BDS Architectural Protocol implementation
>   
> -Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD License
>   which accompanies this distribution.  The full text of the license may be found at
>   http://opensource.org/licenses/bsd-license.php
>   
> @@ -16,11 +16,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
>   #define _BDS_MODULE_H_
>   
>   #include <Uefi.h>
>   #include <Guid/GlobalVariable.h>
>   #include <Guid/ConnectConInEvent.h>
> -#include <Guid/Performance.h>
>   #include <Guid/StatusCodeDataTypeVariable.h>
>   #include <Guid/EventGroup.h>
>   
>   #include <Protocol/Bds.h>
>   #include <Protocol/LoadedImage.h>
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> index a00b442..b8c5aa9 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> @@ -3,11 +3,11 @@
>   #
>   #  When DxeCore dispatching all DXE driver, this module will produce architecture protocol
>   #  gEfiBdsArchProtocolGuid. After DxeCore finish dispatching, DxeCore will invoke Entry
>   #  interface of protocol gEfiBdsArchProtocolGuid, then BDS phase is entered.
>   #
> -#  Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
>   #  This program and the accompanying materials
>   #  are licensed and made available under the terms and conditions of the BSD License
>   #  which accompanies this distribution.  The full text of the license may be found at
>   #  http://opensource.org/licenses/bsd-license.php
>   #
> @@ -76,11 +76,10 @@
>                                                   ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device)
>                                                   ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device)
>                                                   ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)
>     gConnectConInEventGuid                        ## SOMETIMES_CONSUMES ## Event
>     gEdkiiStatusCodeDataTypeVariableGuid          ## SOMETIMES_CONSUMES ## GUID
> -  gPerformanceProtocolGuid                      ## SOMETIMES_PRODUCES ## Variable:L"PerfDataMemAddr" (The ACPI address of performance data)
>     gEfiEventReadyToBootGuid                      ## CONSUMES           ## Event
>   
>   [Protocols]
>     gEfiBdsArchProtocolGuid                       ## PRODUCES
>     gEfiSimpleTextInputExProtocolGuid             ## CONSUMES
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 2b24755..3191a98 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -3,11 +3,11 @@
>     When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed
>     which contains interface of BdsEntry.
>     After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
>     to enter BDS phase.
>   
> -Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD License
>   which accompanies this distribution.  The full text of the license may be found at
> @@ -633,61 +633,10 @@ BdsFormalizeEfiGlobalVariable (
>     //
>     BdsFormalizeOSIndicationVariable ();
>   }
>   
>   /**
> -
> -  Allocate a block of memory that will contain performance data to OS.
> -
> -**/
> -VOID
> -BdsAllocateMemoryForPerformanceData (
> -  VOID
> -  )
> -{
> -  EFI_STATUS                    Status;
> -  EFI_PHYSICAL_ADDRESS          AcpiLowMemoryBase;
> -  EDKII_VARIABLE_LOCK_PROTOCOL  *VariableLock;
> -
> -  AcpiLowMemoryBase = 0x0FFFFFFFFULL;
> -
> -  //
> -  // Allocate a block of memory that will contain performance data to OS.
> -  //
> -  Status = gBS->AllocatePages (
> -                  AllocateMaxAddress,
> -                  EfiReservedMemoryType,
> -                  EFI_SIZE_TO_PAGES (PERF_DATA_MAX_LENGTH),
> -                  &AcpiLowMemoryBase
> -                  );
> -  if (!EFI_ERROR (Status)) {
> -    //
> -    // Save the pointer to variable for use in S3 resume.
> -    //
> -    Status = BdsDxeSetVariableAndReportStatusCodeOnError (
> -               L"PerfDataMemAddr",
> -               &gPerformanceProtocolGuid,
> -               EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
> -               sizeof (EFI_PHYSICAL_ADDRESS),
> -               &AcpiLowMemoryBase
> -               );
> -    if (EFI_ERROR (Status)) {
> -      DEBUG ((EFI_D_ERROR, "[Bds] PerfDataMemAddr (%08x) cannot be saved to NV storage.\n", AcpiLowMemoryBase));
> -    }
> -    //
> -    // Mark L"PerfDataMemAddr" variable to read-only if the Variable Lock protocol exists
> -    // Still lock it even the variable cannot be saved to prevent it's set by 3rd party code.
> -    //
> -    Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
> -    if (!EFI_ERROR (Status)) {
> -      Status = VariableLock->RequestToLock (VariableLock, L"PerfDataMemAddr", &gPerformanceProtocolGuid);
> -      ASSERT_EFI_ERROR (Status);
> -    }
> -  }
> -}
> -
> -/**
>     Enter an infinite loop of calling the Boot Manager Menu.
>   
>     This is a last resort alternative to BdsEntry() giving up for good. This
>     function never returns.
>   
> @@ -778,14 +727,10 @@ BdsEntry (
>     //
>     PERF_END (NULL, "DXE", NULL, 0);
>     PERF_START (NULL, "BDS", NULL, 0);
>     DEBUG ((EFI_D_INFO, "[Bds] Entry...\n"));
>   
> -  PERF_CODE (
> -    BdsAllocateMemoryForPerformanceData ();
> -  );
> -
>     //
>     // Fill in FirmwareVendor and FirmwareRevision from PCDs
>     //
>     FirmwareVendor = (CHAR16 *) PcdGetPtr (PcdFirmwareVendor);
>     gST->FirmwareVendor = AllocateRuntimeCopyPool (StrSize (FirmwareVendor), FirmwareVendor);
> 
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

-- 
Thanks,
Ray


  reply	other threads:[~2018-01-25  4:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  8:01 [patch 0/3] Remove the useless pref codes Dandan Bi
2018-01-24  8:01 ` [patch 1/3] UefiCpuPkg/S3Resume: Remove useless pref code Dandan Bi
2018-01-24 15:48   ` Laszlo Ersek
2018-01-24 15:49     ` Laszlo Ersek
2018-01-24  8:01 ` [patch 2/3] MdeModulePkg/BdsDxe: Remove useless Pref Code Dandan Bi
2018-01-25  4:54   ` Ni, Ruiyu [this message]
2018-01-24  8:01 ` [patch 3/3] MdeModulePkg/UefiBootManagerLib: Remove useless pref codes Dandan Bi
2018-01-25  4:55   ` Ni, Ruiyu
2018-01-25  4:58 ` [patch 0/3] Remove the " Zeng, Star
2018-01-25  5:51   ` Bi, Dandan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5c962f5-2cc8-e88e-e7f2-748b4096d277@Intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox