From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B84A21B00DD4 for ; Tue, 21 Nov 2017 08:11:36 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83DA66197E; Tue, 21 Nov 2017 16:15:51 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-145.rdu2.redhat.com [10.10.120.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFEA417A70; Tue, 21 Nov 2017 16:15:50 +0000 (UTC) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> <20171117160913.17292-10-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: <13c4f39e-0156-b753-aee6-539fdc062c98@redhat.com> Date: Tue, 21 Nov 2017 17:15:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171117160913.17292-10-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 21 Nov 2017 16:15:51 +0000 (UTC) Subject: Re: [PATCH 09/15] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 16:11:36 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/17/17 17:09, Ard Biesheuvel wrote: > 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 > --- > ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c > index d10548f86dfc..4368d05f76ef 100644 > --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c > +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c > @@ -22,10 +22,6 @@ > // Number of Virtual Memory Map Descriptors > #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 > > -// DDR attributes > -#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK > -#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED > - > EFI_PHYSICAL_ADDRESS > ArmGetPhysAddrTop ( > VOID > @@ -48,7 +44,6 @@ ArmPlatformGetVirtualMemoryMap ( > IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap > ) > { > - ARM_MEMORY_REGION_ATTRIBUTES CacheAttributes; > ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; > > ASSERT (VirtualMemoryMap != NULL); > @@ -65,17 +60,11 @@ ArmPlatformGetVirtualMemoryMap ( > return; > } > > - if (FeaturePcdGet (PcdCacheEnable) == TRUE) { > - CacheAttributes = DDR_ATTRIBUTES_CACHED; > - } else { > - CacheAttributes = DDR_ATTRIBUTES_UNCACHED; > - } > - > // System DRAM > VirtualMemoryTable[0].PhysicalBase = PcdGet64 (PcdSystemMemoryBase); > VirtualMemoryTable[0].VirtualBase = VirtualMemoryTable[0].PhysicalBase; > VirtualMemoryTable[0].Length = PcdGet64 (PcdSystemMemorySize); > - VirtualMemoryTable[0].Attributes = CacheAttributes; > + VirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; > > DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n" > "\tPhysicalBase: 0x%lX\n" > @@ -104,7 +93,7 @@ ArmPlatformGetVirtualMemoryMap ( > VirtualMemoryTable[3].PhysicalBase = FixedPcdGet64 (PcdFdBaseAddress); > VirtualMemoryTable[3].VirtualBase = VirtualMemoryTable[3].PhysicalBase; > VirtualMemoryTable[3].Length = FixedPcdGet32 (PcdFdSize); > - VirtualMemoryTable[3].Attributes = CacheAttributes; > + VirtualMemoryTable[3].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; > > // End of Table > ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); > Looks OK. I see that PcdCacheEnable is removed from -- or, well, "with" -- all the affected INF files in the last patch. I also see that the EmbeddedPkg default for the PCD is FALSE. So it likely makes sense to keep our TRUE default in "ArmVirt.dsc.inc", for any other (external) modules that depend on the PCD. Reviewed-by: Laszlo Ersek