From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 AFABB3BFAEB for ; Mon, 17 Aug 2026 21:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787001141; cv=none; b=WsG+HbGTXdWWXCs7TfIjyqr/r3Cv8ojs7Ac9parQqt0QMNn7R6YsiYPqKVKfP2Puh9zvAsBWS0QovEfSQ8gdzQGTuaDdGvwl/MCHUGsPSw/LbOXB3l26+/c68eQubfcYyA///InSa/YqFYQ1Grb3gOubx5BhJxgXxk7PC8V23Zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787001141; c=relaxed/simple; bh=feYyRrzAVrbwe6Q6bLDQHGa2NlKsylvjthlQKxO/EoU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sEDzbboOrhkkS/WjCUAtsp2gG8NyOoJkz67H3MUSRY+Pi59wKvRIWr+vY62euJccD/pHozNn9/tb2BlTs2MLqi69fgt7t8L2HwrEwqZ8PNdyMvAWPeprjQ+jBfph+xc3Lo4pIMBNiiXmDwCDqA5g66xLWITPe/IDZLtBld+5xck= 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=pJPP0kCJ; arc=none smtp.client-ip=209.85.214.180 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="pJPP0kCJ" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2ccdf36f63dso29105ad.0 for ; Mon, 17 Aug 2026 14:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787001138; x=1787605938; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=oma5+/tlfa1RRzhj7JpkkV8zgHZVnZM8SsuwDuMX0+U=; b=pJPP0kCJfa9QrYBixCoeq2+YRoTfFkLjFn/ZVuqA2Z5PrunHn/mB/x4LgER6IWJeB6 /aWw5JOELEvrtTlJfUPzqnla7hYeDenlaNegMooYKpy9yagxRqA+8p6xkkBAbQQfCBdQ 5gB8cm89oaw4xww7n7GFetCevia10JU5DhrNN+JEQZs4kekerVFflBoIK4n0/WnWgw7M r/PsVcFODAaheGrcn/kJWtcWhvS4DOoeFXANPA/eGGt6Au5x1fIyONsQqgJ8Om3PKIzr tFNKq8Ascwdj+Oy3kRHbzQbK1DqcIEfPf+gbjHc3it3XvoEaKWgpKzCqK6bpH+4Jyq6E lygQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787001138; x=1787605938; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=oma5+/tlfa1RRzhj7JpkkV8zgHZVnZM8SsuwDuMX0+U=; b=iUbkmFrgWXwGGNMd9XUUrxJm/JPrd1jUUiA6jxNVbHH88MIdBFP84Vpn+vthlmDKon +qZPDMVQhAysF4aDT/9FcDZhYqPfVZtvsJLm+wXj7ecGvBfopMIhQXPHvZ2P8Xl/Y78m seei+qyQ2yCLD7SxSk81Qqr+0zTaFZ1iYYVFeXTO6HtW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01a7336-2d5ccb2615emr3070545ad.1.1787001137341; Mon, 17 Aug 2026 14:12:17 -0700 (PDT) Received: from google.com (210.87.127.34.bc.googleusercontent.com. [34.127.87.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d5c1e528b3sm7631765ad.46.2026.08.17.14.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 14:12:15 -0700 (PDT) Date: Mon, 17 Aug 2026 21:12:12 +0000 From: Samiullah Khawaja To: David Matlack Cc: kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, Adithya Jayachandran , Alexander Graf , Alex Williamson , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Jason Gunthorpe , Jonathan Corbet , Josh Hilke , Leon Romanovsky , Lukas Wunner , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pranjal Shrivastava , Pratyush Yadav , Saeed Mahameed , Shuah Khan , Vipin Sharma , William Tu , Yi Liu Subject: Re: [PATCH v8 01/12] PCI: liveupdate: Set up FLB handler for the PCI core Message-ID: References: <20260728221007.2098560-1-dmatlack@google.com> <20260728221007.2098560-2-dmatlack@google.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; format=flowed Content-Disposition: inline In-Reply-To: <20260728221007.2098560-2-dmatlack@google.com> On Tue, Jul 28, 2026 at 10:09:55PM +0000, David Matlack wrote: >Set up a File-Lifecycle-Bound (FLB) handler for the PCI core to enable >it to participate in the preservation of PCI devices across Live Update. >Essentially, this commit enables the PCI core to allocate a struct >(struct pci_ser) and preserve it across a Live Update whenever at least >one device is preserved. > >Preserving PCI devices across Live Update is built on top of the Live >Update Orchestrator's (LUO) support for file preservation. Drivers are >expected to expose a file to userspace to represent a single PCI device >and support preservation of that file. This is intended primarily to >support preservation of PCI devices bound to VFIO drivers. > >This commit enables drivers to register their liveupdate_file_handler >with the PCI core so that the PCI core can do its own tracking and >enforcement of which devices are preserved. > > pci_liveupdate_register_flb(driver_file_handler); > pci_liveupdate_unregister_flb(driver_file_handler); > >When the first file (with a handler registered with the PCI core) is >preserved, the PCI core will be notified to allocate its tracking struct >(pci_ser). When the last file is unpreserved (i.e. preservation >cancelled) the PCI core will be notified to free struct pci_ser. > >This struct is preserved across a Live Update using KHO and can be >fetched by the PCI core during early boot (e.g. during device >enumeration) so that it knows which devices were preserved. > >Note: This commit only allocates struct pci_ser and preserves it across >Live Update. A subsequent commit will add an API for drivers to tell the >PCI core exactly which devices are being preserved. > >Note: There is no reason to check for kho_is_enabled() since it can be >assumed to return true. If KHO was not enabled then Live Update would >not be enabled and these routines would never run. > >Reviewed-by: Pranjal Shrivastava >Signed-off-by: David Matlack >--- > Documentation/core-api/liveupdate.rst | 4 + > MAINTAINERS | 13 +++ > drivers/pci/Kconfig | 15 +++ > drivers/pci/Makefile | 1 + > drivers/pci/liveupdate.c | 158 ++++++++++++++++++++++++++ > include/linux/kho/abi/pci.h | 63 ++++++++++ > include/linux/pci.h | 1 + > include/linux/pci_liveupdate.h | 30 +++++ > 8 files changed, 285 insertions(+) > create mode 100644 drivers/pci/liveupdate.c > create mode 100644 include/linux/kho/abi/pci.h > create mode 100644 include/linux/pci_liveupdate.h > Reviewed-by: Samiullah Khawaja Thanks, Sami