]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Tcg2Smm: Update HID patch logic
authorZhang, Chao B <chao.b.zhang@intel.com>
Wed, 4 Jan 2017 02:29:28 +0000 (10:29 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Wed, 4 Jan 2017 05:18:50 +0000 (13:18 +0800)
Update HID patch logic. NOOP in ASL template may cause syntax error when
disassembled and recompiled.

Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h
SecurityPkg/Tcg/Tcg2Smm/Tpm.asl

index 2cedfde75329fc2dd0c7317868fb7ab92bf890e8..e8880585449278b5e775d9ea2c6daca163af841e 100644 (file)
@@ -9,7 +9,7 @@
 \r
   PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -329,7 +329,6 @@ UpdateHID (
   // Initialize HID with Default PNP string\r
   //\r
   ZeroMem(HID, TPM_HID_ACPI_SIZE);\r
-  CopyMem(HID, TPM_HID_TAG, TPM_HID_PNP_SIZE);\r
 \r
   //\r
   // Get Manufacturer ID\r
@@ -389,10 +388,12 @@ UpdateHID (
     if (AsciiStrCmp((CHAR8 *)DataPtr,  TPM_HID_TAG) == 0) {\r
       if (PnpHID) {\r
         CopyMem(DataPtr, HID, TPM_HID_PNP_SIZE);\r
-      } else {\r
         //\r
-        // NOOP will be patched to '\0'\r
+        // if HID is PNP ID, patch the last byte in HID TAG to Noop\r
         //\r
+        *(DataPtr + TPM_HID_PNP_SIZE) = AML_NOOP_OP;\r
+      } else {\r
+\r
         CopyMem(DataPtr, HID, TPM_HID_ACPI_SIZE);\r
       }\r
       DEBUG((EFI_D_INFO, "TPM2 ACPI _HID updated to %a\n", HID));\r
index 18e8bfc355a891df9c4bfd3cfd286aa98752b69f..100804cf2abd3a0ec0e62696116205715c75b0fb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file for Tcg2 SMM driver.\r
   \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -98,7 +98,7 @@ typedef struct {
 //\r
 // PNP _HID for TPM2 device\r
 //\r
-#define TPM_HID_TAG                                                "NNN0000"\r
+#define TPM_HID_TAG                                                "NNNN0000"\r
 #define TPM_HID_PNP_SIZE                                           8\r
 #define TPM_HID_ACPI_SIZE                                          9\r
 \r
index 4128684806107d3d6b86232645e0b227a281ba61..cf0642e10457e510642be55e4fa77c7a5b1b29b0 100644 (file)
@@ -2,7 +2,7 @@
   The TPM2 definition block in ACPI table for TCG2 physical presence  \r
   and MemoryClear.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 (c)Copyright 2016 HP Development Company, L.P.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
@@ -30,11 +30,11 @@ DefinitionBlock (
       //\r
       // TCG2\r
       //\r
-      Name (_HID, "NNN0000")\r
+\r
       //\r
-      // Reserve 1 more byte for ACPI HID\r
+      //  TAG for patching TPM2.0 _HID\r
       //\r
-      Noop\r
+      Name (_HID, "NNNN0000")\r
 \r
       Name (_CID, "MSFT0101")\r
 \r