Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table.
authorLu, ShifeiX A <shifeix.a.lu@intel.com>
Thu, 28 Jul 2016 08:21:28 +0000 (16:21 +0800)
committerdavid wei <david.wei@intel.com>
Sun, 31 Jul 2016 03:59:54 +0000 (11:59 +0800)
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>
Reviewed-by: David Wei <david.wei@intel.com>
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc [new file with mode: 0644]
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c

index 9c00651..e9a7d80 100644 (file)
@@ -5,7 +5,7 @@
 #  All .asi files tagged with "ToolCode="DUMMY"" in following file list are device description and are included\r
 #  by top level ASL file which will be dealed with by asl.exe application.\r
 #\r
-# Copyright (c)  1999  - 2015, Intel Corporation. All rights reserved\r
+# Copyright (c)  1999  - 2016, Intel Corporation. All rights reserved\r
 #\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License that accompanies this distribution.\r
@@ -37,6 +37,7 @@
   Mcfg/Mcfg.aslc\r
   Hpet/Hpet.aslc\r
   Lpit/Lpit.aslc\r
+  Wsmt/Wsmt.aslc\r
 \r
 \r
 [Packages]\r
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
new file mode 100644 (file)
index 0000000..4142201
--- /dev/null
@@ -0,0 +1,60 @@
+/*++\r
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+\r
+\r
+Module Name:\r
+\r
+  Wsmt.c\r
+\r
+Abstract:\r
+\r
+  This file contains a structure definition for the Windows SMM Security\r
+  Mitigations Table (WSMT).\r
+\r
+++*/\r
+\r
+//\r
+// Statements that include other files\r
+//\r
+#include "AcpiTablePlatform.h"\r
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>\r
+\r
+//\r
+// WSMT Table definition\r
+//\r
+EFI_ACPI_WSMT_TABLE WSMT = {\r
+  EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE,\r
+  sizeof (EFI_ACPI_WSMT_TABLE),\r
+  EFI_WSMT_TABLE_REVISION,\r
+  //\r
+  // Checksum will be updated at runtime\r
+  //\r
+  0,\r
+  EFI_ACPI_OEM_ID,            // OEMID is a 6 bytes long field\r
+  EFI_ACPI_OEM_TABLE_ID,      // OEM table identification(8 bytes long)\r
+  EFI_ACPI_OEM_REVISION,      // OEM revision\r
+  EFI_ACPI_CREATOR_ID,        // ASL compiler vendor ID\r
+  EFI_ACPI_CREATOR_REVISION,  // ASL compiler revision number\r
+  0x00000000,                 // Protection flag\r
+};\r
+\r
+VOID*\r
+ReferenceAcpiTable (\r
+  VOID\r
+  )\r
+{\r
+  //\r
+  // Reference the table being generated to prevent the optimizer from\r
+  // removing the data structure from the executable\r
+  //\r
+  return (VOID*)&WSMT;\r
+}\r
index db1b5a5..8a883f2 100644 (file)
@@ -58,6 +58,7 @@ Abstract:
 #include <PchAccess.h>\r
 #include <Guid/Vlv2Variable.h>\r
 #include <Guid/PlatformCpuInfo.h>\r
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>\r
 \r
 \r
 CHAR16    EfiPlatformCpuInfoVariable[] = L"PlatformCpuInfo";\r
@@ -238,6 +239,7 @@ PlatformUpdateTables (
   UINT8                                                       TempVal;\r
   EFI_ACPI_3_0_IO_APIC_STRUCTURE                              *IOApicType;\r
   EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER         *APICTableHeader;\r
+  EFI_ACPI_WSMT_TABLE                                         *WsmtTable;\r
 \r
   CurrPtr                 = NULL;\r
   EndPtr                  = NULL;\r
@@ -599,6 +601,17 @@ PlatformUpdateTables (
       gBS->FreePool (OcurModelStringBuffer);\r
       gBS->FreePool (OcurRefDataBlockBuffer);\r
       break;\r
+\r
+\r
+    case EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE:\r
+      WsmtTable = (EFI_ACPI_WSMT_TABLE *) Table;\r
+       //\r
+       // Update Microsoft WSMT table Protections flags.\r
+       //\r
+      WsmtTable->ProtectionFlags = ((WsmtTable->ProtectionFlags) | (EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS | EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION ));\r
+      break;\r
+\r
+\r
     default:\r
       break;\r
   }\r