public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Jeff Fan <jeff.fan@intel.com>
Subject: [Patch 1/4] UefiCpuPkg: Add PPIN related MSR for Xeon E5.
Date: Fri, 14 Jul 2017 10:49:11 +0800	[thread overview]
Message-ID: <1500000554-21960-2-git-send-email-eric.dong@intel.com> (raw)
In-Reply-To: <1500000554-21960-1-git-send-email-eric.dong@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
---
 UefiCpuPkg/Include/Register/Msr.h             |  1 +
 UefiCpuPkg/Include/Register/Msr/XeonE5v2Msr.h | 91 +++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 UefiCpuPkg/Include/Register/Msr/XeonE5v2Msr.h

diff --git a/UefiCpuPkg/Include/Register/Msr.h b/UefiCpuPkg/Include/Register/Msr.h
index 0ac8d5b..8dbd6f7 100644
--- a/UefiCpuPkg/Include/Register/Msr.h
+++ b/UefiCpuPkg/Include/Register/Msr.h
@@ -45,5 +45,6 @@
 #include <Register/Msr/PentiumMMsr.h>
 #include <Register/Msr/P6Msr.h>
 #include <Register/Msr/PentiumMsr.h>
+#include <Register/Msr/XeonE5v2Msr.h>
 
 #endif
diff --git a/UefiCpuPkg/Include/Register/Msr/XeonE5v2Msr.h b/UefiCpuPkg/Include/Register/Msr/XeonE5v2Msr.h
new file mode 100644
index 0000000..29ba125
--- /dev/null
+++ b/UefiCpuPkg/Include/Register/Msr/XeonE5v2Msr.h
@@ -0,0 +1,91 @@
+/** @file
+  MSR Definitions for Intel(R) Xeon(R) Processor E5 v2 Family.
+
+  Provides defines for Machine Specific Registers(MSR) indexes. Data structures
+  are provided for MSRs that contain one or more bit fields.  If the MSR value
+  returned is a single 32-bit or 64-bit value, then a data structure is not
+  provided for that MSR.
+
+  Copyright (c) 2017, 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
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Specification Reference:
+  Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3,
+  September 2016, Chapter 35 Model-Specific-Registers (MSR), Section 35.8.
+
+**/
+
+#ifndef __XEON_E5_V2_MSR_H__
+#define __XEON_E5_V2_MSR_H__
+
+#include <Register/ArchitecturalMsr.h>
+
+/**
+  Is Intel(R) Xeon(R) Processor E5 V2 Family?
+
+  @param   DisplayFamily  Display Family ID
+  @param   DisplayModel   Display Model ID
+
+  DisplayModel == 0x3E  Intel Xeon processors E5 V2
+
+  @retval  TRUE   Yes, it is.
+  @retval  FALSE  No, it isn't.
+**/
+#define IS_XEON_E5_V2_PROCESSOR(DisplayFamily, DisplayModel) \
+  (DisplayFamily == 0x06 && \
+   (                        \
+    DisplayModel == 0x3E    \
+    )                       \
+   )
+
+#define MSR_XEON_E5_V2_PIN_CTL                0x0000004E
+
+/**
+  MSR information returned for MSR index #MSR_XEON_E7_FEATURE_CONFIG
+**/
+typedef union {
+  ///
+  /// Individual bit fields
+  ///
+  struct {
+    ///
+    /// [Bit 0] LockOut (R/WO) 1 = Locked; 0 = unlocked
+    /// Set 1 to prevent further writes to MSR_PPIN_CTL. Writing 1 to
+    /// MSR_PPINCTL[bit 0] is permitted only if MSR_PPIN_CTL[bit 1] is
+    /// clear, Default is 0.
+    /// BIOS should provide an opt-in menu to enable the user to turn on
+    /// MSR_PPIN_CTL[bit 1] for privileged inventory initialization agent to
+    /// access MSR_PPIN. After reading MSR_PPIN, the privileged
+    /// inventory initialization agent should write '1b' to MSR_PPIN_CTL
+    /// to disable further access to MSR_PPIN and prevent unauthorized
+    /// modification to MSR_PPIN_CTL
+    ///
+    UINT32  LockOut:1;
+    /// [Bit 1] Enable_PPIN (R/W) 1 = Enabled; 0 = Disabled
+    /// If 1, enables MSR_PPIN to be accessible using RDMSR. Once set,
+    /// attempt to write 1 to MSR_PPIN_CTL[bit 0] will cause #GP.
+    /// If 0, an attempt to read MSR_PPIN will cause #GP. Default is 0
+    ///
+    UINT32  EnablePpin:1;
+    UINT32  Reserved1:30;
+    UINT32  Reserved2:32;
+  } Bits;
+  ///
+  /// All bit fields as a 32-bit value
+  ///
+  UINT32  Uint32;
+  ///
+  /// All bit fields as a 64-bit value
+  ///
+  UINT64  Uint64;
+} MSR_XEON_E5_V2_PIN_CTL_REGISTER;
+
+#define MSR_XEON_E5_V2_PLATFORM_INFO          0x000000CE
+
+#endif
\ No newline at end of file
-- 
2.7.0.windows.1



  reply	other threads:[~2017-07-14  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14  2:49 [Patch 0/4] Enable PPIN Cpu feature Eric Dong
2017-07-14  2:49 ` Eric Dong [this message]
2017-07-14  2:49 ` [Patch 2/4] UefiCpuPkg RegisterCpuFeaturesLib: Add error handling Eric Dong
2017-07-14  2:49 ` [Patch 3/4] UefiCpuPkg: Add feature definition for PPIN Eric Dong
2017-07-14  2:49 ` [Patch 4/4] UefiCpuPkg CpuCommonFeaturesLib: Enable Ppin feature Eric Dong

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=1500000554-21960-2-git-send-email-eric.dong@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