]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 17 Nov 2017 13:33:15 +0000 (13:33 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 23 Nov 2017 16:05:04 +0000 (16:05 +0000)
QEMU/KVM has very little tolerance for using anything except writeback
cacheable mappings of DRAM, so let's remove the 'feature' that allows
us to select uncached mappings at build time.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c

index d10548f86dfc2f85b7962eb1d7f5b1c175fa18c2..4368d05f76efddd96778b41543188cba318a53c1 100644 (file)
 // Number of Virtual Memory Map Descriptors\r
 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS          5\r
 \r
-// DDR attributes\r
-#define DDR_ATTRIBUTES_CACHED    ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK\r
-#define DDR_ATTRIBUTES_UNCACHED  ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED\r
-\r
 EFI_PHYSICAL_ADDRESS\r
 ArmGetPhysAddrTop (\r
   VOID\r
@@ -48,7 +44,6 @@ ArmPlatformGetVirtualMemoryMap (
   IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap\r
   )\r
 {\r
-  ARM_MEMORY_REGION_ATTRIBUTES  CacheAttributes;\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
 \r
   ASSERT (VirtualMemoryMap != NULL);\r
@@ -65,17 +60,11 @@ ArmPlatformGetVirtualMemoryMap (
     return;\r
   }\r
 \r
-  if (FeaturePcdGet (PcdCacheEnable) == TRUE) {\r
-    CacheAttributes = DDR_ATTRIBUTES_CACHED;\r
-  } else {\r
-    CacheAttributes = DDR_ATTRIBUTES_UNCACHED;\r
-  }\r
-\r
   // System DRAM\r
   VirtualMemoryTable[0].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);\r
   VirtualMemoryTable[0].VirtualBase  = VirtualMemoryTable[0].PhysicalBase;\r
   VirtualMemoryTable[0].Length       = PcdGet64 (PcdSystemMemorySize);\r
-  VirtualMemoryTable[0].Attributes   = CacheAttributes;\r
+  VirtualMemoryTable[0].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;\r
 \r
   DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n"\r
       "\tPhysicalBase: 0x%lX\n"\r
@@ -104,7 +93,7 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[3].PhysicalBase = FixedPcdGet64 (PcdFdBaseAddress);\r
   VirtualMemoryTable[3].VirtualBase  = VirtualMemoryTable[3].PhysicalBase;\r
   VirtualMemoryTable[3].Length       = FixedPcdGet32 (PcdFdSize);\r
-  VirtualMemoryTable[3].Attributes   = CacheAttributes;\r
+  VirtualMemoryTable[3].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;\r
 \r
   // End of Table\r
   ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR));\r