From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 05F52402BAA for ; Thu, 12 Mar 2026 23:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773358802; cv=none; b=rXr8YdV7GMSyv3oUlRP4/5juiveCtVinW0R7ZGTNOSxuLt54B3SO85v2eFMgHf3joG63QPM13kP0TBzoGIz2/Xo94EcO1KCYgtSoiXDjYfS5KdAh7DLfafabEcz8NyIBgh0jlcpMpFMuz1LtrNt31rH4zRTpMnqVvGMgx05GUwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773358802; c=relaxed/simple; bh=81hZpTskJlFntcFcrcsvS621z5Do+6xd4roaKHgFHv0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tq7VVVXkGeptxUnUrFTdP60lQbl9ecpVj4CBwxphI5V6I4/0AcG/fG8cwgJT6xFjLf+kC3xIGDvBWB/5J1/wJ40rExZzHA6JQNN8nW8lV8XJik963p/ywmUw3Cj+pEuVjqQraufthFqKbSpra3eUMOin8vHh55PE7GXUDoV9sqg= 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=LnBeq2Ms; arc=none smtp.client-ip=209.85.216.48 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="LnBeq2Ms" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-3585ec417f6so1054064a91.1 for ; Thu, 12 Mar 2026 16:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773358792; x=1773963592; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=tuWxuj0biLq2l1xmhqHdX16m/kzH5EhGtvvF3ksAcvQ=; b=LnBeq2MsYNkTAUb/gwTtRRiwFNNanz9QHKP9iEuwvyFzO/37X473MTF/nXNH/ASNyb kktVYJ4ahAJb8DlEpFzVAHRYeanCsULKdb4log35YXtaUOibA5yu6B3m7UYQxPKPaayR FSgNuSXraEIrtT4WElxvBgJyGdOzMDaEkWuXR1CNN32r1G8DfhvBexkWugm57TCbbmoG FMGvr2nrcW3JFiLg3yK9xWcvablnc4llNnYQ7edSId/qnOkl2xsUTBawd2Y3nbtgNXLT rK2inuPCPzT4FQmuo306fRRpaOivJiOMLW8+umhrraM+IIkynobueBQkzMBcSy8hpd+4 4duQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773358792; x=1773963592; h=in-reply-to:content-transfer-encoding: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=tuWxuj0biLq2l1xmhqHdX16m/kzH5EhGtvvF3ksAcvQ=; b=Wp8yE9gaECnGF59vU8AG/2PjN7Moq4X2xuStTF860ybShJGWI1wUEKyB03DwjrB5g3 5UXyUbVDeqztBoFVf7UmmXp+K8qxfKU1rL/9qlkqNCIy2sqDdC2eEibXmPP9akvOQ/3M 3tBJUWxkXqqRMB5qq8spxDf0e2rorRGpLr31bx60GTZ6RZZU+VAg4IExU2T4SORV7D1h nM1ne1RrphxOFaPo49g4fyJ1XuJlCVQHtoDBmxEKgrbHQ+EmSFNSOi/0EOjCAv5ij6TI iFCgqY6Gxs8QaJjYzGPPF7AdHU77ivhbQNUJfy7m+9iuF69a7YPTco7VMJNvtXaU/XD1 6NWA== X-Forwarded-Encrypted: i=1; AJvYcCVWXk5K1Y7yJC11H3QJirpGRoZa2FtA5+CfmrvSsqc1V7raw1JiwDFkarOca7Gd3vd2N+z37K+zTqkENmY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5/7E+ADnypaQFLRYjzcAN8Pc8qwkqppOpmFmNKmw31Nz82tYg sWnDGhTdKdiPKMlmqAk9BuUs38YGpttQSMRJ48WHphFYgmrxV7pdmIDzpXm3xmN+ew== X-Gm-Gg: ATEYQzzyXrH7JFnTbds6QIfFX1lHAfY9n5wkyDpTP5B582Tt5DsjfwbsvJOi+9B1rAo NZROyZs6/j1PfY4iT82WapqqQm0NhMfsNimHYGt0VvgRMWrkMQDBNzf5/bwE9eRIKpUprzzT13n GdS9cpob7OgYlIRHGUgzrtxf2ZUPg3v41qdX6eiB2xRIL8tBi4pzFqydfsl1GmEhm1vWEX0S5P9 kZpNAIKhG/R04fyXLl+u5EdT3mu2RKPUJHNj6tw5/Wk2PmwV7oT6/imqMSd+FSZo30ukqeZWPzx Y1TvutcsrpU/J4Z8QU5rTh9tsbvCEQOLcE2JRz2gBI+jduizKPHsPl0hSsJlFsQdKEvduCcMukw nc/1JqyEhAw87Kg1/b9YhWbUHDG0Z+bWqDMYZnAqkRrlUY3BlHhvZtI2sUj3/eZcuWeOoLTD0dH uySIT30UYQJoDDYIZw9b5ll0AhdsBG9lzyfyPvn8B509zGPymnlAXdOBMxZ3m6rA== X-Received: by 2002:a17:90b:3d4b:b0:35a:117:9521 with SMTP id 98e67ed59e1d1-35a21fdb67bmr847337a91.10.1773358791623; Thu, 12 Mar 2026 16:39:51 -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-35a03034401sm6609677a91.16.2026.03.12.16.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 16:39:49 -0700 (PDT) Date: Thu, 12 Mar 2026 23:39:45 +0000 From: David Matlack To: Alex Williamson Cc: Adithya Jayachandran , Alexander Graf , Alex Mastro , Alistair Popple , Andrew Morton , Ankit Agrawal , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Jason Gunthorpe , Jason Gunthorpe , Jonathan Corbet , Josh Hilke , 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, Lukas Wunner , =?utf-8?Q?Micha=C5=82?= Winiarski , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pranjal Shrivastava , Pratyush Yadav , Raghavendra Rao Ananta , Rodrigo Vivi , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , Tomita Moeko , Vipin Sharma , Vivek Kasireddy , William Tu , Yi Liu , Zhu Yanjun Subject: Re: [PATCH v2 10/22] vfio/pci: Skip reset of preserved device after Live Update Message-ID: References: <20260129212510.967611-1-dmatlack@google.com> <20260129212510.967611-11-dmatlack@google.com> <20260226170030.5a938c74@shazbot.org> <20260227084658.3767d801@shazbot.org> <20260227105720.522ca97f@shazbot.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2026-03-09 10:32 AM, David Matlack wrote: > On Fri, Feb 27, 2026 at 9:57 AM Alex Williamson wrote: > > Sorry if I don't have the whole model in my head yet, but is exposing > > the restriction to the vfio user of the device sufficient to manage the > > liveupdate orchestration? For example, a VFIO_DEVICE_INFO_CAP pushes > > the knowledge to QEMU... what does QEMU do with that knowledge? Who > > imposes the policy decision to decide what support is sufficient? > > Hm.. good questions. I don't think we want userspace inspecting bits > exposed by the kernel and trying to infer exactly what's being > preserved and whether it's "good enough" to use. And such a UAPI would > become tech debt once we finish development, I suspect. > > A better approach would be to hide this support from userspace until > we decide it is ready for production use-cases. > > To enable development and testing, we can add an opt-in mechanism Here is what I am trending towards sending in v3 as the opt-in mechanism: diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 1e82b44bda1a..770231554221 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers/vfio/pci/Kconfig @@ -58,6 +58,27 @@ config VFIO_PCI_ZDEV_KVM config VFIO_PCI_DMABUF def_bool y if VFIO_PCI_CORE && PCI_P2PDMA && DMA_SHARED_BUFFER +config VFIO_PCI_LIVEUPDATE + bool "VFIO PCI support for Live Update (EXPERIMENTAL)" + depends on LIVEUPDATE && VFIO_PCI + help + Support for preserving devices bound to vfio-pci across a Live + Update. The eventual goal is that preserved devices can run + uninterrupted during a Live Update, including DMA to preserved + memory buffers and P2P. However there are many steps still needed to + achieve this, including: + + - Preservation of iommufd files + - Preservation of IOMMU driver state + - Preservation of PCI state (BAR resources, device state, ...) + - Preservation of vfio-pci driver state + + This option should only be enabled by developers working on + implementing this support. Once enough support has landed in the + kernel, this option will no longer be marked EXPERIMENTAL. + + If you don't know what to do here, say N. + source "drivers/vfio/pci/mlx5/Kconfig" source "drivers/vfio/pci/hisilicon/Kconfig"