From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 371EA1A1F46 for ; Wed, 7 Sep 2016 21:30:17 -0700 (PDT) Received: from arm-build-server.us.rdlabs.hpecorp.net (arm-build-server.us.rdlabs.hpecorp.net [16.84.24.54]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 8D4625E for ; Thu, 8 Sep 2016 04:30:16 +0000 (UTC) From: Joseph Shifflett To: edk2-devel@lists.01.org Date: Wed, 7 Sep 2016 23:30:14 -0500 Message-Id: <1473309015-26017-5-git-send-email-joseph.shifflett@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473309015-26017-1-git-send-email-joseph.shifflett@hpe.com> References: <1473309015-26017-1-git-send-email-joseph.shifflett@hpe.com> Subject: [PATCH v1 4/5] OvmfPkg/SmmCpuFeaturesLib: Abstact processor features X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 04:30:17 -0000 Create new functions to abstract how XD/NX is detected, enabled, and disabled. Also, create a new function to determine if Branch Trace Storage is supported. Existing code is specific to Intel processors. This provides NULL implementations of the new functions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Joseph Shifflett --- OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index a307f64c9c61..4c8c7fb7b25f 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -2,6 +2,7 @@ The CPU specific programming for PiSmmCpuDxeSmm module. Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP
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 @@ -832,3 +833,46 @@ SmmCpuFeaturesAllocatePageTableMemory ( return NULL; } +/** + This API provides a method to determine if XD/NX support has been forced off in + the non-SMM execution environment. It will enable XD/NX support while in SMM + + @retval TRUE XD/NX was disabled when runningn in the non-SMM execution environment + @retval FALSE XD/NX was enabled when runningn in the non-SMM execution environment + +**/ +BOOLEAN +EFIAPI +SmmCpuFeaturesCheckAndEnableXdSupport ( + VOID + ) +{ + return FALSE; +} + +/** + This API provides a method to disable XD/NX support before exiting SMM +**/ +VOID +EFIAPI +SmmCpuFeaturesDisableXdSupport ( + VOID + ) +{ +} + +/** + This API determines if Branch Trace Storage Support is currently available + + @retval TRUE BTS is available + @retval FALSE BTS is disabled + +**/ +BOOLEAN +EFIAPI +SmmCpuFeaturesConfirmBranchTraceStorageSupport ( + VOID + ) +{ + return FALSE; +} -- 2.7.4