From patchwork Fri Aug 19 12:49:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 74249 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp295804qga; Fri, 19 Aug 2016 05:50:24 -0700 (PDT) X-Received: by 10.66.183.80 with SMTP id ek16mr13359537pac.21.1471611007234; Fri, 19 Aug 2016 05:50:07 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id b1si5003930pfk.262.2016.08.19.05.50.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 05:50:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AE5EB1A1E3D; Fri, 19 Aug 2016 05:49:59 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.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 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 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: [edk2] [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: , Cc: Jordan Justen , Ard Biesheuvel Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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=66 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(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel 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. # gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007 [PcdsFeatureFlag] # - # "Map PCI MMIO as Cached" - # - # Due to the way Stage1 and Stage2 mappings are combined on Aarch64, and - # because KVM -- for the time being -- does not try to interfere with the - # Stage1 mappings, we must not set EFI_MEMORY_UC for emulated PCI MMIO - # regions. - # - # EFI_MEMORY_UC is mapped to Device-nGnRnE, and that Stage1 attribute would - # direct guest writes to host DRAM immediately, bypassing the cache - # regardless of Stage2 attributes. However, QEMU's reads of the same range - # can easily be served from the (stale) CPU cache. - # - # Setting this PCD to TRUE will use EFI_MEMORY_WB for mapping PCI MMIO - # regions, which ensures that guest writes to such regions go through the CPU - # cache. Strictly speaking this is wrong, but it is needed as a temporary - # workaround for emulated PCI devices. Setting the PCD to FALSE results in - # the theoretically correct EFI_MEMORY_UC mapping, and should be the long - # term choice, especially with assigned devices. - # - # The default is to turn off the kludge; DSC's can selectively enable it. - # - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|FALSE|BOOLEAN|0x00000006 - - # # Pure ACPI boot # # Inhibit installation of the FDT as a configuration table if this feature # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI # description of the platform, and it is up to the OS to choose. # 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] ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe. # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE - # Activate KVM workaround for now. - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE - !if $(PURE_ACPI_BOOT_ENABLE) == TRUE gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE !endif [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index d9e62c78d28e..99d2feba202b 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -98,15 +98,12 @@ [PcdsFeatureFlag.common] ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe. # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE - # Activate KVM workaround for now. - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE - [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 !if $(ARCH) == AARCH64 gArmTokenSpaceGuid.PcdVFPEnabled|1 !endif 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 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress [FeaturePcd] - gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached gArmVirtTokenSpaceGuid.PcdPureAcpiBoot [depex] gEfiMetronomeArchProtocolGuid AND gEfiCpuArchProtocolGuid AND gFdtClientProtocolGuid diff --git a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c b/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c index 4b2b6a562a3f..5063782bb392 100644 --- a/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c +++ b/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c @@ -362,14 +362,13 @@ InitializePciHostBridge ( EfiGcdIoTypeIo, IoBase, IoSize ); ASSERT_EFI_ERROR (Status); - MmioAttributes = FeaturePcdGet (PcdKludgeMapPciMmioAsCached) ? - EFI_MEMORY_WB : EFI_MEMORY_UC; + MmioAttributes = EFI_MEMORY_UC; Status = gDS->AddMemorySpace ( EfiGcdMemoryTypeMemoryMappedIo, MmioBase, MmioSize, MmioAttributes