From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26B08C433B4 for ; Tue, 18 May 2021 19:01:29 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1F21610A2 for ; Tue, 18 May 2021 19:01:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1F21610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=872Iyb8UCEQZOAgKy2fcrl12yxSUg4E6t86lB3fymMQ=; b=MR2MbblSkObb5htCGs2UP4+Uj SaeYT5InzLeK50bHnB5XSd9uJ2pb3DVQYB62fSx5jLqGpAAzRa7qZ4hiflSu/eLntfWSm6h/PTIsB 5aCc/4w/1ZOH9yLeEcXn9VSxPwOyp4HqgVi9+d45458ik2sG/fcIuTQhh2pJPoOuadfNp3j3yKrHm 3UefDOqKhSFk+ZprFK4bDau/lgj4H50vj9dkTHQzrWRNN7/fHdxzvwFcjJv94yogGeL+3TSBOZ4Uy Z9zqJKGep55LHD4ACzWu7rbOsQyb5Umef9SWxx3Z0kLuDxCNP2ng9F55P09IyQfm0jZmxqf7D+/Is ufbCGKowA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj4vv-001fgi-Qj; Tue, 18 May 2021 18:59:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj4vs-001fgK-R4 for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 18:59:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=62kI6pIOIPdtKW8CJ7bGGrK3d5OmdLNd14MdZWiAWKk=; b=RvPcaqqYLQx8156zomqLT2Jfvj bjmEoPuNQcly43snvbJQ8iKtGRtP/hBQtqT3srqXUsFcLC3mHb5VCAboEu9LstGh0vGAYOASdq4hb RCaGzatWBP5Zr8B+SWD2UXSQh04bEkXp5+KhfFwXz6WnU5iPYgFlT4w3AZj+9VzDj1vBYcOjoO3aR TQt/EICfNS/ymDyp0Iphvd4ZyTA0wWftc15IDKPLoSz3wcKU32DJymkM8y3YRrMIvNHbBNX9BZhTe 2kk+zVucnHNTGEysAbyV2hSYiNc4nyoqSSQN7TLT8EtzZGapvvnEgAkM2UN0jeatoMzxM08HMtiDz OL63qasg==; Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj4vq-00Eteq-3C for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 18:59:07 +0000 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 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_115906_246396_AB54F9A3 X-CRM114-Status: GOOD ( 12.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel