Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1689761pxj; Wed, 19 May 2021 11:31:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSNfVQtfA0OdjiAt+1DHgHkP+XpYffmvki9r5kY95qj+FvGG2NuudxP6+tHuZsna6iZJK8 X-Received: by 2002:a50:8e44:: with SMTP id 4mr438926edx.244.1621449118549; Wed, 19 May 2021 11:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621449118; cv=none; d=google.com; s=arc-20160816; b=dpi/m5gSo9gI5WjmrgOGs92wDxTBG0kVSTrp50Rnj9jcMeifGrxPdiuKLlPD8oaR7K gpXYTPCRWqx1FjQS3Vdds13Wuf/YifYJh0be3nTfuBrx9aP8VJX6g0D4Wz4oCnOxrbzi DbnTmTkNHPaOly+mwXW/ePrH4+34NbsSmLLaWNgRJv5nyuGv2IkIrKhcjki9lvB2xaGa ysaQ3fXptEPdAy7rlbGVjVPqj3q9Ou+MTqt/yd2CN4OoHHc9V77u9mhQbpFbIBJ1B5KI 4PK1nIljfa3dbArJbuA0xv/ahc14Uf7WUEHzRCt34EZPMSayaoV2EcWVmFqxPUI/fz05 YY3g== 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:subject:cc:to:from:date :dkim-signature; bh=62kI6pIOIPdtKW8CJ7bGGrK3d5OmdLNd14MdZWiAWKk=; b=ura+xtJsTfFCOCON0j9umWgDpjED6Nji93PrYtqqj0sMJD8A8xXngoHvP9fnNW3kbw DoJgknUGiJWFIdLjEXtaK0N4dxJfsFQ41MI+N6iFCcLdCgSaHKSMc3Ty5lCMYqh1I70p Xy/NUB43bOtXBb/o+b2YNfX85kCcGJubuKPiu7vVsWZk/FsW7NXdwLXanzOcKmYzlOAy HNaVip2ssPnknKPEHlajXj5MdHUgkvu7GBp8FqVxJdRwkF8OLs9jPboimSKdZ0JNz5M7 dHPZvZDXB2JgB62SGRITZEpZsDo7rBusEPWyYzzt1RhcNGJKM2GpgH3wTAsjrpM5MB1r N6cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C9lLPZb7; 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 t21si6790edd.145.2021.05.19.11.31.32; Wed, 19 May 2021 11:31:58 -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=C9lLPZb7; 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 S1351723AbhERTAW (ORCPT + 99 others); Tue, 18 May 2021 15:00:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35549 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242280AbhERTAV (ORCPT ); Tue, 18 May 2021 15:00:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621364342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=62kI6pIOIPdtKW8CJ7bGGrK3d5OmdLNd14MdZWiAWKk=; b=C9lLPZb7fSNJFwVARtTVQxTl6hlvqvNys02zevgAh8FfkDzCGmpWHC+cgvFl7vqf1tDuBZ zrS/Muwwi7wtYP+TZcofUGKA7PP6qMI8g82nIFvHra7nEBhETsCjpl/bViGDSKBtaNSjCi dZvuTiT/z/QhOarn6Gk0B9U2MDS8JN4= 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-463-yWhZ7rJ4PVKo-CwT45TI7Q-1; Tue, 18 May 2021 14:58:58 -0400 X-MC-Unique: yWhZ7rJ4PVKo-CwT45TI7Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95E3B801106; Tue, 18 May 2021 18:58:55 +0000 (UTC) Received: from redhat.com (ovpn-113-225.phx2.redhat.com [10.3.113.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 730F61037E81; Tue, 18 May 2021 18:58:49 +0000 (UTC) Date: Tue, 18 May 2021 12:58:13 -0600 From: Alex Williamson To: Shenming Lu Cc: Cornelia Huck , Will Deacon , Robin Murphy , Joerg Roedel , Jean-Philippe Brucker , Eric Auger , , , , , , Kevin Tian , Lu Baolu , , Christoph Hellwig , Jonathan Cameron , Barry Song , , Subject: Re: [RFC PATCH v3 7/8] vfio/type1: Add selective DMA faulting support Message-ID: <20210518125813.7b8a78f1.alex.williamson@redhat.com> In-Reply-To: <20210409034420.1799-8-lushenming@huawei.com> References: <20210409034420.1799-1-lushenming@huawei.com> <20210409034420.1799-8-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Apr 2021 11:44:19 +0800 Shenming Lu wrote: > Some devices only allow selective DMA faulting. Similar to the selective > dirty page tracking, the vendor driver can call vfio_pin_pages() to > indicate the non-faultable scope, we add a new struct vfio_range to > record it, then when the IOPF handler receives any page request out > of the scope, we can directly return with an invalid response. Seems like this highlights a deficiency in the design, that the user can't specify mappings as iopf enabled or disabled. Also, if the vendor driver has pinned pages within the range, shouldn't that prevent them from faulting in the first place? Why do we need yet more tracking structures? Pages pinned by the vendor driver need to count against the user's locked memory limits regardless of iopf. Thanks, Alex