Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3270470pxk; Mon, 28 Sep 2020 12:53:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwIqZjEmbTdXr8mtwXGcn7MsRJEkiBngpCOIzz+nF0SJdYQDXYbnBJzIoPKE3hOMulbkQN X-Received: by 2002:a05:6402:515:: with SMTP id m21mr3717372edv.348.1601322814349; Mon, 28 Sep 2020 12:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601322814; cv=none; d=google.com; s=arc-20160816; b=UlQdhOb7PG57Y20OnGySAUANzXjZs/Oa2MG67MulOQmrhbpzJPiNrCFpxaXc7UTbpF nyUhAbnfNO3VQj4+/nZVpvh3/0ZCssVRmHPZY786S2LD7z5PfQKtxPrkgvKP03Idwx4r LV5nSM+G/uw3J+1C0CfB9VEpn2MtQkEt1O+n2SysTTPUAQzgtr9XVcHknoJ/4JQMJVHz n88nHXcYoczuCD6ZllyvvWWmPheOEhcpovOPFma4dNn54E3RUVyHNtUROA8jsbP6MR8J uaFshbhdU54tLAe7Z9I9Swq4UGOlA+jFI4scHXPBhXeSo1/1+iwZvsTH8BorENfwscAv E+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3C3HwQ8qYd4WkWvfVg6zz1+L4DLHgUkRm8dpfDfGjxA=; b=DTzikKPXjCgsKhRevrARjpp7LtlPFEllivuH+20NVa9i7E8hbfUJTBiK7a2mt/DhLj mqCf8LAFvMQxBBXIAaOCBYcjWEJ4d1p1RxWFdtt4fEXgbUSGChutsjwgv21z+UxK7R/m lmOC7ICe7NsfPjBphp2T5bqBe2nlq56UYI0+Ti2MrcK6Ba3Y1IRQHZDEfcZOIi5qyjb7 kRJheJ8c+Z+qWzM3Dbv6UApGKlEyXOYbzjxHmSEdV5V4f20DQLEj2/zbgWGnVK5fimJI bCSMXNoCZFJeDlOsERHJ6vkOC8rqTrZ0wKaGB+7+x2rJg+a/5pCAfMiJt37tizRwbxqt ireg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bcL3iyxs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b43si1467157edf.15.2020.09.28.12.53.12; Mon, 28 Sep 2020 12:53:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bcL3iyxs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgI1TvM (ORCPT + 99 others); Mon, 28 Sep 2020 15:51:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56022 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbgI1TvJ (ORCPT ); Mon, 28 Sep 2020 15:51:09 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601322668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3C3HwQ8qYd4WkWvfVg6zz1+L4DLHgUkRm8dpfDfGjxA=; b=bcL3iyxsCsF1z3D3tzzZZ+ezpVWcgp8D8LQ9A4iT352kwGNFtmmMHUz9HOyLoyQqXI+HjW shJIB3wHvPTMLT3r4A8Kq1UPfmXX7BLNLOvCHNyQE2AJv44C0FMqI13MxVvW+xTjQqIVVK 7u0iFF0CEFmN9IfqZd3q2H4k2TaVqUc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-rrV75QiSNjqjOBgS8Zbt0A-1; Mon, 28 Sep 2020 15:51:06 -0400 X-MC-Unique: rrV75QiSNjqjOBgS8Zbt0A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA1EE107466F; Mon, 28 Sep 2020 19:51:04 +0000 (UTC) Received: from laptop.redhat.com (ovpn-113-210.ams2.redhat.com [10.36.113.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D82C614F5; Mon, 28 Sep 2020 19:51:02 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, will.deacon@arm.com, robin.murphy@arm.com, dwmw2@infradead.org, alex.williamson@redhat.com Cc: baolu.lu@linux.intel.com, shameerali.kolothum.thodi@huawei.com, jean-philippe.brucker@arm.com Subject: [RFC 3/3] vfio/type1: Increase the version of VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE Date: Mon, 28 Sep 2020 21:50:37 +0200 Message-Id: <20200928195037.22654-4-eric.auger@redhat.com> In-Reply-To: <20200928195037.22654-1-eric.auger@redhat.com> References: <20200928195037.22654-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now the IOVA regions beyond the dma_mask and the vfio aperture are removed from the usable IOVA ranges, the API becomes reliable to compute the max IOVA. Let's advertise this by using a new version for the capability. Signed-off-by: Eric Auger --- drivers/vfio/vfio_iommu_type1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5fbf0c1f7433..af4596123954 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -2541,7 +2541,7 @@ static int vfio_iommu_iova_add_cap(struct vfio_info_cap *caps, struct vfio_iommu_type1_info_cap_iova_range *iova_cap; header = vfio_info_cap_add(caps, size, - VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE, 1); + VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE, 2); if (IS_ERR(header)) return PTR_ERR(header); -- 2.21.3