Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1067226lqo; Fri, 17 May 2024 09:38:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLdF5PqwJL6MCVqu2J8X3hbipyUkXbX78Ut4hszHWdJ2tqDrkBERU4da//VspBJXY5oKC1D/l6p5jk0GTelbgg6HBnitFrwsRkn5vWtQ== X-Google-Smtp-Source: AGHT+IGj6q84XIkbM0Q+QRN+T8mAkCMQeP3LOWCIOOWmeOBA+dqm0wWAaAXZSX74IdlWD+AfYTgx X-Received: by 2002:a50:cdd5:0:b0:572:f71:8030 with SMTP id 4fb4d7f45d1cf-5734d590400mr15567833a12.8.1715963897508; Fri, 17 May 2024 09:38:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715963897; cv=pass; d=google.com; s=arc-20160816; b=yVY5q11JydUVJW9gka3Yr4fibWd1SHZoG1hL7ZZLWxZtC78JyxPlJSETjihM6agY/1 0l3ITNwgExqNKEe6+gYqzagjSBJWvUFECxKBQP9CVvMwVkyS5CzDUFB6cLEHL7ezTAsO /JwDCk4Agb38d5D5jEomhILOv/o3pUA72Q9OxRRxQCUNYMZRCtOrJtLPB3D/iBXMuf9T 6JYfrKzhcnjs/NOAsHZt4p1o0ESMlsPH7u0MdxiFeJ3cHakAjSvFju194/kPO5QvOQIm mmxDHKIIroM/ojHvOB1sUJuIGowG3iesF9q7NCuTgnmpKo2yDNGAAm1xqPQWWel6I0VT ClMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=dIURDdZ39tEeJDFphE4Cx1Ja6Qc4j76kHIqAde+Utv0=; fh=hCNJHo2HU2YmXvzgHtnWJbOnwJOarVvae3wmyYZVxCo=; b=ylw8g2EF+7+q+fvze9BC5J0y7zIvw11MllDLWlJCYcdi9Mzj0ULNYTDcLtnpoVYLGz tXslj2TjMEMV4amm7/btur++0/QRwwbZSbk3WVO3hIkYRnYGf5xtuzOtYf7nmtBaySSA KYzhHiI5w/8JqMt/j+w3PpXJ+zdQaKoRHnDcF78xx0UCeNiFeGrDn4+hebPaFAOlDack bQ919yAkSn/p/l90AOn7GnlsxVJQ3F7fxA5RvgsXd65dMSEM8ThI5KsbxECmXMeVGUp2 nvllc5nWGqGyuIlan80Zt7qwFvcSVsSHtPKE74up8n7V9tKPKpZfonAz12mdfvCmoRW1 V8TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lt6AWjSH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c328980si9778119a12.421.2024.05.17.09.38.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 09:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lt6AWjSH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 63CE41F2650E for ; Fri, 17 May 2024 16:37:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43B3D13D892; Fri, 17 May 2024 16:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lt6AWjSH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A33E12FB33; Fri, 17 May 2024 16:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715963867; cv=none; b=YEeLSjNVS6bzKHyv8DD4+WKVcZv+YpPXf/tVqK0Nrf9Gnc9OcGvxCiDevHalO7RbqYR1GdguM1/DGqlZLhtj597a2RYQ/2Ad+xIRzmCTJEmKskZACwxlXhSlGIxWpi0GTMZ6V5TbeJYMe+0HI2y5HtGmThF8FWNpFyAs3O51qMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715963867; c=relaxed/simple; bh=gA3mNN9MSiUL2l01xoNls8gykjiUtJVzzR6Yjq2NXA8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kf6p973oNT0z/8YUCkagpTVA6wJ4xtXOTF2IUrt5T3ChVJUQ1XlO4lgdWqtvDLrVhFh95ObqkxzL4fewaUTkSvJY5dsLfFOsvGsDX7uykAE1WI2JINkAYnC+/iLRH1P8UhnXSZ4yzs4MgUmKz4raETOfUcXuzi0GmY5znm9fGDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lt6AWjSH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB186C2BD10; Fri, 17 May 2024 16:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715963867; bh=gA3mNN9MSiUL2l01xoNls8gykjiUtJVzzR6Yjq2NXA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lt6AWjSHgZTioAB8W3Cl7gBYgJ06Fj/XwuSJFRHTZaCxs5+9k8l4+9RL06sWr5reR 5Enz+EN/pSoXlIIKh1hghqoX8L/h7oMVFr9LSm+2TpRayQwTBzZiUWmViloILf1XuL zeE+s+ROfP/ri7VVZ0O+O5xQhSzYU3vD47TWcsAXTjwSE8O4IW14GBlH2m/BlHHI6e iXSYlOzimRvjkWnMs6I+8CvZEIQr4STvetqtfi3pt4IgehHeu3PpT1qwPGklucwDv7 a/5IdQtZ8hEVUAYJwmpWABIf0FhsKfpscAwz7o9VYf7MoEAAZE6s6ySZbf4snxy9tk XKhPffVTmGYwA== Date: Fri, 17 May 2024 17:37:42 +0100 From: Will Deacon To: Douglas Anderson Cc: Robin Murphy , Joerg Roedel , Stephen Boyd , Chen Lin , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu/arm-smmu: Don't disable next-page prefetcher on devices it works on Message-ID: <20240517163742.GA525@willie-the-truck> References: <20240513161343.1.I5db5530070a1335e6cc3c55e056c2a84b1031308@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240513161343.1.I5db5530070a1335e6cc3c55e056c2a84b1031308@changeid> User-Agent: Mutt/1.10.1 (2018-07-13) Hi Doug, On Mon, May 13, 2024 at 04:13:47PM -0700, Douglas Anderson wrote: > On sc7180 trogdor devices we get a scary warning at bootup: > arm-smmu 15000000.iommu: > Failed to disable prefetcher [errata #841119 and #826419], check ACR.CACHE_LOCK > > We spent some time trying to figure out how we were going to fix these > errata and whether we needed to do a firmware update. Upon closer > inspection, however, we realized that the errata don't apply to us. > Specifically, the errata document says that for these errata: > * Found in: r0p0 > * Fixed in: r2p2 > > ...and trogdor devices appear to be running r2p4. That means that they > are unaffected despite the scary warning. > > The issue is that the kernel unconditionally tries to disable the > prefetcher even on unaffected devices and then warns when it's unable > to. > > Let's change the kernel to only disable the prefetcher on affected > devices, which will get rid of the scary warning on devices that are > unaffected. As per the comment the prefetcher is > "not-particularly-beneficial" but it shouldn't hurt to leave it on for > devices where it doesn't cause problems. > > Fixes: f87f6e5b4539 ("iommu/arm-smmu: Warn once when the perfetcher errata patch fails to apply") > Signed-off-by: Douglas Anderson > --- > > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) Just curious, but did you see any performance impact (good or bad) as a result of this patch? The next-page prefetcher has always looked a little naive to me and, with a tendency for tiny TLBs in some implementations, there's a possibility it could do more harm than good. Will