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 955F3CFB440 for ; Mon, 7 Oct 2024 10:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:CC:To:From:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QCIboNDi0+QF4x956SfXdlu4UjpNYXVD4wRwQLp6HOA=; b=jQ5c3wMxLd/gBdiwz9B88xizEL sz3mmk/lFuqUC5IxYL0fXx2ZF32T3LEv5ptZ4uBwRYefqwoUDAOyNST1hBzKwxGYsbnVK6kKr8zAc Bp0rpA95sHHu2KSwJz2RNgMhR+mMgZp90zMf3F7ZXDTk40hMvAR8W+/2oJq6rpjkocZL9xZ4wtF9O ErNkctlLgqJMZPM6fHhEqCW07Jq9e9V9xWS5k66EdO65pCoMjmmcjhP3U4lwUrKTZpg12i1TQUmCJ aeFOFKNZTfknXzsV311nFzmzqg8f4i3PSbQTkhmC4kVJlhRTAhjrj73kkVTZSfk5+QTzxpLJC7K/b uVvyZL5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sxkcZ-0000000205g-2oM8; Mon, 07 Oct 2024 10:05:43 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sxkbH-00000001zud-2Vjl for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2024 10:04:25 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4974Spx6004197; Mon, 7 Oct 2024 10:04:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QCIboNDi0+QF4x956SfXdlu4UjpNYXVD4wRwQLp6HOA=; b=fMNqxoyWIUFRQBAM I3C0D9wgbjx78VJxsOrXdxFHf+4UVA0rVuzkbw8qhIZxsUx1ZbAI74WglF4qrzv1 APRlVFs17H6UbQK/FNWyxLwrYmMLTaTq/87o1jcmxmZvuAViGbtAveXYRtv5iiwh qdMfPI19M7fxeXHkkkSOW5psk68VACwJ5vL8ZU5lxlzfz6up6xduiQ9CMQ/p4y6b nsms4SSFsXj5HIeOPbfSYbHCJgGWRCdalKJSf1IEAzcgJf7ki+oNYYPTtTP2vbsS JIuwF2eIDoC/yADD1U0kUER/AKqB9GwfJ8T8DedFBqj/o5J/iyyH3aiXKt99OApc yqTqHQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 422xqnup6h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Oct 2024 10:04:07 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 497A46lY014009 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 7 Oct 2024 10:04:06 GMT Received: from [10.131.117.146] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 7 Oct 2024 03:04:02 -0700 Message-ID: <98d56e5e-47ca-45d8-8e0e-07c204fcc04b@quicinc.com> Date: Mon, 7 Oct 2024 15:33:52 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iommu/arm-smmu: Don't disable next-page prefetcher on devices it works on From: Pankaj Patil To: Doug Anderson , Will Deacon CC: Robin Murphy , Joerg Roedel , Stephen Boyd , Chen Lin , , , , References: <20240513161343.1.I5db5530070a1335e6cc3c55e056c2a84b1031308@changeid> <20240517163742.GA525@willie-the-truck> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: wZ3g98OVtQqnb7P1DzBI_wgju32o5mUP X-Proofpoint-GUID: wZ3g98OVtQqnb7P1DzBI_wgju32o5mUP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410070070 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241007_030423_780129_DD6E2DEC X-CRM114-Status: GOOD ( 27.45 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/4/2024 1:59 PM, Pankaj Patil wrote: > On 5/17/2024 10:49 PM, Doug Anderson wrote: >> Hi, >> >> On Fri, May 17, 2024 at 9:37 AM Will Deacon wrote: >>> >>> 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. >> >> This patch actually makes no difference on trogdor today other than >> getting rid of the scary warning. Specifically on trogdor the >> ACR.CACHE_LOCK bit seems to be set so the kernel is unable to change >> the setting anyway and has never been able to. We are working on >> figuring out how to fix the firmware and then we have to get a >> firmware spin before we can really see any changes. I'll keep an eye >> out to see if performance numbers change when the firmware uprevs. >> >> BTW: any idea how big of a deal these errata are? We're _just_ >> finishing a firmware uprev process and there is always pushback >> against kicking off a new one unless the issue is important. Given >> that we've been living with this issue since devices shipped I'm going >> to assume we don't need to rush a firmware update, but if this is >> really scary and needs to be addressed sooner we can figure that out. >> >> -Doug > > Receiving the warning on pre-silicon platforms as well, despite being unaffected. If merged, it will help in reducing log clutter. > The patch applies cleanly on the tip of linux-next, tag: next-20240904. > Following up on the patch. Please let me know if any additional changes are required.