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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 E26F7C43460 for ; Thu, 6 May 2021 17:47:56 +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 39E1561107 for ; Thu, 6 May 2021 17:47:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39E1561107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gjewrXgd7pP0+wzmgaN+KZxM0Xd5ETlolcFC3u42z3g=; b=YNMo9Xlj8uLwQDTflkqrGZhdF qOWJE/CwQWETGlkNQ0InRWNHKvFMvLeNPuEBhqXJRMK4vsKJkzWMdiWn2Gmu17QmEihlYhAc4iotn DK/r8QruW5PJ8nF9Wcflq4oYZn+td2IQilFSWzVpdHRLARX/7l9y/BTg2Wr/GJc/HOUrfzYXSXbvK Lom9n8HoY+OHox9xSunHELdfatw2omGrqdp/LIXSTS/RFra3vqMNcF+3alHzRKLQeY+N3smzEUkeO EFkFsqI5BACBJF9vz+PZtPT7Tv4IjLfUjwwp1gge+Hr24UBmfDLr7y3VvqzWnx4KFOV1vq+3mr7/q uEmDcRpPQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lei47-004xgk-9Z; Thu, 06 May 2021 17:45:35 +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 1lei44-004xf3-6U for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 17:45:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cIVxvt4DyY0ZEJsm5WRXnudbkK4BA9Zowq90uTETqS8=; b=vkIgKl6zkxETnPQO8NY4giZonF NPS2FyAAPr34CSU0JzcZeebbJydQWguaFRjpzxnYsakOonxzHuFKvVwZ5JuApT/P0QJM0JNAVgLIU /ALJJxlw8NkG4ZnghWxLFdXIz+wEfOUcgFyohyUzQOEpjkF7OZhXsVlI8/BXO44niO/k2PSTVKKhF 69Zy/lk0A+ztmcNJea7mCdEHl3Y0+auEx2Dgfi+3d/LA3psKbUDCRd+GhzouDjeYIzElAIVltWvp1 JLDxaqSfjy7w+6xEERXodef5BiVnKQtPRh+FwxqVmwSC8S6s3DNjNo5e4k17vb/chi+u8oZLjyWM1 WusAFOTA==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lei41-006GLx-Hj for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 17:45:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A5ED610D2 for ; Thu, 6 May 2021 17:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620323129; bh=cIVxvt4DyY0ZEJsm5WRXnudbkK4BA9Zowq90uTETqS8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AAOnovd0JXMmVGx8X54asB3rqEF1Su8CYbOcnwaTwxuasMIPaRzMsTSuXESZvLv05 zQpT8C7pCgOkJHBsPJGeUKgnebdQLMy47UqmabdpuhGnsuWPty3ZqrIGZVRluW1E+w ConCt7R02E57iZWJW/sqa+96wLhYIksjJOv+QLSB/dy5JZ+nSmeD4ofkwhHp26EA8I jLusPYxA5GZ0F8IKA+cKRjIOv64s7zimXWrXXbun23DAMPxFs3jR+UITqM6f9ew3RQ k6iwV9QOZd2b5o+l6y9/JA/IeLJPK4ccyB1os3e65Qc54/WxF8Fk5OqQ5/gO4X6Rxm TmYQrNBFkoB7Q== Received: by mail-ot1-f47.google.com with SMTP id u25-20020a0568302319b02902ac3d54c25eso5624694ote.1 for ; Thu, 06 May 2021 10:45:29 -0700 (PDT) X-Gm-Message-State: AOAM5337ZSGwOeCIJbZsT5fLs8I/Nc2plyvCigDQg5Z9oYj4vFjevvFg 5i97AnAarUbhUi5zCwDMmS4EQXa6xyqLZsvSpEM= X-Google-Smtp-Source: ABdhPJxR++E2JEXXrQ1beQF9QKfXuQNictRHeKnv+g0U/5Y9lRHQJMoglBsbfm80MoECAhjmKWWSkoU2E0XXbwm0eGI= X-Received: by 2002:a9d:69c5:: with SMTP id v5mr4610986oto.108.1620323128397; Thu, 06 May 2021 10:45:28 -0700 (PDT) MIME-Version: 1.0 References: <20210506095034.15246-1-will@kernel.org> <20210506095034.15246-3-will@kernel.org> <20210506132522.GC22164@arm.com> In-Reply-To: <20210506132522.GC22164@arm.com> From: Ard Biesheuvel Date: Thu, 6 May 2021 19:45:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] arm64: acpi: Map EFI_MEMORY_WT memory as Normal-NC To: Catalin Marinas Cc: Will Deacon , Linux ARM , Christoph Hellwig , Lorenzo Pieralisi X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_104529_673090_56E4C531 X-CRM114-Status: GOOD ( 27.88 ) 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, 6 May 2021 at 15:25, Catalin Marinas wrote: > > 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. > For the record, this mostly affects mappings created by the ACPI core, for things like RAS handling in firmware. EFI itself is not really a part of this, but given that ACPI lacks any way to annotate memory types for OpRegions (as x86 does not need this), we cross reference ACPI memory map requests with the EFI memory map to infer the right type. For RAS in particular, I can see how firmware might rely on non-cacheable behavior for correctness (e.g., for publishing error records in a way that ensures they are visible to other agents, such as a BMC), but I still don't think treating WT as WC will make a material difference here. > 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