From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10A6A24466D for ; Fri, 21 Nov 2025 00:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763684629; cv=none; b=lWvvEvKTDTYYAza9d+Q8wSTs8+gc0vyVjc75okG60sbko/O5nGgD2dH4vOeZ8Mx7C+64haJ+EJMXbGfkvzOOlP6ohOI5135ME0ASNej4vz8dBg3oBA8q2dK1CZN7uw+8jjhJTaBbAUTXeNQMBJdhvL7w4izveEL99SL4Cz6URXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763684629; c=relaxed/simple; bh=rSFCVYBQGHYIVw4AaRKYw6Ay38HyAtjHDSJOWPLks+s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ANSMFktBmjJjzVahrG5RhY4gLyrzNSdG2G+MGp55ScBaplrnzDexbnglq8prCliJFzN7rnMPAPM8tAfrFVo1qbasy+JZHvd6Zf9TiTPFGXUoVRg7TaxREB0hplkF2+wlyUfIyV4EytfO2+LuZSffHUbggiHi23rNonEIxQYi//E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=X0nsss1q; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="X0nsss1q" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-88242fc32c9so17085736d6.1 for ; Thu, 20 Nov 2025 16:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1763684626; x=1764289426; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=HeoQ6A9zQA47pPVQ4WN0R1Mr0WB5BGBDvzJz+/SIjn4=; b=X0nsss1q1dQAqvVQCjfcM7UUewWlBvLurLKTQOkoLVBJ11Zbv8ClxmGVsU1Bo6EF5b qB1Gi2Yhtkul9cgel4Ab+PKL3kmhaxR19s/esS9Nary6n06TyegRG022N0a1RmQ8sFQJ Ar/lOjV0WQuho9a2OOlwX2VRTf+i183+ahDzvYQdBGOKzztulAsjTqiXgnQP438u63kz 84HsJu/Oi7pdM7HSBpBL0ajrrzV4LFaclFsAjGqTlANxGvWpGEGC8h7B/dZ7yx5ZuK5v 9BQIRbH7CWDiUe1Y5XDQZyyKT8tkkQWxTuthpFeNHPLVryv7gw6vE+thgY7MLcr+xgTz DZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763684626; x=1764289426; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HeoQ6A9zQA47pPVQ4WN0R1Mr0WB5BGBDvzJz+/SIjn4=; b=Aru3R4pkEpYpwAz16GNEVrRbELd6cURog244teD9l9Ga7QGRFyE5NwKYZAQAfDLYpZ fKtcvHByWmqTkxFn1xn3HEf36l20mFkll9JuoZ/dkL0RoH7Rz4kdmZgcYLPm9nkN/mDn OCSr57hhiM25MYAqNeUxh1qayuSMzQNxNBri7Jb1iCwwqCMlr1rQ3XUzQufuAdKjEmkq SCNKGCF03RPLf1A2wyrQ2CwrWZFK+BCY5EV60DMWBN0zK0ewes6rmplq0PlLcsXpKVSk BfskedlN3dM1tqPdiSsMdV3uLwyNc3WxBDFiTQZ0C2eJtNATcUO8rBiNEFxojO5SmAKK T5tQ== X-Forwarded-Encrypted: i=1; AJvYcCVnCE0MeikTgzoLaP4FexAvyAOQKH7X3bnvOY6RAoyX6E638y0/wphwvkN6UhDC0KOSfu0yKQpgNjQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxMM42rP3HjGkICLdxywLGeOMro+ozEDw66d1hvZXrsCkh/nexo v/CYuM0kgwpuBlkQ7RwsSB8tKRPizH5u5Wa92PYNZvYCG8DeiOHvoLAbJ2dxLvAYcMc= X-Gm-Gg: ASbGnctt+foBagmYZO9WesP/Cj47lZuZILSPV60e+MUJfKw9iBJ5pqPqFn7E1xbQ+tQ qgl/GMMXMyCNPx3jBjAm8QoJk0GS99M3J7gEgs8TkbieT7mH8pwQjDMzD/rmirDtODVvBHeOF76 sey6b2FMt2CAvaFn332q2WnZeBY1TKZzbpaXimbnZFVxv0otUzpix7sLknKCX1g9TDrdMZgwDCH AG6kcyK9nYvgmT9cOF9T63XYm6dLqCSKCciNwj33lg2H+ypzfSS99vsAGa77ouT0/gwVZAzb6Y8 HnFl8yPAb4PFgI+dMxJDLyd1hLs1iuMCK8X/sbExsQtng6obSw4k3Ja16XL89WFurfB6/RBKnbF HrO1s/yME4rUXZcFUhGSZ0Oq/vuUE29E2eDnNYAjgODzmGbjvtKVxGvuq4UdD1uCbPKrAFWk9qE PrrDEojXzyNk7aAo7br32hY3uAbIUrMSaHjVL8h9Un/SBGhnm1f8CvA9yD X-Google-Smtp-Source: AGHT+IF9fpUZC0KSEi60qYSTXqU5TN/0kv3Br6v+7st2smYcT5XQOEwOWy/F2amvDq4QuChbOli5Vg== X-Received: by 2002:ad4:5d42:0:b0:880:2c08:88e with SMTP id 6a1803df08f44-8847c5206f8mr8425876d6.45.1763684625945; Thu, 20 Nov 2025 16:23:45 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-120-4.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.120.4]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8846e472ae1sm27645766d6.22.2025.11.20.16.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 16:23:45 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vMEwC-000000016i7-2ZE0; Thu, 20 Nov 2025 20:23:44 -0400 Date: Thu, 20 Nov 2025 20:23:44 -0400 From: Jason Gunthorpe To: Alex Williamson Cc: Leon Romanovsky , Bjorn Helgaas , Logan Gunthorpe , Jens Axboe , Robin Murphy , Joerg Roedel , Will Deacon , Marek Szyprowski , Andrew Morton , Jonathan Corbet , Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , Kees Cook , "Gustavo A. R. Silva" , Ankit Agrawal , Yishai Hadas , Shameer Kolothum , Kevin Tian , Krishnakant Jaju , Matt Ochs , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, iommu@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kvm@vger.kernel.org, linux-hardening@vger.kernel.org, Vivek Kasireddy Subject: Re: [PATCH v9 10/11] vfio/pci: Add dma-buf export support for MMIO regions Message-ID: <20251121002344.GC233636@ziepe.ca> References: <20251120-dmabuf-vfio-v9-0-d7f71607f371@nvidia.com> <20251120-dmabuf-vfio-v9-10-d7f71607f371@nvidia.com> <20251120170413.050ccbb5.alex@shazbot.org> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251120170413.050ccbb5.alex@shazbot.org> On Thu, Nov 20, 2025 at 05:04:13PM -0700, Alex Williamson wrote: > @@ -2501,7 +2501,7 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set, > err_undo: > list_for_each_entry_from_reverse(vdev, &dev_set->device_list, > vdev.dev_set_list) { > - if (__vfio_pci_memory_enabled(vdev)) > + if (vdev->vdev.open_count && __vfio_pci_memory_enabled(vdev)) > vfio_pci_dma_buf_move(vdev, false); > up_write(&vdev->memory_lock); > } > > Any other suggestions? This should be the only reset path with this > nuance of affecting non-opened devices. Thanks, Seems reasonable, but should it be in __vfio_pci_memory_enabled() just to be robust? Jason