From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 88D0738B7D9 for ; Tue, 24 Mar 2026 17:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774371962; cv=none; b=ebc3gb4X8iXVSfiRYasd/bEu7brZKecmSyLKU5zrLHba1PZBYd4sChywo3oL9T8MFqj2MVVzL/35tRzHgr7dxW3StULQqgR2adTKkjx/XRGWxyj4HIHqf2bO6wGFwTa3lVVLWvnKgZm0amwoq3vJJhNc7whbDaRV3rL0bXPqiXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774371962; c=relaxed/simple; bh=5Sv9xAJZpaaT64nid3Je6B7u2J/2/RXvcmlIiaS9WJs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MjTU6+KMND49MN5b2Pamw9EA3iD3qeke0oOhsZqXZ7kbghF2AjKhgmxN7QtlD50ej6fcUQRXvdsCOwT8xjO69FqWuzEECr4BpQ99f1YxFcFwG9yIXZOttr+6ywuxhAO57exG32Lx30sCoxd/2D60wI46pZRgby8kgjjuiMIPi+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=F+ocCLqH; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="F+ocCLqH" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-35a09e0dd63so5524171a91.3 for ; Tue, 24 Mar 2026 10:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774371961; x=1774976761; 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=oHY3J33g6ujwnRTqJrGO/jD1PTpcRqvXhZiCbNP/dps=; b=F+ocCLqHYAl+5Nc+4oVSi7m0MB45HhMwwGram+xxk+ok4l5Rgi55wO5VdXordRD9n3 JqHAZNOJ3l5EmfJDXbH9R3Zs6GcE8DVzMsqQciMx5+ccLWQulqC51YKSLjC031syfrLR 8LRl8tIr8z2MTLzw/wb7/S+QzhUNxoNYlb5k7OFDYTKid7ZJwMH0TxTrZ0uSf2U+HMDf eCpbLo1ex6VU/MjzjpkFwcn0kHW+nvSCnTZ2pfYPs3EjtXKvZDr6D5msjGik81+r2mtz zokKo3/2k5YytK/jpjzakodzAOIhLsQ8dJcPgCgHQU2kqCNu0fvm+zHQglERoWcLPK0b O7tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774371961; x=1774976761; 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=oHY3J33g6ujwnRTqJrGO/jD1PTpcRqvXhZiCbNP/dps=; b=ePxAP3Gsg6LyN3+JyA04uruDLxItaUwc7xt/J3eFrEi2hzGowHMQXtlLHO0PVjlq9T oW5yzshLgqDe9vVAq8y8Gp5SeTSzpitWZxIy48T/n19/4tN00CC0VWJgEhrT7F5PpvxS 2EfkJ7tiVGqjpg01IqivFT8MHbmdVQC0Q55HzM8zU+ERcGKnpY+rmo/6P3NVCtJie4NB ufyhwi8TESlW7Nf6n3hmmFpAp9GFmVEMJQQgarrZlYzv+wS7j7brVq3EwUTKx2Ln0eat yRtLmlbiA/HjC/twHgMyRZJcnniZdNOKRKtO/fBGDsDTcAk0wOOM/MreuR1291squ7vL GxAw== X-Forwarded-Encrypted: i=1; AJvYcCVLzSdeJ39XlggiIyM4xm38mt+uzuyGF91J1mw8JJcBi/GHt7vy7ciebyVaQpNQYeCpZ/kCAWMYToyG4cI=@vger.kernel.org X-Gm-Message-State: AOJu0YwPnn61Yo5DeOpckM1R1o0jgNiSnm/Z+aN+Zk8CsEnT5A3cDpMx CRY94KP1QxcUNHRA7q+eWswjz90VEPb9gAT03ccz9iRHb8f4Aqobm2z0EqHMVRjkRA== X-Gm-Gg: ATEYQzwpX8mEk6xSD9h0teRBGwoigZELlFiTcHN5tgiYzw2L2ZByVZVOj+0eQWHKh8T lNhJ3VR6W4KdWCYArJ3mqijShx843rTPuazVoUsCbmtG9EjCiobQ+nNtpyZSY+cuPDPKqW3W0rb bqzy64AlaPvfojUuciadGI7U66kzyvqU5tShks0az5qgPrAlvvm4iWxUmfHl4YkiVjSX5rfuG0o znEmUOv9KH1jwaa+Wr0rwwgiqUBlwjxUVYFIEc4UDCM9K+qXh8bPfUs29VCMQubw8Q5asLY9VnC cEU/Ol0xn26bVllWkvHKWXZEci6W05Am7s81ccfDV/qdI9oYQOEs9AMEzriHthwAZJ/50kJaEIl G7onLcEfbTuGEt1J0VR3hYmJ7W4FJdjqg2I6sE9ByyEt45dL2+YglcM8rpxmHGS3ZRVBmjPPnQ1 7VgF9A8og1MCubgwfYxOxkZOkFkeG49DdhBeUlPY1AfG8JdUkbkD/KyT1ByuWQcg== X-Received: by 2002:a17:90b:2249:b0:35b:a53a:7d0b with SMTP id 98e67ed59e1d1-35c0dd3ae00mr92968a91.20.1774371960194; Tue, 24 Mar 2026 10:06:00 -0700 (PDT) Received: from google.com (239.23.105.34.bc.googleusercontent.com. [34.105.23.239]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35c03172a8asm3524836a91.15.2026.03.24.10.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 10:05:59 -0700 (PDT) Date: Tue, 24 Mar 2026 17:05:55 +0000 From: David Matlack To: Yi Liu Cc: Alex Williamson , Bjorn Helgaas , Adithya Jayachandran , Alexander Graf , Alex Mastro , Andrew Morton , Ankit Agrawal , Arnd Bergmann , Askar Safin , "Borislav Petkov (AMD)" , Chris Li , Dapeng Mi , David Rientjes , Feng Tang , Jacob Pan , Jason Gunthorpe , Jason Gunthorpe , Jonathan Corbet , Josh Hilke , Kees Cook , Kevin Tian , kexec@lists.infradead.org, kvm@vger.kernel.org, Leon Romanovsky , Leon Romanovsky , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, Li RongQing , Lukas Wunner , Marco Elver , =?utf-8?Q?Micha=C5=82?= Winiarski , Mike Rapoport , Parav Pandit , Pasha Tatashin , "Paul E. McKenney" , Pawan Gupta , "Peter Zijlstra (Intel)" , Pranjal Shrivastava , Pratyush Yadav , Raghavendra Rao Ananta , Randy Dunlap , Rodrigo Vivi , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Vipin Sharma , Vivek Kasireddy , William Tu , Zhu Yanjun Subject: Re: [PATCH v3 08/24] vfio/pci: Retrieve preserved device files after Live Update Message-ID: References: <20260323235817.1960573-1-dmatlack@google.com> <20260323235817.1960573-9-dmatlack@google.com> <815947ee-2603-47f0-9b03-f523601eae86@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <815947ee-2603-47f0-9b03-f523601eae86@intel.com> On 2026-03-24 09:08 PM, Yi Liu wrote: > On 3/24/26 07:58, David Matlack wrote: > > From: Vipin Sharma > > > > Enable userspace to retrieve preserved VFIO device files from VFIO after > > a Live Update by implementing the retrieve() and finish() file handler > > callbacks. > > > > Use an anonymous inode when creating the file, since the retrieved > > device file is not opened through any particular cdev inode, and the > > cdev inode does not matter in practice. > > do we have a list of struct file fields that do not matter? My understanding is that VFIO only cares about these fields in struct file: - private_data: Pointer to struct vfio_device_file - f_op: Pointer to vfio_device_fops - f_mapping: Pointer to vfio_device->inode->i_mapping This is based on cross-referencing VFIO_GROUP_GET_DEVICE_FD (which uses an anonymous inode) and the cdev code. > > +err_free_device_file: > > + kvfree(df); > > any reason to use kvfree()? No this can be kfree(). Will fix in v4.