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 7676EC7EE26 for ; Tue, 23 May 2023 10:49:03 +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: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=5Jgzgy7ltSPcjHv7yH9NZZWPNdWbBUxEjIhngDcjtf4=; b=HMROdHdW5+X4dJ 1dKrFVPt5CyFZHX1Pq+xMo3fNFhE/DyL8m/brbTiBf/xl7GuHYBAf74mThLgEi5nA5ZVzZYzOAqcv idb0sTj+nNQ1GtRko7SEwCMv0ZSGKEaawdumfA7DdnCT/M0SY0CqWXAbHVxelBKWLaiiJ7iI+rzWt 9RcFqTOM0DK5qEz6lVmR9qBLl/ko02U2Q7WiDpkJj8mU3WDiQhCMS8CO6xowoZPFTovHK2+jVBnxE UDj1GXaZJ0qN8CDrCK9a5NiSBBEpPCwq1ZlegFy1zeKV9OyVQuIGKX4otuaWdfaEl94F26zFb4c6I Jyz+BysQNfN8D4oqs09g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1PZD-009ybn-2I; Tue, 23 May 2023 10:48:35 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1PZB-009ybN-0M for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 10:48:34 +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 A298160A51; Tue, 23 May 2023 10:48:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC316C433EF; Tue, 23 May 2023 10:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684838912; bh=WkBtGJVfE08dgmIbbaA3PyDFug/X4VddxqFK+5DXezg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DXHFW1Vg9LthKnbcbHgCJY3GjO8NedOZlqGnLe3aiNdtBbR2C2RTzpgxMhPmMev7e ktasr0briPZt2XrQhSwkGwmOLWcDX3XAS1ufy1Lu8BO58n7dbtAyhDDd4LlMWau17B SihIrN61IGZgtusPx47z0gkMB2Fz3IhP5r5Dyy2foygU7JzItEToIHhRhvdloxZPQP Z+pKxd0PL3BjhbMW4xzHXOClD77BQejCMFAyXT4Xp359y4+SvpfVwhqtWUX99jJfKt 10MmY5xDNATks3HAmcTlA4BvrOkAY1xEoNcInTdTJ0LosVdk6mEfKXAKGkI09EK7HN xUP2jrwbgvQrw== Date: Tue, 23 May 2023 11:48:26 +0100 From: Will Deacon To: James Morse Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Catalin Marinas , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Oliver Upton , Rob Herring , Krzysztof Kozlowski Subject: Re: [PATCH 0/6] arm64: errata: Disable FWB on parts with non-ARM interconnects Message-ID: <20230523104825.GD7414@willie-the-truck> References: <20230330165128.3237939-1-james.morse@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230330165128.3237939-1-james.morse@arm.com> 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-20230523_034833_257199_DCB632B5 X-CRM114-Status: GOOD ( 30.25 ) 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 Hi James, On Thu, Mar 30, 2023 at 05:51:22PM +0100, James Morse wrote: > Changes since the RFC?: > * Added DT support, in a way that means we don't end up with per-erratum > strings, or bloat in the calling code to check for those strings. > * Added a commandline argument. (boo) > * Changes to support errata affecting features on big-little systems properly. > > ~ > > 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 disable FWB, and do the required cache maintenance > instead. > > The good news is, this isn't a problem for systems using Arm's > interconnect IP. The bad news is: linux can't know this. Arm knows of > at least one platform that is affected by this erratum. > > > This series adds support for the 'Errata Management Firmware Interface', [0] > and queries that to determine if the CPU is affected or not. DT support is > added so that the firmware interface values can be queried directly from the > DT. This can be used as a fallback for platforms that don't yet support the > interface. It occurs to me that, when a device is assigned to a VM, there are a whole bunch of non-probeable reasons why FWB cannot be used and perhaps we should be looking to advertise that from firmware without pulling in a reliance on this errata management interface. Right now, I don't think KVM or VFIO do anything to prevent the assignment of a device capable of non-coherent DMA traffic and FWB is used if the CPUs support it. This, in theory, allows the guest to read stale data from host memory pages using non-coherent DMA and I think we should gate usage of FWB for a given VM on whether or not that VM has such a device assigned. The problem is that I don't think you can probe this property reliably. It's not enough to check for "dma-coherent"; rather we also need to know details about the IOMMU and device-specific properties such as the ability to generate NoSnoop transactions. I think firmware is probably the only option here, so since you're proposing something similar, please can we make it general enough to be used outside of errata scenarios? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel