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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E72FC636CC for ; Thu, 16 Feb 2023 18:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3GB/prJjxfVvZgHZZk0Ygrv2OmeQn625vlNNBgDAvWw=; b=E+KuoyoawefMGu 8WGD54CTpEsGSJFrVD1aVlgcKyRWiUNs5KEZLwwNtycZJDxT9bfkSmg3sLv9WbIP+T9Ld7tbzEvtK 1gAptMgr/85W2VGYj5VfqyyCe8fWE0Iv+r2C7Pgr4RZZxUiFyKU3s4cenTHapTuyCQ2tWZToyyTEx l+ZlfwHZJS5ZIeVLk0QMjJ9lDNl3y44lVdtu0JPhs394LTly8WjwZg+RdWl1MiYwIsbq+G1ALS1XQ 60HZmFcXTzxM3r59ugr8r79z7nLqN3sRkTztP85C2hoQO/EKJqe123naopIDm6QXjnYOQS96TbHMD yYyk0NgUWAUR2OJSHZcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSjHU-00BZSJ-PT; Thu, 16 Feb 2023 18:46:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSjHQ-00BZRW-Vl for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2023 18:46:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F4116069D; Thu, 16 Feb 2023 18:46:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B03DC433EF; Thu, 16 Feb 2023 18:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676573210; bh=w8GUPUDEGcFQyYbbeXjYf512Tq9rvZGSyC7QT3yZJWQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iFi0PTR8fyQjlHfdnE663b8PVmIe5gJmuIauz5Sxt4yp+akqasl/HCwvhAENotbdJ BG52Zb4EXNi3G0+EN114Y2xo0pRLSpXAK1jK4K45pxlaubTIryDpD5hJSG0abLba8g aiXlBr9z3QHl9Ja7gv78IUaU3rNf2KK4EynRd8hax7h+rTMXto7mz1jImbCjl7NpE8 x/xDCmVXcrYZFfJZBLn6TwvEZxpSN4I8HH2YxKH9JXqAsrNdoc1sAjjRdIFa82NpNr qNMDCmDtyVwBrk5JT2JYt5uKN2/RA+d3YpR1Lsrr5hfEHZW/rR+amSnTfaZGeI1Ogn x/KBaqKAdlTLw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pSjHM-00B02l-71; Thu, 16 Feb 2023 18:46:48 +0000 Date: Thu, 16 Feb 2023 18:46:47 +0000 Message-ID: <86mt5dxxbc.wl-maz@kernel.org> From: Marc Zyngier To: James Morse Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Oliver Upton Subject: Re: [RFC PATCH 3/3] arm64: errata: Disable FWB on parts with non-ARM interconnects In-Reply-To: <20230216182201.1705406-4-james.morse@arm.com> References: <20230216182201.1705406-1-james.morse@arm.com> <20230216182201.1705406-4-james.morse@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: james.morse@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, lpieralisi@kernel.org, sudeep.holla@arm.com, oliver.upton@linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230216_104653_118900_6C969338 X-CRM114-Status: GOOD ( 25.02 ) 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, 16 Feb 2023 18:22:01 +0000, James Morse wrote: > > Force Write Back (FWB) allows the hypervisor to force non-cacheable > accesses made by a guest to be cacheable. This saves the hypervisor > from doing cache maintenance on all pages the guest can access, to > ensure the guest doesn't see stale (and possibly sensitive) data when > making a non-cacheable access. > > When stage1 translation is disabled, the SCTRL_E1.I bit controls the > attributes used for instruction fetch, one of the options results in a > non-cacheable access. A whole host of CPUs missed the FWB override > in this case, meaning a KVM guest could fetch stale/junk data instead of > instructions. > > The workaround is to always do the cache maintenance. These parts don't > have fine-grained-traps, so it isn't feasible to detect the guest > disabling the MMU. Instead, disable FWB on the host. > > While the CPUs are affected, this erratum doesn't occur on parts using > Arm's CMN interconnects. Use the Errata Management API to discover whether > this CPU is affected. > > Because guest execution is compromised, the workaround is enabled by > default. If the Errata Management API isn't implemented by firmware, the > workaround will be enabled. If a target platform is not affected, and it > isn't possible to add support for the Errata Management API, the erratum > can be disabled in Kconfig. I'm feeling a bit sick... My main concern is hardly anyone implements this errata management API, if at all. We should: - give people an option to disable this from the command-line if they know they are on an unaffected system - have some form of DT property that indicates the HW isn't affected Thoughts? M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel