Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp108085pxa; Fri, 21 Aug 2020 02:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzELZwwS4zSCRSCHeSrs/krm90hUfvBhM2Zp+9mRjHN0TmEQbZUnoAFsWkFtQuhli+CL1ZK X-Received: by 2002:a05:6402:1606:: with SMTP id f6mr1831234edv.328.1598002173944; Fri, 21 Aug 2020 02:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598002173; cv=none; d=google.com; s=arc-20160816; b=DQfKtJ5HptQ6e7HtTK9ZGsaP3fBP9pghz7Lnvy75/rrYY7KhSyTyTxn9YQSxdWCLnr 8LWslygPv/vGAQjKgl64e77vEEohGlT2WIYpzZ8pwtR419ODg/LWybojomQsf86w9Vbh GIrl88GxomLqt3o1U3M8EqfBipB4aCm53s6wiutpoTCCvxqdp9Zc0DIryKkV6s/rusin 54PPAJXgHFZQqR0NnfgwQ3T3SsF4s3/dqWdMv6tz/9I+4LSmZKwYYodpoXOrJvBKdYOp 1rN9eq2Br0WxCrjJGW3joc8AKYRPxyBIuQOihGSqZk3MmficX/AA85BhOe+ZMGQdxtC4 uzIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=I+BEhjcX4SAr8jSjnZvZnUPdx/ThUX5bf8qM1MA/oeM=; b=gIDmMe2G81aa+HvG/bs6ARXyl8Iu+bOnRreoR4jsDeYPSa3wfvBnUnsNdFRqQKAps6 zMJmWXhVwNxvS1rmrCYaQ7ztgC6I5cyAY6C6y5kJttB+pFTvmBEK6LT7N1yH5SdlPVIT /GCNJ9VMObPBNnT7Pss2KrDU6dl4chfdWZxk/TW1FAcPEBwsCcxccEFQjOmBcFW51MWh 9WgeVFb3Lp9Ld51+zpO7ZSQECTl5rnYX/Xgb/qSN7jKnn/woyL3xZI/qDgOffI4vmuaA bkzvlExByhm9iozCpkpNjkYr6HC3ph0iOuOUS5hbZXHzgtFH5PERE6Ji46TMjykRy4yY 7AFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRnmxguD; 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 c15si768811ejm.289.2020.08.21.02.29.10; Fri, 21 Aug 2020 02:29:33 -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=NRnmxguD; 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 S1728406AbgHUJ22 (ORCPT + 99 others); Fri, 21 Aug 2020 05:28:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44151 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725806AbgHUJ22 (ORCPT ); Fri, 21 Aug 2020 05:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598002107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=I+BEhjcX4SAr8jSjnZvZnUPdx/ThUX5bf8qM1MA/oeM=; b=NRnmxguDRmIzBoUirYqGkhTQwqAkV/6OBm3AKDwJ9LCtAW45ExGK91C6REZ45Q/wk131WJ lzkx9xAFj4Lx034U2cvR3oLJtev58c4Q43R93Xkk6Iy23mKT1nwl8NJIPLfLSVU6M1IvTs eJY9u5IGWckjuE1O0dr+xO5j2dn9nSY= 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-444-dG8vhwgIPHWsKBs9P1Whog-1; Fri, 21 Aug 2020 05:28:25 -0400 X-MC-Unique: dG8vhwgIPHWsKBs9P1Whog-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A0A680EF8D; Fri, 21 Aug 2020 09:28:23 +0000 (UTC) Received: from hp-dl380pg8-01.lab.eng.pek2.redhat.com (hp-dl380pg8-01.lab.eng.pek2.redhat.com [10.73.8.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96E387191C; Fri, 21 Aug 2020 09:28:15 +0000 (UTC) From: Jason Wang To: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com, shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com, zhangweining@ruijie.com.cn, eli@mellanox.com, Jason Wang Subject: [PATCH V2 0/3] vDPA: API for reporting IOVA range Date: Fri, 21 Aug 2020 05:28:10 -0400 Message-Id: <20200821092813.8952-1-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All: This series introduces API for reporing IOVA range. This is a must for userspace to work correclty: - for the process that uses vhost-vDPA directly to properly allocate IOVA - for VM(qemu), when vIOMMU is not enabled, fail early if GPA is out of range - for VM(qemu), when vIOMMU is enabled, determine a valid guest address width Please review. Changes from V1: - do not mandate get_iova_range() for device with its own DMA translation logic and assume a [0, ULLONG_MAX] range - mandate IOVA range only for IOMMU that forcing aperture - forbid the map which is out of the IOVA range in vhost-vDPA Thanks Jason Wang (3): vdpa: introduce config op to get valid iova range vhost: vdpa: report iova range vdpa_sim: implement get_iova_range() drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 ++++++++++ drivers/vhost/vdpa.c | 41 ++++++++++++++++++++++++++++++++ include/linux/vdpa.h | 15 ++++++++++++ include/uapi/linux/vhost.h | 4 ++++ include/uapi/linux/vhost_types.h | 9 +++++++ 5 files changed, 81 insertions(+) -- 2.18.1