public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
To: edk2-devel@lists.01.org, liming.gao@intel.com,
	chao.b.zhang@intel.com, leif.lindholm@linaro.org
Subject: [RFC PATCH v4 12/12] CryptoPkg/BaseCryptLib: allow MM_STANDALONE drivers to use this library
Date: Tue, 11 Dec 2018 11:51:42 +0530	[thread overview]
Message-ID: <1544509302-1000-13-git-send-email-jagadeesh.ujja@arm.com> (raw)
In-Reply-To: <1544509302-1000-1-git-send-email-jagadeesh.ujja@arm.com>

“BaseCryptLib” library can be used by MM_STANDALONE drivers as well.
So add MM_STANDALONE as the module type this library supports

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
---
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf       |  7 ++++++-
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf    |  4 ++++
 CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 15 +++++++++------
 3 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index f29445c..7d93fe2 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -7,6 +7,7 @@
 #  buffer overflow or integer overflow.
 #
 #  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2018, ARM Limited. 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
@@ -24,7 +25,7 @@
   FILE_GUID                      = be3bb803-91b6-4da0-bd91-a8b21c18ca5d
   MODULE_TYPE                    = DXE_DRIVER
   VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = BaseCryptLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER
+  LIBRARY_CLASS                  = BaseCryptLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER MM_STANDALONE
 
 #
 # The following information is for reference only and not required by the build tools.
@@ -85,6 +86,10 @@
   OpensslLib
   IntrinsicLib
   PrintLib
+  PcdLib
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdStandaloneMmVariableEnabled
 
 #
 # Remove these [BuildOptions] after this library is cleaned up
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 32628c8..4ce5a6f 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -91,6 +91,10 @@
   OpensslLib
   IntrinsicLib
   PrintLib
+  PcdLib
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdStandaloneMmVariableEnabled
 
 #
 # Remove these [BuildOptions] after this library is cleaned up
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
index 5f9b0c2..b7c57bb 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
@@ -3,6 +3,7 @@
   for OpenSSL-based Cryptographic Library (used in DXE & RUNTIME).
 
 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2018, ARM Limited. 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
@@ -77,12 +78,14 @@ time_t time (time_t *timer)
   time_t      CalTime;
   UINTN       Year;
 
-  //
-  // Get the current time and date information
-  //
-  Status = gRT->GetTime (&Time, NULL);
-  if (EFI_ERROR (Status) || (Time.Year < 1970)) {
-    return 0;
+  if (!PcdGetBool (PcdStandaloneMmVariableEnabled)) {
+    //
+    // Get the current time and date information
+    //
+    Status = gRT->GetTime (&Time, NULL);
+    if (EFI_ERROR (Status) || (Time.Year < 1970)) {
+      return 0;
+    }
   }
 
   //
-- 
2.7.4



  parent reply	other threads:[~2018-12-11  6:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  6:21 [RFC PATCH v4 00/12] Extend secure variable service to be usable from Standalone MM Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 01/12] StandaloneMmPkg: Pull in additonal libraries from staging branch Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 02/12] MdePkg: Add a PCD to enable secure storage of variables Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 03/12] MdePkg/Include: add StandaloneMmServicesTableLib header file Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 04/12] MdePkg/Library/BaseLib/AArch64: Add AsmLfence function Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 05/12] MdePkg/Library: Add StandaloneMmRuntimeDxe library Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 06/12] MdeModulePkg/FaultTolerantWriteDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 07/12] MdeModulePkg/Variable/RuntimeDxe: adapt for usability with MM Standalone Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 08/12] MdeModulePkg/Variable/RuntimeDxe: adapt as a MM Standalone driver Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 09/12] MdeModulePkg/VarCheckLib: allow MM_STANDALONE drivers to use this library Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 10/12] ArmPlatformPkg/NorFlashDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-12-11  6:21 ` [RFC PATCH v4 11/12] SecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library Jagadeesh Ujja
2018-12-17  4:50   ` Zhang, Chao B
2018-12-11  6:21 ` Jagadeesh Ujja [this message]
2018-12-12 15:13 ` [RFC PATCH v4 00/12] Extend secure variable service to be usable from Standalone MM Gao, Liming
2018-12-13 12:00   ` Jagadeesh Ujja
2018-12-13 14:32     ` Gao, Liming
2018-12-14 11:10       ` Jagadeesh Ujja

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=1544509302-1000-13-git-send-email-jagadeesh.ujja@arm.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