From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 1BD671A1DF2 for ; Thu, 28 Jul 2016 19:54:42 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 28 Jul 2016 19:54:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,437,1464678000"; d="scan'208";a="1031239746" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2016 19:54:41 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 28 Jul 2016 19:54:41 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 28 Jul 2016 19:54:41 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.8]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.107]) with mapi id 14.03.0248.002; Fri, 29 Jul 2016 10:54:03 +0800 From: "Wei, David" To: "Lu, ShifeiX A" , "edk2-devel@lists.01.org" CC: "Wei, David" Thread-Topic: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table. Thread-Index: AQHR6KkMOSBNfOvC0kqJckGMF0WW+qAut3Eg Date: Fri, 29 Jul 2016 02:54:03 +0000 Message-ID: <89954A0B46707A448411A627AD4EEE3437D7D5D2@SHSMSX101.ccr.corp.intel.com> References: <2fa11710-fbcb-43a2-8815-e2d98e674ee5@LUSHIFEX-MOBL.local> In-Reply-To: <2fa11710-fbcb-43a2-8815-e2d98e674ee5@LUSHIFEX-MOBL.local> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmI4NmU2YzctYTVkZS00NzhiLTkxOWUtNzJlOWNjOTM2MzQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImhEOGxLb3lFVzBMbEVNTjI1YU5qZnRKNDNab2pkZkRVWWNLQWRyQWQzZkU9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table. 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: Fri, 29 Jul 2016 02:54:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: David Wei Thanks, David Wei =20 Intel SSG BIOS Team -----Original Message----- From: Lu, ShifeiX A=20 Sent: Thursday, July 28, 2016 4:21 PM To: edk2-devel@lists.01.org Cc: Wei; Wei, David 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 --- 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/Vlv2Devic= eRefCodePkg/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=3D"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 availa= ble under # the terms and conditions of the BSD License that accompanies this distri= bution. # 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 =20 =20 [Packages] MdePkg/MdePkg.dec Vlv2TbltDevicePkg/PlatformPkg.dec diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc b/Vlv2Devic= eRefCodePkg/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.
+ + This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 IMP= LIED. + + + +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 + +// +// WSMT Table definition +// +EFI_ACPI_WSMT_TABLE WSMT =3D { + 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/Vlv2TbltDevice= Pkg/AcpiPlatform/AcpiPlatform.c index db1b5a5..8a883f2 100644 --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c @@ -56,10 +56,11 @@ Abstract: #include #include #include #include #include +#include =20 =20 CHAR16 EfiPlatformCpuInfoVariable[] =3D L"PlatformCpuInfo"; CHAR16 gACPIOSFRModelStringVariableName[] =3D ACPI_OSFR_MODEL_STRING_VA= RIABLE_NAME; CHAR16 gACPIOSFRRefDataBlockVariableName[] =3D ACPI_OSFR_REF_DATA_BLOCK= _VARIABLE_NAME; @@ -236,10 +237,11 @@ PlatformUpdateTables ( UINTN LocalApicCou= nter; EFI_PROCESSOR_INFORMATION ProcessorInf= oBuffer; UINT8 TempVal; EFI_ACPI_3_0_IO_APIC_STRUCTURE *IOApicType; EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *APICTableHe= ader; + EFI_ACPI_WSMT_TABLE *WsmtTable; =20 CurrPtr =3D NULL; EndPtr =3D NULL; ApicPtr =3D NULL; LocalApicCounter =3D 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 =3D (EFI_ACPI_WSMT_TABLE *) Table; + // + // Update Microsoft WSMT table Protections flags. + // + WsmtTable->ProtectionFlags =3D ((WsmtTable->ProtectionFlags) | (EFI_= WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS | EFI_WSMT_PROTECTION_FLAGS_COMM_B= UFFER_NESTED_PTR_PROTECTION )); + break; + + default: break; } =20 // --=20 2.6.2.windows.1