From patchwork Wed Nov 22 10:07:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119451 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6489440qgn; Wed, 22 Nov 2017 02:08:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMaVZ9N/VNr6H3LrWOv4JjRBQcDljp6RM732GOQ9BwVdv0qlGb1MlD7ewpNVzq8yoDMss05G X-Received: by 10.99.113.72 with SMTP id b8mr20392603pgn.42.1511345286507; Wed, 22 Nov 2017 02:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511345286; cv=none; d=google.com; s=arc-20160816; b=io+MOhrmZ/ysmwqbTFWtTLNYKHwX7rmKYJShDCUEKXBYBtTsED4iTbiHio5c+7yeFr A1QxzQdxyYyOuclJbvIjafP7avsSXDv8Cb77lCAsDOHxEL3wwSH7bKWXqvkmLbjfWAdO TAD3h3JGZaQZDqrRLzPT21Rs1bsZ9XC+qrrmVWO44hJkoFqK3JjkcV1IzJs7yMIMQg2r pUpFARph3agWC9rtW2QU7+flgbp77fDOIHe6BQs+1jKwrxyeHsaq8kDYJF20KczeN+vi U4nie48biSiqi5QP+S07DV0bPJrCy+zjhAlCuKrMR5IH9Y3q8jDQQHrqeaA5oHADUGv8 ZZoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=QUigfp/vur4tz4V6Ire43Wctlg8SJ7DjLlyZLwZ0wkA=; b=hYdClzZlUNQV6Hx0QPH2rjzj/s6Y2WN2V/M/2ayrcIrfR8noS8mLKuqn5Pq0SBH96a OqGmY6IVd7baF59i0xYt2QtIQTLv3MAJb4ZqudKhxr6QLKJx2dW5qPf5/gwCrSQZIfVN 31Zh90rZb3o9SQd/K2tcQJXPOmVJG8D/WHXIBQMkiC32QaaXlHyBhqFhW8tXwDMIid/x 4yT1DIi2cvsjH3qUtivmkI1yLUaMX6yPVVEaaEX2a7aSD4z1P8ldttVz8jpQBwsdIcUC UPvDR5yDECWEn6cxQyS0vVSmoXDqyJuGnJ7wrU8ZRVP50E+Pj2pzDWzHqTQIh7//M2U9 EKzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FYf7VMMm; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id g92si13051064plg.247.2017.11.22.02.08.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:08:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FYf7VMMm; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03F09220C1620; Wed, 22 Nov 2017 02:03:40 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9DCB6220C1602 for ; Wed, 22 Nov 2017 02:03:37 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id v186so8937700wma.2 for ; Wed, 22 Nov 2017 02:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NHtF2+GCWtVtkzfqVOpiEvrKV1Y+RYnjVrQ+7d4ZKFI=; b=FYf7VMMmpg6DeOLuMvY5Ib07EIubR0G6G9krvq4JsooY2iYC3hkD3PiS8qhzL02J4L emNXBmwxmfe3s1pla5RoGxjg9rqsi3OHpvnFmQXsDkE5TVbE0WUkBFJYh6O/QWFsJogg EJZKG3JOXQINjE7Fh83EzHzCoA+y/TvNmQy1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NHtF2+GCWtVtkzfqVOpiEvrKV1Y+RYnjVrQ+7d4ZKFI=; b=sq7/l4EdJwHkzG2ZAjXt+BhJ/M+yoqnlucK0WWXyTtwBNp2oglfxfZHgTqWO0g/P+8 4i6/ws/l5id80J/63nLzWI9Zn6VdiTTczbySwg7xpDG4795KZw+2pLJFEnzmmW0Dq4oq U29pXGmjvIG6pcodFgzDQ72a+d7VcGGlEdGwzpUkOn9ey3zDH1AsdHeltq+GpKI0Xkgw 5BbOlBkvNvA1WD+0cQ5uq9+AqvDs/4ZZkR7BB9cFpExkiYhRWHT9tgK/dNodjRF6diaB ZFq3uqcYVSF2SWDW/bXFipYiKEFUXROkiZVFyxQkdwmoZQFwLJBQgC+TubvmuCKYa1RQ Ch/Q== X-Gm-Message-State: AJaThX4xZHwK8xtoi1CAovdD5OJQk+PSVfI13e/nGWdO9TOFpx7VQ1Jc FRuZIgcD5k4bmPHu6jSndS1QxEnHPS0= X-Received: by 10.28.67.68 with SMTP id q65mr3364838wma.26.1511345272133; Wed, 22 Nov 2017 02:07:52 -0800 (PST) Received: from localhost.localdomain ([154.145.25.106]) by smtp.gmail.com with ESMTPSA id i192sm2761457wmf.46.2017.11.22.02.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:07:51 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 22 Nov 2017 10:07:25 +0000 Message-Id: <20171122100731.24525-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171122100731.24525-1-ard.biesheuvel@linaro.org> References: <20171122100731.24525-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 08/14] 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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 Reviewed-by: Laszlo Ersek --- ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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));