From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01B6C433B4 for ; Thu, 6 May 2021 13:28:19 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F3D061106 for ; Thu, 6 May 2021 13:28:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F3D061106 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SUrTG+IzpOg5QgzzZy/B7H5DjWvbht8xADP+UPTn1Xw=; b=l25L6fjfILkahmT1CJvUeq1Us qW/YswKNZ3ezP5TT4U+7vuCAPWjVb7UYIILdYv90DZuhq5HZ0VYjZiIVrZKqasRtR7hgU6L2RSJek QBwsyKEGjP2a2SlIyiCURdi80HyaSEQ93EcdoXWNiBQv17UGVUobO4m1PzYZaTa9Bzgl9RBvnwNCR u1GozvPfy7Igzeze86Qcnp2qTlPCZQP1U8l/wq1imajKF+RwFBDCnUT5vJoJGxDLQr3ZlVaSM0Zl9 4GFjOyW6B411pHdBMoYT7JuotQYhE0lzjyWh0iW/T2YrV7oCtNkJnmAcBX56FeOrHX666Be5BSRK1 qH01cCzlA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lee0T-004Jbz-FP; Thu, 06 May 2021 13:25:33 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lee0Q-004JbV-NN for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 13:25:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rp9bE/ulN1nXWciBw9AL5QAyEFXTFaEbqId2G2Xaqrw=; b=2XsV7ZmJmAcO0EdXvlF97K78i6 E5A6i0gY5rBBXQBQnns57bGc0mj7N05MjAw6QoxFQ/2o4U9iM70WGVVsDlKU0GmyBlzgbvxje21Hp eNdGohvD8VOHrALqaxDKFlkdrZiUUkpxVOk3DPocsY6hIEtakC+v1WZiv7e8feDuKmXVg/WAwxg6h djMY3pnwPblh+5QKlA1MzeHdeyZzm9VnsYMcd6PmF6kK26nR2PCqbc948iR1Avht/F06d8HfhyqC7 1t36qIOoXnL0J43pT8tZ+ZCQtlVwAiUSp6oZ1T5FIBqCKE5BHk1jVUA1w461TaeRdnoOttGlXYIUK OZy0Cdbw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lee0N-0063aw-Sv for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 13:25:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F768613E3; Thu, 6 May 2021 13:25:26 +0000 (UTC) Date: Thu, 6 May 2021 14:25:23 +0100 From: Catalin Marinas To: Ard Biesheuvel Cc: Will Deacon , Linux ARM , Christoph Hellwig , Lorenzo Pieralisi Subject: Re: [PATCH 2/3] arm64: acpi: Map EFI_MEMORY_WT memory as Normal-NC Message-ID: <20210506132522.GC22164@arm.com> References: <20210506095034.15246-1-will@kernel.org> <20210506095034.15246-3-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_062527_991202_1544AB70 X-CRM114-Status: GOOD ( 21.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 06, 2021 at 12:14:55PM +0200, Ard Biesheuvel wrote: > On Thu, 6 May 2021 at 11:50, Will Deacon wrote: > > > > The only user we have of Normal Write-Through memory is in the ACPI code > > when mapping memory regions advertised as EFI_MEMORY_WT. Since most (all?) > > CPUs treat write-through as non-cacheable under the hood, don't bother > > with the extra memory type here and just treat EFI_MEMORY_WT the same way > > as EFI_MEMORY_WC by mapping it to the Normal-NC memory type instead. > > > > Cc: Ard Biesheuvel > > Cc: Lorenzo Pieralisi > > Cc: Christoph Hellwig > > Signed-off-by: Will Deacon > > I don't have any objections to this change per se, but I will point > out that the UEFI spec describes the MAIR encodings, paragraph 2.3.6.1 > (in revision 2.8B). However, the paragraph in question provides no > context whatsoever, and so it is not clear whether it is normative, > and whether it applies to the boot time firmware only or to the OS as > well. > > So in summary, given that EFI_MEMORY_WT (which I have never seen being > used on ARM) should behave as expected when using the same MAIR > attributes as EFI_MEMORY_WC, with only a theoretical performance > impact, the change looks reasonable to me. In theory there's a slight difference between WT and WC/Normal-NC as reads are allowed to hit into the cache while for WC/Normal-NC they aren't (somehow implied on page B2-168 in the ARMv8 ARM G.a). Whether they must hit in the cache is not entirely clear, I don't think they have to. The mismatched aliases section doesn't guarantee coherency between accesses using different WC and WB attributes (point 1, attributes must be the same for both reads and writes). Appendix K4.1.1 also suggest that WT could be implemented as Normal-NC. So I don't think EFI can rely on any specific WT behaviour other than maybe slightly better performance. So: Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel