From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 2B41D3ADBAD for ; Mon, 15 Jun 2026 22:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781562135; cv=none; b=VQ28PR3zID5Wi2KaO6VSwYb1g5sdsZSA65wetwQ++HRwvl2CuJXBuv1sEopQ/dRmI/CD4kulvFcY7Wiis8W+blQLtECiaBdiJBret5piZDSs3sHbrY4d8mbJwFfZh2q8WyhfLvkL6vERNWA0XBX1oUQU0AwdaPa5NzD8DQBxzyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781562135; c=relaxed/simple; bh=YTsGeFHrlrNRnvh1NKy/H1LYFF1M6SsuTR9Bzd0PtOU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SRQ46WWE561HPG360SRQ2tYnv5247XGLHSiSgXpp/GoWTd2nay6rf76IcpLeFPHr6amrTO/J6ZJcd2Wy84fJKO/KVSBJfFCYG02S0Qi8rb0VyHscprfwYZlR1S4PBxotkfQADrTok8cQVxN/hNdC3+RIqaQLbPgNFsToK1LH5Bk= 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=EpaMHd8K; arc=none smtp.client-ip=209.85.210.174 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="EpaMHd8K" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-8423b08b293so1886282b3a.3 for ; Mon, 15 Jun 2026 15:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781562132; x=1782166932; 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=1hI+H0ca4Dm+4Rh5RqmuKXgYDTibOfqOeSOBb1qqYIE=; b=EpaMHd8KqLqbK2DuCr3DorDsYW8x8mpE6/JAZ3pr1udTpGbF/4i6pQnfBUlh4ANkE7 M5WbjP0RSGumzyCroU4xQgTS6FN2/itPF2BlV0gYd9VeY9cTHA11t2LugtIw4gRRqBh0 B+i3nw2Xz4Xk9DU+BPj4/ZAzRaU7LKiyGIVfty1ZVdrrJX/fcTGiJCEQB3KAEMQ+GKW4 UCQwh00WxAtBoXNr+qaVUVkCRFnhVFST//Bt9aW/NuYcXFfWIHjl8ikPSd+5rzN2vPp+ twIVQaGbvXSDT0fq596kHqDKdRGB62cCdv9g/LfCGddrfEQ2s593dvdFknVJ78EfYYGl 2TUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781562132; x=1782166932; 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=1hI+H0ca4Dm+4Rh5RqmuKXgYDTibOfqOeSOBb1qqYIE=; b=KhIgNQCnjrZW0gSbS3SDyTGiPq7vYaBdcwpqbsgJ5LKPUG92/Jml6xb1bA2AqFa3mm EIaej5olra+jFT++ERczt9X4Yb8OEz+X3IJsbShD2bnMageYCNGGmt/riS471/cKKfvQ qDI6tRqwdnsknlEsly8uNvLVSvqcOfPTTX67MrsOPl8ZWE3U1rDPmdZ+P3HvqCD569rN tXJS8hgYZBLt+rvjl9d63p80OdB+wpgXch7SeaT7xXwJRNSufO06T+X4hR/z/Oyf/Z5Q HEp/38sSNM1UpdqmRHSJUtBKuIaiYv9fzmSK6+1ySQesDPB/sCUlRCKKszCleCe/0NXD ygBQ== X-Forwarded-Encrypted: i=1; AFNElJ/Iihf0LqOlbOWwKgWKirtCTya9EEBLgU04PGqRF4VNRnoAy0Vj/vElGKNowvruMW/hAFLdxos4ThMCD2w=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9ga2I270KoFiQbNvxnNGh93AooPuEnaw83XJVuoRv+BG8kXyq tcNMviAw3tgcNVwUwClbz1bSL1GEwjprrKeT1/Yyi02vJ5/j9cbje7xhubY2i0ABNA== X-Gm-Gg: Acq92OE3fCi3soze9ljoXKUg/n3/CwGd+rOJqSvmuoukDeKDsWCDtOh9PCFpl+/AcSF lHHgdQYXRFZSd7Bt8cmbeVL4IwidfWlIC8OzzMUXzbB3KxGD0OsHnKRsAnhbvGDy3oIE1Y4JevF A+PKXXMH34La0Hnnc63laa1rxkGZ7+jqOCkGgMiHeJxL0NOZRQUvAyb0vcCjg8899+3KMoLNT5E +HNPK2vw2jlfP2Y/rYyrJawX6OhuTLGlbS8KfPTIOokbYkwStXvokT8srW6+uYVVjDB4MPETVdX nJVxGjTETCT4SZloDoKBfU/QYOU7Tkt8ZgPMPO4VEjSvwg4k3HJgUMLjkKxJx9NEo93pmKacNzR DKSNkjEUzSi/+c6JS0ArHoFxa4PYHMwjMErReVEjunYxE1YC4iQ71mk0PiFqnJXgCA92lFyrPRA QabwH9Wpx4H7Sj/T7qF5Abvd8wYH16Fz6Re9/7ZK5B6mI1wOEXutyq+1bEMS9xFg== X-Received: by 2002:a05:6a00:3e20:b0:82c:7767:5bb2 with SMTP id d2e1a72fcca58-8434ce428cemr17610087b3a.21.1781562131898; Mon, 15 Jun 2026 15:22:11 -0700 (PDT) Received: from google.com (56.149.168.34.bc.googleusercontent.com. [34.168.149.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8434acca7ecsm11283741b3a.13.2026.06.15.15.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 15:22:11 -0700 (PDT) Date: Mon, 15 Jun 2026 22:22:08 +0000 From: David Matlack To: Pasha Tatashin 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 , Pranjal Shrivastava , Pratyush Yadav , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Vipin Sharma , William Tu , Yi Liu Subject: Re: [PATCH v6 01/12] PCI: liveupdate: Set up FLB handler for the PCI core Message-ID: References: <20260522202410.3104264-1-dmatlack@google.com> <20260522202410.3104264-2-dmatlack@google.com> <178124130274.908199.14827357870284807134.b4-review@b4> 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: <178124130274.908199.14827357870284807134.b4-review@b4> On 2026-06-12 05:15 AM, Pasha Tatashin wrote: > On Fri, 22 May 2026 20:23:59 +0000, David Matlack wrote: > > + * PCI device preservation across Live Update is built on top of the Live Update > > + * Orchestrator's (LUO) support for file preservation across kexec. Drivers > > I prefer to just use acronyms FLB, and LUO, but have links to the actual > documentations about them. > > So, something like this: > > * :ref:`FLB ` Data > * ===================== > * > * PCI device preservation across Live Update is built on top of the > * :ref:`LUO ` support for file preservation across kexec. Drivers > > And also add _luo and _flb to Documentation/core-api/liveupdate.rst > > .. _luo: > > ======================== > Live Update Orchestrator > ======================== > > .. _flb: Will do. I guess I will need to add another patch to add the link references to liveupdate.rst? > > LUO File Lifecycle Bound Global Data > ==================================== > > > [ ... skip 17 lines ... ] > > + * > > + * * ``pci_liveupdate_register_flb(driver_file_handler)`` > > + * * ``pci_liveupdate_unregister_flb(driver_file_handler)`` > > + */ > > + > > +#define pr_fmt(fmt) "PCI: liveupdate: " fmt > > Nit, may be: Did you have a suggestion here that got lost? > > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > Please sort alphabetically. Will do. > > > [ ... skip 12 lines ... ] > > + * future to increase the chances that there is enough room to preserve > > + * devices that are not yet present on the system (e.g. VFs, hot-plugged > > + * devices). > > + */ > > + for_each_pci_dev(dev) > > + max_nr_devices++; > > I think, we want to use kho_block [1] (it is in liveupdate/next branch) > to allow number of supported devices to be dynamic. > > To support this, we would redefine the ABI and tracking structures like > so: > > /* include/linux/kho/abi/pci.h */ > struct pci_ser { > u64 devices; /* Phys address of the first block header of kho_block_set */ > u64 nr_devices; /* Total count of active preserved devices */ > } __packed; > > /* drivers/pci/liveupdate.c */ > struct pci_flb_outgoing { > struct pci_ser *ser; /* Points to the FDT/KHO-allocated ABI struct */ > struct kho_block_set block_set; /* Controls the active blocks on the fly */ > }; > > In __pci_liveupdate_preserve_device() , we would search for > and reuse any inactive pci_dev_ser slot first, and only call > kho_block_set_grow() to expand if no inactive slots are available. > > In pci_liveupdate_unpreserve_device(), we would simply > mark the pci_dev_ser as inactive. Makes sense at a high level. I'll work on switching kho_block for v7 and get back to you if I hit any issues. > > > > > diff --git a/include/linux/pci_liveupdate.h b/include/linux/pci_liveupdate.h > > new file mode 100644 > > index 000000000000..8ec98beefcb4 > > --- /dev/null > > +++ b/include/linux/pci_liveupdate.h > > @@ -0,0 +1,30 @@ > > [ ... skip 24 lines ... ] > > +static inline void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh) > > +{ > > +} > > +#endif > > + > > +#endif /* LINUX_PCI_LIVEUPDATE_H */ > > [1] https://lore.kernel.org/all/20260603154402.468928-1-pasha.tatashin@soleen.com/ > > Preserving: In __pci_liveupdate_preserve_device() , we would search for > Unpreserving: In pci_liveupdate_unpreserve_device(), we would simply > > Preserving: In __pci_liveupdate_preserve_device() , we would search for > Unpreserving: In pci_liveupdate_unpreserve_device(), we would simply > > -- > Pasha Tatashin