From: "Wei, David" <david.wei@intel.com>
To: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wei, David" <david.wei@intel.com>
Subject: Re: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table.
Date: Fri, 29 Jul 2016 02:54:03 +0000 [thread overview]
Message-ID: <89954A0B46707A448411A627AD4EEE3437D7D5D2@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <2fa11710-fbcb-43a2-8815-e2d98e674ee5@LUSHIFEX-MOBL.local>
Reviewed-by: David Wei <david.wei@intel.com>
Thanks,
David Wei
Intel SSG BIOS Team
-----Original Message-----
From: Lu, ShifeiX A
Sent: Thursday, July 28, 2016 4:21 PM
To: edk2-devel@lists.01.org
Cc: Wei; Wei, David <david.wei@intel.com>
Subject: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table.
This is an sample WSMT table, which we only
update BIT0 and BIT1 of Protections flags fields.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf | 3 +-
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc | 60 ++++++++++++++++++++++
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 13 +++++
3 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
index 9c00651..e9a7d80 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
@@ -3,11 +3,11 @@
#
# Build acpi table data required by system boot.
# All .asi files tagged with "ToolCode="DUMMY"" in following file list are device description and are included
# by top level ASL file which will be dealed with by asl.exe application.
#
-# Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved
+# Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved
#
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php.
@@ -35,10 +35,11 @@
Facp/Facp.aslc
Madt/Madt30.aslc
Mcfg/Mcfg.aslc
Hpet/Hpet.aslc
Lpit/Lpit.aslc
+ Wsmt/Wsmt.aslc
[Packages]
MdePkg/MdePkg.dec
Vlv2TbltDevicePkg/PlatformPkg.dec
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
new file mode 100644
index 0000000..4142201
--- /dev/null
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
@@ -0,0 +1,60 @@
+/*++
+ Copyright (c) 2016, 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 that 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.
+
+
+
+Module Name:
+
+ Wsmt.c
+
+Abstract:
+
+ This file contains a structure definition for the Windows SMM Security
+ Mitigations Table (WSMT).
+
+++*/
+
+//
+// Statements that include other files
+//
+#include "AcpiTablePlatform.h"
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>
+
+//
+// WSMT Table definition
+//
+EFI_ACPI_WSMT_TABLE WSMT = {
+ EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE,
+ sizeof (EFI_ACPI_WSMT_TABLE),
+ EFI_WSMT_TABLE_REVISION,
+ //
+ // Checksum will be updated at runtime
+ //
+ 0,
+ EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
+ EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
+ EFI_ACPI_OEM_REVISION, // OEM revision
+ EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
+ EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
+ 0x00000000, // Protection flag
+};
+
+VOID*
+ReferenceAcpiTable (
+ VOID
+ )
+{
+ //
+ // Reference the table being generated to prevent the optimizer from
+ // removing the data structure from the executable
+ //
+ return (VOID*)&WSMT;
+}
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index db1b5a5..8a883f2 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -56,10 +56,11 @@ Abstract:
#include <Guid/AcpiTableStorage.h>
#include <Guid/EfiVpdData.h>
#include <PchAccess.h>
#include <Guid/Vlv2Variable.h>
#include <Guid/PlatformCpuInfo.h>
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>
CHAR16 EfiPlatformCpuInfoVariable[] = L"PlatformCpuInfo";
CHAR16 gACPIOSFRModelStringVariableName[] = ACPI_OSFR_MODEL_STRING_VARIABLE_NAME;
CHAR16 gACPIOSFRRefDataBlockVariableName[] = ACPI_OSFR_REF_DATA_BLOCK_VARIABLE_NAME;
@@ -236,10 +237,11 @@ PlatformUpdateTables (
UINTN LocalApicCounter;
EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer;
UINT8 TempVal;
EFI_ACPI_3_0_IO_APIC_STRUCTURE *IOApicType;
EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *APICTableHeader;
+ EFI_ACPI_WSMT_TABLE *WsmtTable;
CurrPtr = NULL;
EndPtr = NULL;
ApicPtr = NULL;
LocalApicCounter = 0;
@@ -597,10 +599,21 @@ PlatformUpdateTables (
}
gBS->FreePool (OcurMfgStringBuffer);
gBS->FreePool (OcurModelStringBuffer);
gBS->FreePool (OcurRefDataBlockBuffer);
break;
+
+
+ case EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE:
+ WsmtTable = (EFI_ACPI_WSMT_TABLE *) Table;
+ //
+ // Update Microsoft WSMT table Protections flags.
+ //
+ WsmtTable->ProtectionFlags = ((WsmtTable->ProtectionFlags) | (EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS | EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION ));
+ break;
+
+
default:
break;
}
//
--
2.6.2.windows.1
parent reply other threads:[~2016-07-29 2:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <2fa11710-fbcb-43a2-8815-e2d98e674ee5@LUSHIFEX-MOBL.local>]
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=89954A0B46707A448411A627AD4EEE3437D7D5D2@SHSMSX101.ccr.corp.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