]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe: remove VirtualUncachedPages protocol and implementation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 23 Feb 2017 14:43:49 +0000 (14:43 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 23 Feb 2017 17:57:55 +0000 (17:57 +0000)
Virtual uncached pages are simply pages that are aliased using mismatched
attributes, which is not allowed by the ARM architecture. So remove the
protocol and its implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/ArmPkg.dec
ArmPkg/Drivers/CpuDxe/CpuDxe.c
ArmPkg/Drivers/CpuDxe/CpuDxe.h
ArmPkg/Drivers/CpuDxe/CpuDxe.inf
ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
ArmPkg/Include/Protocol/VirtualUncachedPages.h [deleted file]

index 8e9cf199becc65a9f6fe08e2d5b216bc2af4c31d..4fd7a5be51584eb984e7cf970108f572ff661716 100644 (file)
@@ -52,9 +52,6 @@
   ## Include/Ppi/ArmMpCoreInfo.h\r
   gArmMpCoreInfoPpiGuid = { 0x6847cc74, 0xe9ec, 0x4f8f, {0xa2, 0x9d, 0xab, 0x44, 0xe7, 0x54, 0xa8, 0xfc} }\r
 \r
   ## Include/Ppi/ArmMpCoreInfo.h\r
   gArmMpCoreInfoPpiGuid = { 0x6847cc74, 0xe9ec, 0x4f8f, {0xa2, 0x9d, 0xab, 0x44, 0xe7, 0x54, 0xa8, 0xfc} }\r
 \r
-[Protocols.common]\r
-  gVirtualUncachedPagesProtocolGuid = { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }\r
-\r
 [PcdsFeatureFlag.common]\r
   gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE|BOOLEAN|0x00000001\r
 \r
 [PcdsFeatureFlag.common]\r
   gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE|BOOLEAN|0x00000001\r
 \r
index 7d328d096b1e498567d3b9e59775a39f645d933a..5aa5b874144ac08ac80da3503fe4756d832b6ba1 100644 (file)
@@ -253,7 +253,6 @@ CpuDxeInitialize (
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                 &mCpuHandle,\r
                 &gEfiCpuArchProtocolGuid,           &mCpu,\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                 &mCpuHandle,\r
                 &gEfiCpuArchProtocolGuid,           &mCpu,\r
-                &gVirtualUncachedPagesProtocolGuid, &gVirtualUncachedPages,\r
                 NULL\r
                 );\r
 \r
                 NULL\r
                 );\r
 \r
index 80c305d53dd124394590dfa21a69e64f6c46b527..a00fc3064362de158fb757ab498087218a302889 100644 (file)
@@ -35,7 +35,6 @@
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DebugSupport.h>\r
 #include <Protocol/DebugSupportPeriodicCallback.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DebugSupport.h>\r
 #include <Protocol/DebugSupportPeriodicCallback.h>\r
-#include <Protocol/VirtualUncachedPages.h>\r
 #include <Protocol/LoadedImage.h>\r
 \r
 \r
 #include <Protocol/LoadedImage.h>\r
 \r
 \r
@@ -169,6 +168,4 @@ SetGcdMemorySpaceAttributes (
   IN UINT64                              Attributes\r
   );\r
 \r
   IN UINT64                              Attributes\r
   );\r
 \r
-extern VIRTUAL_UNCACHED_PAGES_PROTOCOL  gVirtualUncachedPages;\r
-\r
 #endif // __CPU_DXE_ARM_EXCEPTION_H__\r
 #endif // __CPU_DXE_ARM_EXCEPTION_H__\r
index b31c994f43e28e4649ff8d9b8210f2a3410a0a0e..d068e06803ed0239dbd02e80ba6c562f8736ad7f 100644 (file)
@@ -61,7 +61,6 @@
 [Protocols]\r
   gEfiCpuArchProtocolGuid\r
   gEfiDebugSupportPeriodicCallbackProtocolGuid\r
 [Protocols]\r
   gEfiCpuArchProtocolGuid\r
   gEfiDebugSupportPeriodicCallbackProtocolGuid\r
-  gVirtualUncachedPagesProtocolGuid\r
 \r
 [Guids]\r
   gEfiDebugImageInfoTableGuid\r
 \r
 [Guids]\r
   gEfiDebugImageInfoTableGuid\r
index 54d9b016333107be81fa07c6fb01996bb0652c07..ebe593d1c325d9e70dfba18e7a078371219b2561 100644 (file)
@@ -211,73 +211,3 @@ CpuSetMemoryAttributes (
     return EFI_SUCCESS;\r
   }\r
 }\r
     return EFI_SUCCESS;\r
   }\r
 }\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuConvertPagesToUncachedVirtualAddress (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL  *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  OUT UINT64                           *Attributes     OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;\r
-\r
-  if (Attributes != NULL) {\r
-    Status = gDS->GetMemorySpaceDescriptor (Address, &GcdDescriptor);\r
-    if (!EFI_ERROR (Status)) {\r
-      *Attributes = GcdDescriptor.Attributes;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Make this address range page fault if accessed. If it is a DMA buffer than this would\r
-  // be the PCI address. Code should always use the CPU address, and we will or in VirtualMask\r
-  // to that address.\r
-  //\r
-  Status = SetMemoryAttributes (Address, Length, EFI_MEMORY_RO, 0);\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_UC, VirtualMask);\r
-  }\r
-\r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuConvertPagesToUncachedVirtualAddress()\n    Unmapped 0x%08lx Mapped 0x%08lx 0x%x bytes\n", Address, Address | VirtualMask, Length));\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuReconvertPages (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL  *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  IN  UINT64                            Attributes\r
-  )\r
-{\r
-  EFI_STATUS      Status;\r
-\r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuReconvertPages(%lx, %x, %lx, %lx)\n", Address, Length, VirtualMask, Attributes));\r
-\r
-  //\r
-  // Unmap the aliased Address\r
-  //\r
-  Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_RO, 0);\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Restore atttributes\r
-    //\r
-    Status = SetMemoryAttributes (Address, Length, Attributes, 0);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-VIRTUAL_UNCACHED_PAGES_PROTOCOL  gVirtualUncachedPages = {\r
-  CpuConvertPagesToUncachedVirtualAddress,\r
-  CpuReconvertPages\r
-};\r
diff --git a/ArmPkg/Include/Protocol/VirtualUncachedPages.h b/ArmPkg/Include/Protocol/VirtualUncachedPages.h
deleted file mode 100644 (file)
index 0822184..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008 - 2010, Apple Inc. 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
-  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
-#ifndef __VIRTUAL_UNCACHED_PAGES_ROTOCOL_H__\r
-#define __VIRTUAL_UNCACHED_PAGES_ROTOCOL_H__\r
-\r
-//\r
-// Protocol GUID\r
-//\r
-#define VIRTUAL_UNCACHED_PAGES_PROTOCOL_GUID { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }\r
-\r
-\r
-\r
-//\r
-// Protocol interface structure\r
-//\r
-typedef struct _VIRTUAL_UNCACHED_PAGES_PROTOCOL  VIRTUAL_UNCACHED_PAGES_PROTOCOL;\r
-\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *CONVERT_PAGES_TO_UNCACHED_VIRTUAL_ADDRESS) (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL   *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  OUT UINT64                            *Attributes     OPTIONAL\r
-  );\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *FREE_CONVERTED_PAGES) (\r
-  IN  VIRTUAL_UNCACHED_PAGES_PROTOCOL   *This,\r
-  IN  EFI_PHYSICAL_ADDRESS              Address,\r
-  IN  UINTN                             Length,\r
-  IN  EFI_PHYSICAL_ADDRESS              VirtualMask,\r
-  IN  UINT64                            Attributes\r
-  );\r
-\r
-\r
-\r
-struct _VIRTUAL_UNCACHED_PAGES_PROTOCOL {\r
-  CONVERT_PAGES_TO_UNCACHED_VIRTUAL_ADDRESS  ConvertPages;\r
-  FREE_CONVERTED_PAGES                       RevertPages;\r
-};\r
-\r
-extern EFI_GUID gVirtualUncachedPagesProtocolGuid;\r
-\r
-#endif\r