From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F318F1A1E25 for ; Fri, 19 Aug 2016 05:49:56 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86498635F3; Fri, 19 Aug 2016 12:49:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-13.phx2.redhat.com [10.3.116.13]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7JCnaSq011583; Fri, 19 Aug 2016 08:49:55 -0400 From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen Date: Fri, 19 Aug 2016 14:49:32 +0200 Message-Id: <20160819124932.29711-12-lersek@redhat.com> In-Reply-To: <20160819124932.29711-1-lersek@redhat.com> References: <20160819124932.29711-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 19 Aug 2016 12:49:56 +0000 (UTC) Subject: [PATCH 11/11] ArmVirtPkg: remove PcdKludgeMapPciMmioAsCached X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 12:49:57 -0000 Content-Transfer-Encoding: quoted-printable In ARM/AARCH64 guests that run on KVM, we can now use virtio-gpu-pci, so PcdKludgeMapPciMmioAsCached is no longer necessary. Standard VGA continues to work on TCG without the kludge. Cc: Ard Biesheuvel Cc: Jordan Justen Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=3D66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtPkg.dec | 24 -------------------- ArmVirtPkg/ArmVirtQemu.dsc | 3 --- ArmVirtPkg/ArmVirtQemuKernel.dsc | 3 --- ArmVirtPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf | 1 - ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c | 3 +-- 5 files changed, 1 insertion(+), 33 deletions(-) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index 9f98f28f01e1..a5ec42166445 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,36 +58,12 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # EFI_VT_100_GUID.=0D #=0D gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF= , 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|V= OID*|0x00000007=0D =0D [PcdsFeatureFlag]=0D #=0D - # "Map PCI MMIO as Cached"=0D - #=0D - # Due to the way Stage1 and Stage2 mappings are combined on Aarch64, and= =0D - # because KVM -- for the time being -- does not try to interfere with th= e=0D - # Stage1 mappings, we must not set EFI_MEMORY_UC for emulated PCI MMIO=0D - # regions.=0D - #=0D - # EFI_MEMORY_UC is mapped to Device-nGnRnE, and that Stage1 attribute wo= uld=0D - # direct guest writes to host DRAM immediately, bypassing the cache=0D - # regardless of Stage2 attributes. However, QEMU's reads of the same ran= ge=0D - # can easily be served from the (stale) CPU cache.=0D - #=0D - # Setting this PCD to TRUE will use EFI_MEMORY_WB for mapping PCI MMIO=0D - # regions, which ensures that guest writes to such regions go through th= e CPU=0D - # cache. Strictly speaking this is wrong, but it is needed as a temporar= y=0D - # workaround for emulated PCI devices. Setting the PCD to FALSE results = in=0D - # the theoretically correct EFI_MEMORY_UC mapping, and should be the lon= g=0D - # term choice, especially with assigned devices.=0D - #=0D - # The default is to turn off the kludge; DSC's can selectively enable it= .=0D - #=0D - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|FALSE|BOOLEAN|0x00000= 006=0D -=0D - #=0D # Pure ACPI boot=0D #=0D # Inhibit installation of the FDT as a configuration table if this featu= re=0D # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI= =0D # description of the platform, and it is up to the OS to choose.=0D #=0D diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 2eb2780a1fca..1d459756f61b 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -97,15 +97,12 @@ [PcdsFeatureFlag.common] =0D ## If TRUE, Graphics Output Protocol will be installed on virtual handle= created by ConsplitterDxe.=0D # It could be set FALSE to save size.=0D gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE=0D gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE=0D =0D - # Activate KVM workaround for now.=0D - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE=0D -=0D !if $(PURE_ACPI_BOOT_ENABLE) =3D=3D TRUE=0D gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE=0D !endif=0D =0D [PcdsFixedAtBuild.common]=0D gArmPlatformTokenSpaceGuid.PcdCoreCount|1=0D diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index d9e62c78d28e..99d2feba202b 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -98,15 +98,12 @@ [PcdsFeatureFlag.common] =0D ## If TRUE, Graphics Output Protocol will be installed on virtual handle= created by ConsplitterDxe.=0D # It could be set FALSE to save size.=0D gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE=0D gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE=0D =0D - # Activate KVM workaround for now.=0D - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE=0D -=0D [PcdsFixedAtBuild.common]=0D gArmPlatformTokenSpaceGuid.PcdCoreCount|1=0D !if $(ARCH) =3D=3D AARCH64=0D gArmTokenSpaceGuid.PcdVFPEnabled|1=0D !endif=0D =0D diff --git a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf b/ArmVirtPkg/= PciHostBridgeDxe/PciHostBridgeDxe.inf index 41e134b24b0e..8c75eda3deb5 100644 --- a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf +++ b/ArmVirtPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf @@ -53,13 +53,12 @@ [Protocols] gFdtClientProtocolGuid ## CONSUMES=0D =0D [Pcd]=0D gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress=0D =0D [FeaturePcd]=0D - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached=0D gArmVirtTokenSpaceGuid.PcdPureAcpiBoot=0D =0D [depex]=0D gEfiMetronomeArchProtocolGuid AND=0D gEfiCpuArchProtocolGuid AND=0D gFdtClientProtocolGuid=0D diff --git a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c b/ArmVirtPkg/PciHo= stBridgeDxe/PciHostBridge.c index 4b2b6a562a3f..5063782bb392 100644 --- a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c +++ b/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c @@ -362,14 +362,13 @@ InitializePciHostBridge ( EfiGcdIoTypeIo,=0D IoBase,=0D IoSize=0D );=0D ASSERT_EFI_ERROR (Status);=0D =0D - MmioAttributes =3D FeaturePcdGet (PcdKludgeMapPciMmioAsCached) ?=0D - EFI_MEMORY_WB : EFI_MEMORY_UC;=0D + MmioAttributes =3D EFI_MEMORY_UC;=0D =0D Status =3D gDS->AddMemorySpace (=0D EfiGcdMemoryTypeMemoryMappedIo,=0D MmioBase,=0D MmioSize,=0D MmioAttributes=0D --=20 2.9.2