Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4110406rwb; Mon, 31 Jul 2023 01:11:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFBHltIqjVbtz1osKzAJbck+UWmgX9ODd1UjJG95zFLoQ4ACqPITONA9V6obLFoVhqYXNce X-Received: by 2002:aa7:c84b:0:b0:51d:95ac:22ed with SMTP id g11-20020aa7c84b000000b0051d95ac22edmr9732697edt.1.1690791081435; Mon, 31 Jul 2023 01:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690791081; cv=none; d=google.com; s=arc-20160816; b=EIFVnMFVXnzRaoGbNhzvQci31DOfhZjN+YlKql1FCNIf8jxLe9xIHMJodKEmLp5aTv zY03msRu+Pe26qIeqYam9KxRzpzk3QgYi3wCAxOFjqNHnT6zzdQeOVGW5APq+WEfMO1j N8MwNi9OHjAJZfdHyLvfOlmVkky1gX5g947ngxO2bVb8TvZWbKIROQRPq1KIz6eE5myN s10h315WOVUCaM9EmLkEKWmCzf6AOaUNdzwfhme5Oo7CayN0ZqNUfxyDA8bV7bSQRQma OX8WANJxPrXPYaM86zkaMEgIMHOmrT7IoyQJ7OUsXYnGpexNPnM0VXGtDskt+aClo/am /0Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=VZEYdwUoaCObnY8Xrv1Jg1ILk07XrN056YQhC+V7k/Q=; fh=n+5Rd3Rdvvcc/ktoYSsmJD6iycSbF3L9x4GFRMRL+fI=; b=S4adoPSYwSRVDishjcoS9IOG7rFuvEW8mMd/vQ9hZGuyTlNfYVpvGprRSmyba1fD/D pDWINkfwhDGnZT5m6wzoPFqOT725Z/x99BFOvsGcACr1liZKnrt0+kesh2h1at66K691 VAWr+w7cLM/K4m5VyoBbmjv0EbKhU5kTmC38B+QoqBzwm9xfbipf2TIudHRy9zIYx4K+ HIdk6EPgLNMpsdf9y3ycCu03qW5KawDsrqVrC0KcFGuikc8W48HnWkzXYMAx75dw1zG4 dOkQa66DmgO/gBf8zd29ZmyyrIi4SmqhNsdBXhfiiaOHB16Xm9SS5FRWMIrDLoPndN5F KMZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020aa7d6d3000000b00522828d438dsi2632901edr.32.2023.07.31.01.10.56; Mon, 31 Jul 2023 01:11:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229734AbjGaG2P (ORCPT + 99 others); Mon, 31 Jul 2023 02:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbjGaG2L (ORCPT ); Mon, 31 Jul 2023 02:28:11 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13E391BC for ; Sun, 30 Jul 2023 23:28:05 -0700 (PDT) Received: from dggpemm500003.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RDp9w0QbxzNmbs; Mon, 31 Jul 2023 14:24:36 +0800 (CST) Received: from localhost.localdomain (10.28.77.120) by dggpemm500003.china.huawei.com (7.185.36.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 14:28:00 +0800 From: wangwudi To: , , CC: Rui Zhu , Will Deacon , Robin Murphy , Joerg Roedel , Lu Baolu , Jason Gunthorpe , Yicong Yang , Tomas Krcka , Jean-Philippe Brucker , Nicolin Chen Subject: [PATCH 1/1] Revert "iommu/arm-smmu-v3: Set TTL invalidation hint better" Date: Mon, 31 Jul 2023 14:21:22 +0800 Message-ID: <1690784482-30028-1-git-send-email-wangwudi@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.28.77.120] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500003.china.huawei.com (7.185.36.56) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rui Zhu This reverts commit 6833b8f2e19945a41e4d5efd8c6d9f4cae9a5b7d. This constraint violates the protocol. When tg is not 0 but ttl, scale, and num are 0, the hardware reports the CERROR_IL gerror. In the protocol, leaf is not a prerequisite for TTL. Cc: Will Deacon Cc: Robin Murphy Cc: Joerg Roedel Cc: Lu Baolu Cc: Jason Gunthorpe Cc: Yicong Yang Cc: Tomas Krcka Cc: Jean-Philippe Brucker Cc: Nicolin Chen Cc: Rui Zhu Signed-off-by: Rui Zhu --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 9b0dc3505601..098e84cfa82f 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1898,13 +1898,8 @@ static void __arm_smmu_tlb_inv_range(struct arm_smmu_cmdq_ent *cmd, /* Convert page size of 12,14,16 (log2) to 1,2,3 */ cmd->tlbi.tg = (tg - 10) / 2; - /* - * Determine what level the granule is at. For non-leaf, io-pgtable - * assumes .tlb_flush_walk can invalidate multiple levels at once, - * so ignore the nominal last-level granule and leave TTL=0. - */ - if (cmd->tlbi.leaf) - cmd->tlbi.ttl = 4 - ((ilog2(granule) - 3) / (tg - 3)); + /* Determine what level the granule is at */ + cmd->tlbi.ttl = 4 - ((ilog2(granule) - 3) / (tg - 3)); num_pages = size >> tg; } -- 1.8.3.1