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=-4.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 36249C433B4 for ; Thu, 6 May 2021 11:32:48 +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 7606461157 for ; Thu, 6 May 2021 11:32:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7606461157 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=Vmj9//sOdhaIkSKusYcYJuFJc5F5bhYDUQxZ0e84cAA=; b=RAaGbugZxgG8efy72wDn++tbr 3ocJNISJxWcihqnWllvZIcOiDb/UUaulqxi6OOTHWRwdDn2eAIzuOUck+1uDMe+a4P/CsGfUWTq6J 5++9ytyArIE+yJ265+bwiQJUfFuO00wgX4DhWhsf+T4szQs2QyTTAzlwW314TF9NpRlmhZObA7HHp GAZZcPArWdPGruX9AP3E23zspIYQhe8EFDbaFSNid6p4gQsvdJfTznmQV5CfmhddGFbB8Du6v1tSh OQlhBaPYsZFm2kXK4FcHeLLIywC085vJKii5pv2/is6H60uAw5jnyDkyXQvF177OpbIz7kRmwL7wj RyZtYL46w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lecDK-0048H9-1T; Thu, 06 May 2021 11:30:42 +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 1lecDE-0048Gi-Ek for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 11:30:36 +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=+LMw1uRe1iWYnp8dEIwS6QFdNrxbb4lNTpr9AnJ3xqg=; b=2/ym9cvMDgVr7WXfgnyixAnrEO KlHZNLY22w27WqMaiFxTWdV8c4q4tNMQgiJUzX+Jyz3HKBd+rI+M2ex1un5VuuD+r+WLwDP089+2y CF/yUitEuXrp+t3EeWnjZeyKH32bZyzGwnXTp+wGgWPVr/NUnSCWBk0jGmt65Y2xOvu0Ly8c/CSYR s30HBW0q18MQrJVMmfolnrgmOYgnqB5Y9IscGgL3bCt8rJW0seZiuj9w0K94sQ0uB+DE2ZISBC2aM zp1Cu1n67fcxMdu/QNzCIrhAL9d0xqQVcJnYmlpCye/3Cjlp6EnCsR1C6shVsO1q5aaENS8ZjJopC RDDXOnlw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lecDB-005zLA-Jf for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 11:30:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11434613E6 for ; Thu, 6 May 2021 11:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620300633; bh=lfGsg00RtaRvrFEcz802XsvoiXhiat/o28h7RXHgpFc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SIqQcYmIYDqVqgomZBvaCYBN7ruwXsOYxBVhg6nw1zb/Jkz5MRnoc0PnIIgn+bnoi BWhP4qaVtttaAeq+zjNmlZfXfu2yADugz6O4crTvunb+wbG5+JTjvol/0flvnBzHx1 I18VzJuXLvw6uPh/vZhk0uLCMR6UQbtZr5a0n/CPUrLeEz5/Cxt8sf+5GdBDF3Vxrs Vu2PWy8/5sswqlF8mZQ41TYptVTZ92N8AY3+qsxSwjKByJN7bDuJn4OYkLZik5nlJl MYB/mUxTUZ9Pfdbiey/pkgPE7IJ0Y1v1LdqpclJNvnimia3t1R5QzyzSVoGbZqs8iP reqkFaxbyzfnQ== Received: by mail-ot1-f53.google.com with SMTP id g4-20020a9d6b040000b029029debbbb3ecso4549489otp.7 for ; Thu, 06 May 2021 04:30:33 -0700 (PDT) X-Gm-Message-State: AOAM532VlRH6sLu1IGetiX9J9qvEivO+4RrtUJxMulBdBQlRMDkK9/de 8Kuy34hBzBOTKatf0Qa8TzutbnX8d0naEi3NBg8= X-Google-Smtp-Source: ABdhPJxs7wGufF1TkpThsCm1Fb5QNaVfs1lNKgFxJz+P9pbL0da+VlWfo/NVA98VLadvNtaXRwcjhHdLqO3cixgJ7Fs= X-Received: by 2002:a05:6830:4da:: with SMTP id s26mr3105163otd.77.1620300630200; Thu, 06 May 2021 04:30:30 -0700 (PDT) MIME-Version: 1.0 References: <20210506095034.15246-1-will@kernel.org> <20210506095034.15246-3-will@kernel.org> <20210506102009.GA32366@C02TD0UTHF1T.local> <20210506104640.GA15324@willie-the-truck> <20210506110008.GC32366@C02TD0UTHF1T.local> In-Reply-To: <20210506110008.GC32366@C02TD0UTHF1T.local> From: Ard Biesheuvel Date: Thu, 6 May 2021 13:30:18 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] arm64: acpi: Map EFI_MEMORY_WT memory as Normal-NC To: Mark Rutland Cc: Will Deacon , Linux ARM , Christoph Hellwig , Catalin Marinas , Lorenzo Pieralisi X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_043033_741689_288BDCD9 X-CRM114-Status: GOOD ( 29.58 ) 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 13:00, Mark Rutland wrote: > > On Thu, May 06, 2021 at 11:46:41AM +0100, Will Deacon wrote: > > On Thu, May 06, 2021 at 11:20:45AM +0100, Mark Rutland wrote: > > > On Thu, May 06, 2021 at 10:50:33AM +0100, 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. > > > > > > The UEFI spec explicitly defines EFI_MEMORY_WT as Normal Outer-WT > > > Inner-WT (and even explicitly specifies the MAIR.Attr value). > > > > I wonder if they just did that because the names match :( > > > > > In the UEFI 2.9 spec, see section 2.3.6.1 "Memory types", Table 2-5 > > > "Map: EFI Cacheability Attributes to AArch64 Memory Types". > > > > > > The UEFI 2.9 spec can be found at: > > > > > > https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf > > > > > > Given that is specified explicitly, and given that we don't know how > > > future CPUs will treat this equivalently, I don't think this change is > > > architecturally sound and I don't think there's wiggle-room to read the > > > spec as permitting this. > > > > At the same time, allocating a MAIR for this memory type just because the > > UEFI spec permits some theoretical future firmware to use it on some > > theoretical CPU design is pretty farcical in my opinion. Looking through > > current TRMs I've not been able to find a CPU that doesn't just emit > > Normal-NC for this memory type. > > > > How about I add a pr_warn() in this case, so that we can revisit it in the > > unlikely event that it ever comes up as an issue? > > If we also could avoid mapping EFI_MEMORY_WT to anything, that'd be > nicer, but just the warning is probably good enough, yes. > EFI memory types are not exclusive. Most implementations use WB|WT|WC for all memory, and some even use WB|WT|WC|UC, which means that the OS can use whichever attributes it wants. So we should only warn in cases where WT is specified but WC is not, and I've never seen firmware that does this. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel