public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leo Duran <leo.duran@amd.com>
To: edk2-devel@lists.01.org
Cc: Leo Duran <leo.duran@amd.com>, Jiewen Yao <jiewen.yao@intel.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [PATCH v2 9/9] UefiCpuPkg: SmmCpuFeaturesLib library.
Date: Tue,  3 Oct 2017 17:38:25 -0500	[thread overview]
Message-ID: <1507070305-6727-10-git-send-email-leo.duran@amd.com> (raw)
In-Reply-To: <1507070305-6727-1-git-send-email-leo.duran@amd.com>

Add a FixedPCD to replace an Intel-specific hard-coded macro.
The new PCD allows SMM support on AMD-based x86 systems.

PcdCpuSmmPSDOffset - Processor SMM Descriptor Offset in SMRAM.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leo Duran <leo.duran@amd.com>
---
 UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S    | 4 +++-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm  | 4 +++-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm | 4 +++-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.S     | 4 +++-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm   | 4 +++-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm  | 4 +++-
 6 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S
index 4c0f8c8..d3c291e 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S
@@ -1,6 +1,8 @@
 #------------------------------------------------------------------------------
 #
 # Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017, AMD Incorporated. 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
@@ -36,7 +38,7 @@ ASM_GLOBAL  ASM_PFX(gStmSmiHandlerIdtr)
 #
 # Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 #
-.equ            DSC_OFFSET, 0xfb00
+.equ            DSC_OFFSET, (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 .equ            DSC_GDTPTR, 0x48
 .equ            DSC_GDTSIZ, 0x50
 .equ            DSC_CS, 0x14
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm
index 91dc1eb..096f353 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm
@@ -1,5 +1,7 @@
 ;------------------------------------------------------------------------------ ;
 ; Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2017, AMD Incorporated. 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
@@ -29,7 +31,7 @@ MSR_EFER_XD   EQU     0800h
 ;
 ; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 ;
-DSC_OFFSET    EQU     0fb00h
+DSC_OFFSET    EQU     (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 DSC_GDTPTR    EQU     48h
 DSC_GDTSIZ    EQU     50h
 DSC_CS        EQU     14h
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
index 00c0f067..696af46 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
@@ -1,5 +1,7 @@
 ;------------------------------------------------------------------------------ ;
 ; Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2017, AMD Incorporated. 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
@@ -25,7 +27,7 @@
 ;
 ; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 ;
-%define DSC_OFFSET 0xfb00
+%define DSC_OFFSET (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 %define DSC_GDTPTR 0x48
 %define DSC_GDTSIZ 0x50
 %define DSC_CS 0x14
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.S b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.S
index 1f9f91c..de0f71b 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.S
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.S
@@ -1,6 +1,8 @@
 #------------------------------------------------------------------------------
 #
 # Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017, AMD Incorporated. 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
@@ -35,7 +37,7 @@ ASM_GLOBAL  ASM_PFX(gStmSmiHandlerIdtr)
 #
 # Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 #
-.equ            DSC_OFFSET, 0xfb00
+.equ            DSC_OFFSET, (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 .equ            DSC_GDTPTR, 0x48
 .equ            DSC_GDTSIZ, 0x50
 .equ            DSC_CS, 0x14
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm
index ad51e07..3e4e080 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm
@@ -1,5 +1,7 @@
 ;------------------------------------------------------------------------------ ;
 ; Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2017, AMD Incorporated. 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
@@ -40,7 +42,7 @@ MSR_EFER_XD   EQU     0800h
 ;
 ; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 ;
-DSC_OFFSET    EQU     0fb00h
+DSC_OFFSET    EQU     (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 DSC_GDTPTR    EQU     48h
 DSC_GDTSIZ    EQU     50h
 DSC_CS        EQU     14h
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
index bcac643..8425499 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
@@ -1,5 +1,7 @@
 ;------------------------------------------------------------------------------ ;
 ; Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2017, AMD Incorporated. 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
@@ -29,7 +31,7 @@
 ;
 ; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
 ;
-%define DSC_OFFSET 0xfb00
+%define DSC_OFFSET (FixedPcdGet16 (PcdCpuSmmPSDOffset))
 %define DSC_GDTPTR 0x48
 %define DSC_GDTSIZ 0x50
 %define DSC_CS 0x14
-- 
2.7.4



  parent reply	other threads:[~2017-10-03 22:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 22:38 [PATCH v2 0/9] Enhanced SMM support to AMD-based x86 systems Leo Duran
2017-10-03 22:38 ` [PATCH v2 1/9] UefiCpuPkg: UefiCpuPkg.dec Leo Duran
2017-10-03 22:38 ` [PATCH v2 2/9] UefiCpuPkg: PiSmmCpuDxeSmm driver Leo Duran
2017-10-03 22:38 ` [PATCH v2 3/9] UefiCpuPkg: SmmCpuFeaturesLib library Leo Duran
2017-10-03 22:38 ` [PATCH v2 4/9] OvmfPkg: " Leo Duran
2017-10-03 22:38 ` [PATCH v2 5/9] QuarkSocPkg: " Leo Duran
2017-10-03 22:38 ` [PATCH v2 6/9] UefiCpuPkg: Register/SmramSaveStateMap.h Leo Duran
2017-10-03 22:38 ` [PATCH v2 7/9] UefiCpuPkg: PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h Leo Duran
2017-10-03 22:38 ` [PATCH v2 8/9] UefiCpuPkg: PiSmmCpuDxeSmm driver Leo Duran
2017-10-03 22:38 ` Leo Duran [this message]
2017-10-04  0:50 ` [PATCH v2 0/9] Enhanced SMM support to AMD-based x86 systems Yao, Jiewen
2017-10-04  1:22   ` Kinney, Michael D
2017-10-04 10:46     ` Laszlo Ersek

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=1507070305-6727-10-git-send-email-leo.duran@amd.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