From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 A889E1A1F52 for ; Thu, 8 Sep 2016 01:10:03 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E73034FC; Thu, 8 Sep 2016 08:10:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-57.phx2.redhat.com [10.3.116.57]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u888A1Yq022797; Thu, 8 Sep 2016 04:10:02 -0400 To: Joseph Shifflett , edk2-devel@ml01.01.org References: <1473309015-26017-1-git-send-email-joseph.shifflett@hpe.com> <1473309015-26017-2-git-send-email-joseph.shifflett@hpe.com> From: Laszlo Ersek Message-ID: <7c24dc38-3c38-66a6-ddb6-74e66e3a40d2@redhat.com> Date: Thu, 8 Sep 2016 10:10:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1473309015-26017-2-git-send-email-joseph.shifflett@hpe.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Sep 2016 08:10:03 +0000 (UTC) Subject: Re: [PATCH v1 1/5] UefiCpuPkg: SmmCpuFeaturesLib.h: 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 08:10:03 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 09/08/16 06:30, Joseph Shifflett wrote: > 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. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Joseph Shifflett > --- > UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h | 37 ++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h b/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h > index 4478003467c8..48b4565b49bb 100644 > --- a/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h > +++ b/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h > @@ -2,6 +2,7 @@ > Library that provides CPU specific functions to support the PiSmmCpuDxeSmm module. > > Copyright (c) 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 > @@ -398,4 +399,40 @@ SmmCpuFeaturesAllocatePageTableMemory ( > IN UINTN Pages > ); > > +/** > + 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 Typo: "runningn". Other than that, I'll let the UefiCpuPkg maintainers review these interface additions. Thanks Laszlo > + > +**/ > +BOOLEAN > +EFIAPI > +SmmCpuFeaturesCheckAndEnableXdSupport ( > + VOID > + ); > + > +/** > + 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 > + ); > + > #endif >