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 634E6C433B4 for ; Tue, 18 May 2021 19:01:33 +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 E38DA60FE9 for ; Tue, 18 May 2021 19:01:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E38DA60FE9 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=dGAu/vrf38kXOA6VzO8se86DD5XQMY+yBbaxXyn8kjY=; b=p0bLYA/1aD8/J2MBeTRH2FrIo 6WlriKGxYOPWIZ1CdzV9fZGuJCROIn3zTLOoEUSpiKIkjySJ8Nva2qLawSAWk+igLA7+XbZrQKh/n cJiGpA5fbvgaVn9vBwTOHmH2mRNDa4CRJd/Uf4efpUYzSoZTp8VxaVUHEaPxPGe9MtPyK5Q5NZJso yx7eVdjJjbfywX8ns8lFs02N/xDRdcJX94vfzf4Zdr5SvtB4lEj43u61IbPH6cyrBkVS49EgFPmZT TgukQz5pxaFVbC8Ybvn109hA40i/Oen/jGtwwhX2hvVrMaGKenRxuk3r9td7Q7kgUmT8XXD1hdfZG zIXor9YcQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj4wV-001flJ-Vh; Tue, 18 May 2021 18:59:48 +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 1lj4vu-001fga-Bt for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 18:59:10 +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=EmvqAF/tGZxnpJT45xMDZ2Iz1NsXhbJqP8uJhgy88+E=; b=2hrznADZy2zFRr1U17+yyy63X0 sIajFSQ2Dr8390cV6PAxd1mIHq/PIhdFGzcj7egqOsJarahVA2lAT5e+mOzorX5kKY2CMOvqnUmoe RiKshrb42zI0iwtcAUbafGF+TDsbRGGA9uLZgp2unPDIP3UhROMvJxxeW3iY+3oqyH7p066ZF3vx9 LdUqkImT/Q3rkQcgOA4Ut/7rfOkJHM+DAvNhKOIpqpjtMurFirwjPb1bLwwCnpmssf3xKfjEUPxsV DwxsqrzOBLJeHyBW3Vk24otdOjy3tEWcXH0O75wPah9a9QkdOGVzk/O4BE/PkyV7B4kixDZEoXB/T +N57E7MA==; 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-00Etes-9B for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 18:59:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621364343; 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=EmvqAF/tGZxnpJT45xMDZ2Iz1NsXhbJqP8uJhgy88+E=; b=e8E9uxQlyBwfTCyl/wNowmTI3LZESH5h39x4YndMDGKzfh2TQ+dUkQV5hsF6Cjy7tocF/U g/ZR9OXQvX2hZsTRphBeJmWOZyI3QKGWNU58yyfRs1L7Z1s4Xcdf1UvBefG7P+DcQ9RPn/ 0BhIa7KXyhveaF8LKEbQEuyJtP0gCzg= 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-501-msU198vYOKCHIds7qVJYZw-1; Tue, 18 May 2021 14:58:59 -0400 X-MC-Unique: msU198vYOKCHIds7qVJYZw-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 ED0AF80006E; Tue, 18 May 2021 18:58:56 +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 E08931037E88; Tue, 18 May 2021 18:58:55 +0000 (UTC) Date: Tue, 18 May 2021 12:58:43 -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 1/8] iommu: Evolve the device fault reporting framework Message-ID: <20210518125843.68552b67.alex.williamson@redhat.com> In-Reply-To: <20210409034420.1799-2-lushenming@huawei.com> References: <20210409034420.1799-1-lushenming@huawei.com> <20210409034420.1799-2-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_433200_3D6473FF X-CRM114-Status: GOOD ( 17.54 ) 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:13 +0800 Shenming Lu wrote: > This patch follows the discussion here: > > https://lore.kernel.org/linux-acpi/YAaxjmJW+ZMvrhac@myrica/ > > Besides SVA/vSVA, such as VFIO may also enable (2nd level) IOPF to remove > pinning restriction. In order to better support more scenarios of using > device faults, we extend iommu_register_fault_handler() with flags and > introduce FAULT_REPORT_ to describe the device fault reporting capability > under a specific configuration. > > Note that we don't further distinguish recoverable and unrecoverable faults > by flags in the fault reporting cap, having PAGE_FAULT_REPORT_ + > UNRECOV_FAULT_REPORT_ seems not a clean way. > > In addition, still take VFIO as an example, in nested mode, the 1st level > and 2nd level fault reporting may be configured separately and currently > each device can only register one iommu dev fault handler, so we add a > handler update interface for this. IIUC, you're introducing flags for the fault handler callout, which essentially allows the IOMMU layer to filter which types of faults the handler can receive. You then need an update function to modify those flags. Why can't the handler itself perform this filtering? For instance in your vfio example, the handler registered by the type1 backend could itself return fault until the fault transfer path to the device driver is established. Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel