Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp68676pxf; Wed, 10 Mar 2021 00:08:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwC3G4FveiTa3jp/GmJrXNYmpwwDP/9PpKDKBrxK5Dd8muP3Ra4oVVTxNa4IkIA0By1abgb X-Received: by 2002:a17:906:a896:: with SMTP id ha22mr2291565ejb.503.1615363732428; Wed, 10 Mar 2021 00:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615363732; cv=none; d=google.com; s=arc-20160816; b=0035qfRkchi5T/GXkSH/1KdqLlwDW9dpPtdovjU18zMNyFEdq+Q5TnoveIc2UTHVf+ ntiRAYN0o3+coZHvWYDZsCuL0KT+WN0tSa4naRdlMRAUlzPTCqt4CtkAxAVK6QEpmhKn Y4AGwirfBvwZxG2fsqir3zCXQqe2+VFq3XfOfEUkGbH1iAQv41UG2eL+lHe/JUdz93+3 0nMXnOF19f8UtBuRbzkAFFLiYWL37rWJWMIqKMU7SOd2+mT+VjBHx9scNW8z+ZHAHXsT DM73U6dfJo/1LEb0+9nIWrbNzvQqyvl4y1HJ5vS5cCkAs5ANN1/SP9ICCK/u3FnWyQFd 2Vjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m7vmehVG7oO9qabFkyYe2PuNA+zX19AuD9m9j6F9h3o=; b=gMkR6ikhmhJD8weD2EdtbAPy6a8dT12vOBAP1MhK9npKZ6c1SD8zgk0CSE0h12cSVB LpBT7jTPuXUTg2SX1ds/58XE+1oegWjDaTqj7s3NgqwMlsE/1igikVPhngrP4Gg+5aVq K3fQHxe1LdoG7WhGdFUZcGqLSNuJkK4h0WMELQ2F4vHRyllCCuHkyeKb7yXqScRGy6/Y TEN8udUB7HD1C7F/YltZjsKaAWo8/wiPjZNDZfhR7w2L4ZNlbwz+cnrrgNFIBgenMaVw +b+VhBdkSibnuzU/PdQg598L0w7bd4nm9zL4vc4ZaIq3iq1mI886rNHdSdA8kgr8JIHF GhPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MxAhLHBJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si717406edb.287.2021.03.10.00.08.29; Wed, 10 Mar 2021 00:08:52 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=MxAhLHBJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231843AbhCJIEm (ORCPT + 99 others); Wed, 10 Mar 2021 03:04:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbhCJIER (ORCPT ); Wed, 10 Mar 2021 03:04:17 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54C2FC06174A; Wed, 10 Mar 2021 00:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=m7vmehVG7oO9qabFkyYe2PuNA+zX19AuD9m9j6F9h3o=; b=MxAhLHBJCSxXNb2rhkwDa7lqqP hc95I57qL/cR4qO72l9jqzsqRRWJr97fynBenR/WulxAhciyd3jLRJk/5i/E8mr9rhs612A/dhfZx NfusLgBdvJFEIKrlpwAk+k65Fv3VDIUkcD0RvsHxAWU03BHyfkRTRoBqyMkyllsPAynXaWf2dAF9z QVJGScRrG7Tfl8sNELWHSh0VfV5p745eFlbPuJCg9YDA27wlgii9WM4vph7L/WfXThZXF2wWLPDvN nEvQiJ4oCv0Znd2XZBsuUBbziNuIIURmMCW5OlOXI25cMgOhHtO8z5wdGs+0VGy7jWgdEhpBCqrST Qyw7P9CA==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lJtp0-002oaw-Tq; Wed, 10 Mar 2021 08:04:01 +0000 Date: Wed, 10 Mar 2021 08:03:58 +0000 From: Christoph Hellwig To: Alex Williamson Cc: cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jgg@nvidia.com, peterx@redhat.com Subject: Re: [PATCH v1 11/14] vfio/type1: Register device notifier Message-ID: <20210310080358.GD662265@infradead.org> References: <161523878883.3480.12103845207889888280.stgit@gimli.home> <161524015876.3480.18404153016941080011.stgit@gimli.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161524015876.3480.18404153016941080011.stgit@gimli.home> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + > + if (!dma->pfnmap) { > + struct vfio_device *device; > + unsigned long base_pfn; > + struct pfnmap_obj *pfnmap; Please factor this whole block into a separate helper to keep it readable.