Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp714040pxf; Thu, 1 Apr 2021 11:34:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/y6xYx99Y2NGimdsrg5gGvDyNTK+UNz9Wk/l547GrpnjwwmOGv6oKyFGExaMZvMSyqW7p X-Received: by 2002:a17:906:e48:: with SMTP id q8mr10747328eji.84.1617302069467; Thu, 01 Apr 2021 11:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617302069; cv=none; d=google.com; s=arc-20160816; b=M3aif1x0DocDqHBBpQdUVeo+RG4rBsbr3TLbnXZfcu2tpAW7+BMJ85td4eTvFkRwpI 16VWEq4xuYggwz6rH+mB55vqkxj9plFYoGjslwilFBp84CnbTr5X5Y184znXRjV5FpQP qxzzpbDzNw/IhiuDDASydH4rI74kxb2CDiQfRcWibC8odlEeLYKwIUcNQ678L9JCCTux sLG4lkAb7ch8Q782sIL4lr3A27hMapdnec2JJ5/ZVicVWxURdj7qQgMdSwt3BCln7Pj4 p2bSf5tBXGVgPFjli1U5aHTU7KCNV+9n1Af+i9x5Vkv8kfobrRkRCza2RrSHnWLhi2XR E2ug== 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=+iflfX+0RTYT/MJyowyuVhg2yfi4QsszGATPW/liS4w=; b=d1WJqpGKgpOQFfioJx6CT8wM0AgI7mFFxEVwGrJ15Hd6etQOyPVxlhyS1kFeS9fjdj /lI5suA7+fbh8uQ9yKRQPwXWq0HA5ZZ324b78k8kuULVLVJtxxjxYZ4JzDzjNePFqmLm 9ZxVaRNaXpf+zB4/G0SaaODowV1Lgmolc/3Ysod3/WCCeQhn7glTqyOaE3DK10gfdGcJ 6QIn6Lf6qxeQclyzo40HUER2GaSHqDh8xWXbE4hN7t9PssBHSJhTrV3rNJWfxfgHl0bM FSy56uFRRWDreVYSmx0JOqV9y4ErR3jP+BnMmVLNdr/zcZfIoUaxHUVqJRnv2hPaPw5A FYFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si4805302edt.491.2021.04.01.11.34.06; Thu, 01 Apr 2021 11:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235597AbhDAScA (ORCPT + 99 others); Thu, 1 Apr 2021 14:32:00 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15463 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238728AbhDASKB (ORCPT ); Thu, 1 Apr 2021 14:10:01 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FB11K5HVKzyNCT; Thu, 1 Apr 2021 19:19:49 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Thu, 1 Apr 2021 19:21:45 +0800 From: Qi Liu To: , CC: , Subject: [PATCH] iommu: Remove duplicate check of pasids Date: Thu, 1 Apr 2021 19:19:16 +0800 Message-ID: <1617275956-4467-1-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove duplicate check of pasids in amd_iommu_domain_enable_v2(), as it has been guaranteed in amd_iommu_init_device(). Signed-off-by: Qi Liu --- drivers/iommu/amd/iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 107316e..7ca9f2f 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2310,9 +2310,6 @@ int amd_iommu_domain_enable_v2(struct iommu_domain *dom, int pasids) unsigned long flags; int levels, ret; - if (pasids <= 0 || pasids > (PASID_MASK + 1)) - return -EINVAL; - /* Number of GCR3 table levels required */ for (levels = 0; (pasids - 1) & ~0x1ff; pasids >>= 9) levels += 1; -- 2.8.1