Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4590303pxu; Wed, 9 Dec 2020 23:47:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+Wv99a8QJ+hOOvceKGkat96VcWm2XTAmVvukrvzHnpuBwahlT5+wbRx6HCphAHcdFdD9q X-Received: by 2002:a50:bf4a:: with SMTP id g10mr5409699edk.201.1607586457084; Wed, 09 Dec 2020 23:47:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607586457; cv=none; d=google.com; s=arc-20160816; b=aFLMHb/AeRz91mSqly8fpxXbqK4O38TnTvqRynD9qNTA5DWXodqdJtEP+8sj7sa7x2 e794M46XCrO9RuU/w27ItymEWvzT6UTpxgW6shCCuQNrfIwmBpOhmM3lOkkq9PqEKA1U J9DWLeARzXAISUsrMrgg4OYPXmDXJ5OEMBj6bVAkscgWMzjclHyayb9CLrhWZdqbStCb mkp/bxM8Gv1TVzTXXhItHK1sJeNXAGf3S90rmaLveSXUHE/AySIF7HKuWio0uKObkM8u BQwFSHk2MI/Mij8vWIDaCl0UIbwZl5GfE9xWZckPlZkgCy8cAIlelNjwqTtI5tzON+Nn Bepg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=LSsSltacd1qNbpeGex88xy+EjxUV8/Who9UlEd1U7Rs=; b=VAao9Hlvk0y0PmIb/PaPDfck/qKDpMKt3nogszO6ADhSpXoKFBNXHZHJBSuzDD/oXy yd1nnY4AsTgwtBNlxNy8ZBqUIyozotFLRQxdAjHguoPva6iGH2shjcgVVqg7Hhnzo0ny e7o2yBm1NCMvUSZ0rfNjHMpiAgUorjq1y0oDNgT4NldFfWBbkWvnpbtaWLzDPTCtHaB4 QzNu3t6Mu7ZtRzwZFbZ/SeGBw75ZnXg2WRnHtTgToYU8T8XHIOxR4VArLJf+p2bYEeoi fph7ojYHaODEfDkJ6k4gBzqaVjPgTEXXshA3SJIPHSXdqkUJHknd78HuAcp0wk36yyL5 ying== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr22si2262045ejc.411.2020.12.09.23.47.14; Wed, 09 Dec 2020 23:47:37 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733295AbgLJHgw (ORCPT + 99 others); Thu, 10 Dec 2020 02:36:52 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9148 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733170AbgLJHg3 (ORCPT ); Thu, 10 Dec 2020 02:36:29 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cs5Km46jlz15b9Q; Thu, 10 Dec 2020 15:35:08 +0800 (CST) Received: from DESKTOP-5IS4806.china.huawei.com (10.174.187.37) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Thu, 10 Dec 2020 15:35:30 +0800 From: Keqian Zhu To: , , , , , Alex Williamson , Cornelia Huck , Marc Zyngier , Will Deacon , Robin Murphy CC: Joerg Roedel , Catalin Marinas , James Morse , Suzuki K Poulose , Sean Christopherson , Julien Thierry , Mark Brown , "Thomas Gleixner" , Andrew Morton , Alexios Zavras , , , Keqian Zhu Subject: [PATCH 6/7] vfio: iommu_type1: Drop parameter "pgsize" of vfio_iova_dirty_bitmap. Date: Thu, 10 Dec 2020 15:34:24 +0800 Message-ID: <20201210073425.25960-7-zhukeqian1@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20201210073425.25960-1-zhukeqian1@huawei.com> References: <20201210073425.25960-1-zhukeqian1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.37] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We always use the smallest supported page size of vfio_iommu as pgsize. Remove parameter "pgsize" of vfio_iova_dirty_bitmap. Signed-off-by: Keqian Zhu --- drivers/vfio/vfio_iommu_type1.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 32ab889c8193..2d7a5cd9b916 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1026,11 +1026,12 @@ static int update_user_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu, } static int vfio_iova_dirty_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu, - dma_addr_t iova, size_t size, size_t pgsize) + dma_addr_t iova, size_t size) { struct vfio_dma *dma; struct rb_node *n; - unsigned long pgshift = __ffs(pgsize); + unsigned long pgshift = __ffs(iommu->pgsize_bitmap); + size_t pgsize = (size_t)1 << pgshift; int ret; /* @@ -2861,8 +2862,7 @@ static int vfio_iommu_type1_dirty_pages(struct vfio_iommu *iommu, if (iommu->dirty_page_tracking) ret = vfio_iova_dirty_bitmap(range.bitmap.data, iommu, range.iova, - range.size, - range.bitmap.pgsize); + range.size); else ret = -EINVAL; out_unlock: -- 2.23.0