Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp498505pxu; Fri, 23 Oct 2020 06:31:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9KO7rYhLRn1OhyX/Jd8sD7PVWVshswWoVFcD1k9O/Alz74LpmP6E/yCcXCiWHLWtXbh5u X-Received: by 2002:a17:906:4b10:: with SMTP id y16mr1998277eju.395.1603459891865; Fri, 23 Oct 2020 06:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603459891; cv=none; d=google.com; s=arc-20160816; b=RQn+f4/7eiz8wOKYtKNy5UTqG1osL03uBFad7aGYsmuXlxgOoMqLzUzQQMtO9VI3PE tVIZvmoeeX4LubSH3/+uvn0efG4bz3G3tLohN9sZOODlgULOWdt5o6EnrjuWnnNyr6/N u/v8pyYKrSjrojLVeQMwV/kXe1CK41xA6BtgAxnQrNvKUsVv9pia9TyZWp8CNCzR6w7g slWBxn+PUtop72R8P+s7yNEjlR9jLgQh2N0fKHed+lkk9bg9INv/VIYjyhMAQ8x4v5FP ykxBJJkpb3Fm8dFI+T2RoqQoBKIEZE03bIq3C8Ig/H0vtcw8dyaNuca22to797/yPNgq s0uw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=XBDq/dF8AYxxnodSggGeabhLd4I0L4Fwx/764jAbR9o=; b=tGSbfHgON53/09ZwKyNvOhvikbORtrX+weA13VSnNgVTh3MAdwsPuDwAGE4E2CQExi eFgjjx7X2blhJwQZxnh2c9Wb9hGTDYGPga0vCy7hafxRG26awHrB9eb9HFJo6B+gQA5h UqzZHWERuPI8FYf7sus/R9ILvCtqBzWaWYO3nNQeRnphIGihQ984y2Z3mLjhRjFgTx/7 ydFWlboHwbvBJot30moeeIhFnScMwfHAAVr+tpiU0/TA0Am+B28nz+MFNfuObg2c8e3o Z+dFAn51z9D0rSCgX8z7+ZZXElHJHXTd0T9Y+uD5Y14vfjie1SXaYORxLFBRJyAfBT8J h4wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ixzgO9pN; 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 ca1si767115edb.162.2020.10.23.06.31.08; Fri, 23 Oct 2020 06:31:31 -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=ixzgO9pN; 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 S374585AbgJWCZP (ORCPT + 99 others); Thu, 22 Oct 2020 22:25:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53442 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S374548AbgJWCZP (ORCPT ); Thu, 22 Oct 2020 22:25:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603419914; 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; bh=XBDq/dF8AYxxnodSggGeabhLd4I0L4Fwx/764jAbR9o=; b=ixzgO9pNIZEeEuToSsBhCjUwOYGJ4zT2Vahx416uRMGGTKmkx9zirNivF7hgO0eh+PxDGh 2NMeyXxZsu7I31UG5eedd2abK1wQAQDUtuy3HaFwV7aAsmOjjVFF1gx0EFs5PVFK40usYC IPi8ioAAU4n5QldnvVZCnx3z2k40mL8= 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-542-6U_Og_7LNIK37hqKnwp8jw-1; Thu, 22 Oct 2020 22:25:10 -0400 X-MC-Unique: 6U_Og_7LNIK37hqKnwp8jw-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 585C080F044; Fri, 23 Oct 2020 02:25:08 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-85.pek2.redhat.com [10.72.13.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E9985576E; Fri, 23 Oct 2020 02:24:56 +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 V3 0/3] vDPA: API for reporting IOVA range Date: Fri, 23 Oct 2020 10:24:51 +0800 Message-Id: <20201023022454.24402-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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, the IOVA must be allocated from this range. - 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 and then guest IOVA allocator can behave correctly. Please review. Changes from V2: - silent build warnings 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 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 | 40 ++++++++++++++++++++++++++++++++ include/linux/vdpa.h | 15 ++++++++++++ include/uapi/linux/vhost.h | 4 ++++ include/uapi/linux/vhost_types.h | 9 +++++++ 5 files changed, 80 insertions(+) -- 2.20.1