]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
UefiCpuPkg/PiSmmCpuDxeSmm: patch "gSmmCr3" with PatchInstructionX86()
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / PiSmmCpuDxeSmm.c
old mode 100644 (file)
new mode 100755 (executable)
index d00afc8..c5b67e3
@@ -1,7 +1,9 @@
 /** @file\r
 Agent Module to load other modules to deploy SMM Entry Vector for X86 CPU.\r
 \r
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
+\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
@@ -74,6 +76,15 @@ EFI_SMM_CPU_PROTOCOL  mSmmCpu  = {
   SmmWriteSaveState\r
 };\r
 \r
+///\r
+/// SMM Memory Attribute Protocol instance\r
+///\r
+EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL  mSmmMemoryAttribute  = {\r
+  EdkiiSmmGetMemoryAttributes,\r
+  EdkiiSmmSetMemoryAttributes,\r
+  EdkiiSmmClearMemoryAttributes\r
+};\r
+\r
 EFI_CPU_INTERRUPT_HANDLER   mExternalVectorTable[EXCEPTION_VECTOR_NUMBER];\r
 \r
 //\r
@@ -96,11 +107,24 @@ BOOLEAN mSmmReadyToLock = FALSE;
 //\r
 BOOLEAN                  mSmmCodeAccessCheckEnable = FALSE;\r
 \r
+//\r
+// Global copy of the PcdPteMemoryEncryptionAddressOrMask\r
+//\r
+UINT64                   mAddressEncMask = 0;\r
+\r
 //\r
 // Spin lock used to serialize setting of SMM Code Access Check feature\r
 //\r
 SPIN_LOCK                *mConfigSmmCodeAccessCheckLock = NULL;\r
 \r
+//\r
+// Saved SMM ranges information\r
+//\r
+EFI_SMRAM_DESCRIPTOR     *mSmmCpuSmramRanges;\r
+UINTN                    mSmmCpuSmramRangeCount;\r
+\r
+UINT8                    mPhysicalAddressBits;\r
+\r
 /**\r
   Initialize IDT to setup exception handlers for SMM.\r
 \r
@@ -113,6 +137,19 @@ InitializeSmmIdt (
   EFI_STATUS               Status;\r
   BOOLEAN                  InterruptState;\r
   IA32_DESCRIPTOR          DxeIdtr;\r
+\r
+  //\r
+  // There are 32 (not 255) entries in it since only processor\r
+  // generated exceptions will be handled.\r
+  //\r
+  gcSmiIdtr.Limit = (sizeof(IA32_IDT_GATE_DESCRIPTOR) * 32) - 1;\r
+  //\r
+  // Allocate page aligned IDT, because it might be set as read only.\r
+  //\r
+  gcSmiIdtr.Base = (UINTN)AllocateCodePages (EFI_SIZE_TO_PAGES(gcSmiIdtr.Limit + 1));\r
+  ASSERT (gcSmiIdtr.Base != 0);\r
+  ZeroMem ((VOID *)gcSmiIdtr.Base, gcSmiIdtr.Limit + 1);\r
+\r
   //\r
   // Disable Interrupt and save DXE IDT table\r
   //\r
@@ -147,48 +184,17 @@ DumpModuleInfoByIp (
   )\r
 {\r
   UINTN                                Pe32Data;\r
-  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
   VOID                                 *PdbPointer;\r
-  UINT64                               DumpIpAddress;\r
 \r
   //\r
   // Find Image Base\r
   //\r
-  Pe32Data = CallerIpAddress & ~(SIZE_4KB - 1);\r
-  while (Pe32Data != 0) {\r
-    DosHdr = (EFI_IMAGE_DOS_HEADER *) Pe32Data;\r
-    if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-      //\r
-      // DOS image header is present, so read the PE header after the DOS image header.\r
-      //\r
-      Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)(Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-      //\r
-      // Make sure PE header address does not overflow and is less than the initial address.\r
-      //\r
-      if (((UINTN)Hdr.Pe32 > Pe32Data) && ((UINTN)Hdr.Pe32 < CallerIpAddress)) {\r
-        if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
-          //\r
-          // It's PE image.\r
-          //\r
-          break;\r
-        }\r
-      }\r
-    }\r
-\r
-    //\r
-    // Not found the image base, check the previous aligned address\r
-    //\r
-    Pe32Data -= SIZE_4KB;\r
-  }\r
-\r
-  DumpIpAddress = CallerIpAddress;\r
-  DEBUG ((EFI_D_ERROR, "It is invoked from the instruction before IP(0x%lx)", DumpIpAddress));\r
-\r
+  Pe32Data = PeCoffSearchImageBase (CallerIpAddress);\r
   if (Pe32Data != 0) {\r
+    DEBUG ((DEBUG_ERROR, "It is invoked from the instruction before IP(0x%p)", (VOID *) CallerIpAddress));\r
     PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *) Pe32Data);\r
     if (PdbPointer != NULL) {\r
-      DEBUG ((EFI_D_ERROR, " in module (%a)", PdbPointer));\r
+      DEBUG ((DEBUG_ERROR, " in module (%a)\n", PdbPointer));\r
     }\r
   }\r
 }\r
@@ -331,7 +337,7 @@ SmmInitHandler (
   AsmWriteIdtr (&gcSmiIdtr);\r
   ApicId = GetApicId ();\r
 \r
-  ASSERT (mNumberOfCpus <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));\r
+  ASSERT (mNumberOfCpus <= mMaxNumberOfCpus);\r
 \r
   for (Index = 0; Index < mNumberOfCpus; Index++) {\r
     if (ApicId == (UINT32)gSmmCpuPrivate->ProcessorInfo[Index].ProcessorId) {\r
@@ -400,7 +406,7 @@ SmmRelocateBases (
   // Patch ASM code template with current CR0, CR3, and CR4 values\r
   //\r
   gSmmCr0 = (UINT32)AsmReadCr0 ();\r
-  gSmmCr3 = (UINT32)AsmReadCr3 ();\r
+  PatchInstructionX86 (gPatchSmmCr3, AsmReadCr3 (), 4);\r
   gSmmCr4 = (UINT32)AsmReadCr4 ();\r
 \r
   //\r
@@ -490,6 +496,11 @@ SmmReadyToLockEventNotify (
 {\r
   GetAcpiCpuData ();\r
 \r
+  //\r
+  // Cache a copy of UEFI memory map before we start profiling feature.\r
+  //\r
+  GetUefiMemoryMap ();\r
+\r
   //\r
   // Set SMM ready to lock flag and return\r
   //\r
@@ -531,6 +542,12 @@ PiCpuSmmEntry (
   UINTN                      ModelId;\r
   UINT32                     Cr3;\r
 \r
+  //\r
+  // Initialize address fixup\r
+  //\r
+  PiSmmCpuSmmInitFixupAddress ();\r
+  PiSmmCpuSmiEntryFixupAddress ();\r
+\r
   //\r
   // Initialize Debug Agent to support source level debug in SMM code\r
   //\r
@@ -586,6 +603,13 @@ PiCpuSmmEntry (
   mSmmCodeAccessCheckEnable = PcdGetBool (PcdCpuSmmCodeAccessCheckEnable);\r
   DEBUG ((EFI_D_INFO, "PcdCpuSmmCodeAccessCheckEnable = %d\n", mSmmCodeAccessCheckEnable));\r
 \r
+  //\r
+  // Save the PcdPteMemoryEncryptionAddressOrMask value into a global variable.\r
+  // Make sure AddressEncMask is contained to smallest supported address field.\r
+  //\r
+  mAddressEncMask = PcdGet64 (PcdPteMemoryEncryptionAddressOrMask) & PAGING_1G_ADDRESS_MASK_64;\r
+  DEBUG ((EFI_D_INFO, "mAddressEncMask = 0x%lx\n", mAddressEncMask));\r
+\r
   //\r
   // If support CPU hot plug, we need to allocate resources for possibly hot-added processors\r
   //\r
@@ -698,22 +722,23 @@ PiCpuSmmEntry (
 \r
   //\r
   // Compute tile size of buffer required to hold the CPU SMRAM Save State Map, extra CPU\r
-  // specific context in a PROCESSOR_SMM_DESCRIPTOR, and the SMI entry point.  This size\r
-  // is rounded up to nearest power of 2.\r
+  // specific context start starts at SMBASE + SMM_PSD_OFFSET, and the SMI entry point.\r
+  // This size is rounded up to nearest power of 2.\r
   //\r
   TileCodeSize = GetSmiHandlerSize ();\r
   TileCodeSize = ALIGN_VALUE(TileCodeSize, SIZE_4KB);\r
-  TileDataSize = sizeof (SMRAM_SAVE_STATE_MAP) + sizeof (PROCESSOR_SMM_DESCRIPTOR);\r
+  TileDataSize = (SMRAM_SAVE_STATE_MAP_OFFSET - SMM_PSD_OFFSET) + sizeof (SMRAM_SAVE_STATE_MAP);\r
   TileDataSize = ALIGN_VALUE(TileDataSize, SIZE_4KB);\r
   TileSize = TileDataSize + TileCodeSize - 1;\r
   TileSize = 2 * GetPowerOfTwo32 ((UINT32)TileSize);\r
   DEBUG ((EFI_D_INFO, "SMRAM TileSize = 0x%08x (0x%08x, 0x%08x)\n", TileSize, TileCodeSize, TileDataSize));\r
 \r
   //\r
-  // If the TileSize is larger than space available for the SMI Handler of CPU[i],\r
-  // the PROCESSOR_SMM_DESCRIPTOR of CPU[i+1] and the SMRAM Save State Map of CPU[i+1],\r
-  // the ASSERT().  If this ASSERT() is triggered, then the SMI Handler size must be\r
-  // reduced.\r
+  // If the TileSize is larger than space available for the SMI Handler of\r
+  // CPU[i], the extra CPU specific context of CPU[i+1], and the SMRAM Save\r
+  // State Map of CPU[i+1], then ASSERT().  If this ASSERT() is triggered, then\r
+  // the SMI Handler size must be reduced or the size of the extra CPU specific\r
+  // context must be reduced.\r
   //\r
   ASSERT (TileSize <= (SMRAM_SAVE_STATE_MAP_OFFSET + sizeof (SMRAM_SAVE_STATE_MAP) - SMM_HANDLER_OFFSET));\r
 \r
@@ -731,9 +756,9 @@ PiCpuSmmEntry (
   //\r
   BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));\r
   if ((FamilyId == 4) || (FamilyId == 5)) {\r
-    Buffer = AllocateAlignedPages (BufferPages, SIZE_32KB);\r
+    Buffer = AllocateAlignedCodePages (BufferPages, SIZE_32KB);\r
   } else {\r
-    Buffer = AllocateAlignedPages (BufferPages, SIZE_4KB);\r
+    Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);\r
   }\r
   ASSERT (Buffer != NULL);\r
   DEBUG ((EFI_D_INFO, "SMRAM SaveState Buffer (0x%08x, 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE(BufferPages)));\r
@@ -842,6 +867,8 @@ PiCpuSmmEntry (
   //\r
   SmmCpuFeaturesSmmRelocationComplete ();\r
 \r
+  DEBUG ((DEBUG_INFO, "mXdSupported - 0x%x\n", mXdSupported));\r
+\r
   //\r
   // SMM Time initialization\r
   //\r
@@ -881,6 +908,17 @@ PiCpuSmmEntry (
                     );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Install the SMM Memory Attribute Protocol into SMM protocol database\r
+  //\r
+  Status = gSmst->SmmInstallProtocolInterface (\r
+                    &mSmmCpuHandle,\r
+                    &gEdkiiSmmMemoryAttributeProtocolGuid,\r
+                    EFI_NATIVE_INTERFACE,\r
+                    &mSmmMemoryAttribute\r
+                    );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
   //\r
   // Expose address of CPU Hot Plug Data structure if CPU hot plug is supported.\r
   //\r
@@ -910,6 +948,7 @@ PiCpuSmmEntry (
   //\r
   InitSmmProfile (Cr3);\r
 \r
+  GetAcpiS3EnableFlag ();\r
   InitSmmS3ResumeState (Cr3);\r
 \r
   DEBUG ((EFI_D_INFO, "SMM CPU Module exit from SMRAM with EFI_SUCCESS\n"));\r
@@ -935,8 +974,6 @@ FindSmramInfo (
   UINTN                             Size;\r
   EFI_SMM_ACCESS2_PROTOCOL          *SmmAccess;\r
   EFI_SMRAM_DESCRIPTOR              *CurrentSmramRange;\r
-  EFI_SMRAM_DESCRIPTOR              *SmramRanges;\r
-  UINTN                             SmramRangeCount;\r
   UINTN                             Index;\r
   UINT64                            MaxSize;\r
   BOOLEAN                           Found;\r
@@ -954,31 +991,31 @@ FindSmramInfo (
   Status = SmmAccess->GetCapabilities (SmmAccess, &Size, NULL);\r
   ASSERT (Status == EFI_BUFFER_TOO_SMALL);\r
 \r
-  SmramRanges = (EFI_SMRAM_DESCRIPTOR *)AllocatePool (Size);\r
-  ASSERT (SmramRanges != NULL);\r
+  mSmmCpuSmramRanges = (EFI_SMRAM_DESCRIPTOR *)AllocatePool (Size);\r
+  ASSERT (mSmmCpuSmramRanges != NULL);\r
 \r
-  Status = SmmAccess->GetCapabilities (SmmAccess, &Size, SmramRanges);\r
+  Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmmCpuSmramRanges);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  SmramRangeCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR);\r
+  mSmmCpuSmramRangeCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR);\r
 \r
   //\r
   // Find the largest SMRAM range between 1MB and 4GB that is at least 256K - 4K in size\r
   //\r
   CurrentSmramRange = NULL;\r
-  for (Index = 0, MaxSize = SIZE_256KB - EFI_PAGE_SIZE; Index < SmramRangeCount; Index++) {\r
+  for (Index = 0, MaxSize = SIZE_256KB - EFI_PAGE_SIZE; Index < mSmmCpuSmramRangeCount; Index++) {\r
     //\r
     // Skip any SMRAM region that is already allocated, needs testing, or needs ECC initialization\r
     //\r
-    if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {\r
+    if ((mSmmCpuSmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {\r
       continue;\r
     }\r
 \r
-    if (SmramRanges[Index].CpuStart >= BASE_1MB) {\r
-      if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize) <= BASE_4GB) {\r
-        if (SmramRanges[Index].PhysicalSize >= MaxSize) {\r
-          MaxSize = SmramRanges[Index].PhysicalSize;\r
-          CurrentSmramRange = &SmramRanges[Index];\r
+    if (mSmmCpuSmramRanges[Index].CpuStart >= BASE_1MB) {\r
+      if ((mSmmCpuSmramRanges[Index].CpuStart + mSmmCpuSmramRanges[Index].PhysicalSize) <= SMRR_MAX_ADDRESS) {\r
+        if (mSmmCpuSmramRanges[Index].PhysicalSize >= MaxSize) {\r
+          MaxSize = mSmmCpuSmramRanges[Index].PhysicalSize;\r
+          CurrentSmramRange = &mSmmCpuSmramRanges[Index];\r
         }\r
       }\r
     }\r
@@ -991,13 +1028,14 @@ FindSmramInfo (
 \r
   do {\r
     Found = FALSE;\r
-    for (Index = 0; Index < SmramRangeCount; Index++) {\r
-      if (SmramRanges[Index].CpuStart < *SmrrBase && *SmrrBase == (SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize)) {\r
-        *SmrrBase = (UINT32)SmramRanges[Index].CpuStart;\r
-        *SmrrSize = (UINT32)(*SmrrSize + SmramRanges[Index].PhysicalSize);\r
+    for (Index = 0; Index < mSmmCpuSmramRangeCount; Index++) {\r
+      if (mSmmCpuSmramRanges[Index].CpuStart < *SmrrBase &&\r
+          *SmrrBase == (mSmmCpuSmramRanges[Index].CpuStart + mSmmCpuSmramRanges[Index].PhysicalSize)) {\r
+        *SmrrBase = (UINT32)mSmmCpuSmramRanges[Index].CpuStart;\r
+        *SmrrSize = (UINT32)(*SmrrSize + mSmmCpuSmramRanges[Index].PhysicalSize);\r
         Found = TRUE;\r
-      } else if ((*SmrrBase + *SmrrSize) == SmramRanges[Index].CpuStart && SmramRanges[Index].PhysicalSize > 0) {\r
-        *SmrrSize = (UINT32)(*SmrrSize + SmramRanges[Index].PhysicalSize);\r
+      } else if ((*SmrrBase + *SmrrSize) == mSmmCpuSmramRanges[Index].CpuStart && mSmmCpuSmramRanges[Index].PhysicalSize > 0) {\r
+        *SmrrSize = (UINT32)(*SmrrSize + mSmmCpuSmramRanges[Index].PhysicalSize);\r
         Found = TRUE;\r
       }\r
     }\r
@@ -1107,7 +1145,12 @@ ConfigSmmCodeAccessCheck (
   //\r
   for (Index = 0; Index < gSmst->NumberOfCpus; Index++) {\r
     if (Index != gSmmCpuPrivate->SmmCoreEntryContext.CurrentlyExecutingCpu) {\r
-\r
+      if (gSmmCpuPrivate->ProcessorInfo[Index].ProcessorId == INVALID_APIC_ID) {\r
+        //\r
+        // If this processor does not exist\r
+        //\r
+        continue;\r
+      }\r
       //\r
       // Acquire Config SMM Code Access Check spin lock.  The AP will release the\r
       // spin lock when it is done executing ConfigSmmCodeAccessCheckOnCurrentProcessor().\r
@@ -1164,6 +1207,109 @@ AllocatePageTableMemory (
   return AllocatePages (Pages);\r
 }\r
 \r
+/**\r
+  Allocate pages for code.\r
+\r
+  @param[in]  Pages Number of pages to be allocated.\r
+\r
+  @return Allocated memory.\r
+**/\r
+VOID *\r
+AllocateCodePages (\r
+  IN UINTN           Pages\r
+  )\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_PHYSICAL_ADDRESS  Memory;\r
+\r
+  if (Pages == 0) {\r
+    return NULL;\r
+  }\r
+\r
+  Status = gSmst->SmmAllocatePages (AllocateAnyPages, EfiRuntimeServicesCode, Pages, &Memory);\r
+  if (EFI_ERROR (Status)) {\r
+    return NULL;\r
+  }\r
+  return (VOID *) (UINTN) Memory;\r
+}\r
+\r
+/**\r
+  Allocate aligned pages for code.\r
+\r
+  @param[in]  Pages                 Number of pages to be allocated.\r
+  @param[in]  Alignment             The requested alignment of the allocation.\r
+                                    Must be a power of two.\r
+                                    If Alignment is zero, then byte alignment is used.\r
+\r
+  @return Allocated memory.\r
+**/\r
+VOID *\r
+AllocateAlignedCodePages (\r
+  IN UINTN            Pages,\r
+  IN UINTN            Alignment\r
+  )\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_PHYSICAL_ADDRESS  Memory;\r
+  UINTN                 AlignedMemory;\r
+  UINTN                 AlignmentMask;\r
+  UINTN                 UnalignedPages;\r
+  UINTN                 RealPages;\r
+\r
+  //\r
+  // Alignment must be a power of two or zero.\r
+  //\r
+  ASSERT ((Alignment & (Alignment - 1)) == 0);\r
+\r
+  if (Pages == 0) {\r
+    return NULL;\r
+  }\r
+  if (Alignment > EFI_PAGE_SIZE) {\r
+    //\r
+    // Calculate the total number of pages since alignment is larger than page size.\r
+    //\r
+    AlignmentMask  = Alignment - 1;\r
+    RealPages      = Pages + EFI_SIZE_TO_PAGES (Alignment);\r
+    //\r
+    // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.\r
+    //\r
+    ASSERT (RealPages > Pages);\r
+\r
+    Status         = gSmst->SmmAllocatePages (AllocateAnyPages, EfiRuntimeServicesCode, RealPages, &Memory);\r
+    if (EFI_ERROR (Status)) {\r
+      return NULL;\r
+    }\r
+    AlignedMemory  = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask;\r
+    UnalignedPages = EFI_SIZE_TO_PAGES (AlignedMemory - (UINTN) Memory);\r
+    if (UnalignedPages > 0) {\r
+      //\r
+      // Free first unaligned page(s).\r
+      //\r
+      Status = gSmst->SmmFreePages (Memory, UnalignedPages);\r
+      ASSERT_EFI_ERROR (Status);\r
+    }\r
+    Memory         = AlignedMemory + EFI_PAGES_TO_SIZE (Pages);\r
+    UnalignedPages = RealPages - Pages - UnalignedPages;\r
+    if (UnalignedPages > 0) {\r
+      //\r
+      // Free last unaligned page(s).\r
+      //\r
+      Status = gSmst->SmmFreePages (Memory, UnalignedPages);\r
+      ASSERT_EFI_ERROR (Status);\r
+    }\r
+  } else {\r
+    //\r
+    // Do not over-allocate pages in this case.\r
+    //\r
+    Status = gSmst->SmmAllocatePages (AllocateAnyPages, EfiRuntimeServicesCode, Pages, &Memory);\r
+    if (EFI_ERROR (Status)) {\r
+      return NULL;\r
+    }\r
+    AlignedMemory  = (UINTN) Memory;\r
+  }\r
+  return (VOID *) AlignedMemory;\r
+}\r
+\r
 /**\r
   Perform the remaining tasks.\r
 \r
@@ -1184,6 +1330,22 @@ PerformRemainingTasks (
     // Create a mix of 2MB and 4KB page table. Update some memory ranges absent and execute-disable.\r
     //\r
     InitPaging ();\r
+\r
+    //\r
+    // Mark critical region to be read-only in page table\r
+    //\r
+    SetMemMapAttributes ();\r
+\r
+    //\r
+    // For outside SMRAM, we only map SMM communication buffer or MMIO.\r
+    //\r
+    SetUefiMemMapAttributes ();\r
+\r
+    //\r
+    // Set page table itself to be read-only\r
+    //\r
+    SetPageTableAttributes ();\r
+\r
     //\r
     // Configure SMM Code Access Check feature if available.\r
     //\r