From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 7307E38D3EE for ; Mon, 24 Aug 2026 20:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787602404; cv=none; b=B5/AdM4uU0Y2JV5tXgjue8yJNWG3e+IgPwmCZiY1BUNy+mjku4MC4sTlkf8M/4vbPb0D5Rzir6vb+fupO/eDFRCkPE1UMeP9Svu1Fq02ipvYpJEo7mZf3sjlMXg5rezxNAI9KFOfQ8GROSFJ4/MRSkYXSExw5RemvxcAY/w1pGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787602404; c=relaxed/simple; bh=cQLKpj+oXjXRPyz4aL8hDfnwY/UhslNHX3Mtp9HFmCk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ay2YrkbdTl05UpDooYV3SGlwiyDfJnNUkXwVll5AvnJGfByeXfaIBho1kvNAj/9hKPWil4thHnBR45+n7/ZIcglrieoArx/CHXXXpf4Dr6Iu+U1FhoUX4s4NcaUwiTcg+xa77Vc7AUbT0LgpmOkEY0SMIE51e5LhhK8bLfn4Bgo= 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=crBa6Zqy; arc=none smtp.client-ip=209.85.214.178 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="crBa6Zqy" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2d3b440b97aso4905ad.1 for ; Mon, 24 Aug 2026 13:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787602403; x=1788207203; 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=0RIjz5iu884zqJfy1iBWck/h3gWNzem69636ygLdEIA=; b=crBa6ZqycLyhfNEl3uWHDP/2pnAL50QWyQSygZx5n02SdHNpWElCKEE1qTCrsDxK3s Vb9LTSks9p7z9VXpyLQmpGfyr9aYf3RiGd8ZCT87vsfJmhjBo5dBu+PyRhfGDAN+uejN IIoScXE3gkJbTV2MQlvf+g1brJ2tRPA2Ty441MVcDyJ+QXrBTv896K593+SD8X6XFSqy dEpucfVOtAceN7xwUNrlXLi2HrVHvUZNwbfgRmasXDE40MVJBmgse0xqi7Z3EpQ0gX0t Bfn0vDleRURtz5bnmJt8T/6VD8bSPf/xgRCWckdUgL1xhCPOao8tgH/KB9RJWa4AvlAA 6oTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787602403; x=1788207203; 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=0RIjz5iu884zqJfy1iBWck/h3gWNzem69636ygLdEIA=; b=aXoHzc6i+d1+WCUJo8J8crzXCCIVGMcm5JWwv+mtwJFjpuXTYSzUTGfZQO0c34dRjt r52AM2XKtjVDjxtj7abcLdJ4j5DdtyQ4XBpf6KkTf3ObZHLL25x01wECGNOqmORm3/75 LQX8H84vfzbbQa2m0BXp2eoBowDTyGOaWacQM2eHt1eH+qoybOgGBOHZVooWO7IKiRzG MD3alqsotIIx8QgCSrsuYkLBFf2aHKqqdO1EYCqmBpI5xGLitWxmAia2lREjUXdCwz6j mBB80ooCrb+rii9VLIpsMYc/xJs/OxOGmsEcej4pM8LE9UaKdiC9nI+9+p5evDFp5Skq 2j3g== X-Forwarded-Encrypted: i=1; AHgh+Rr/E75lq9Oe/vaP1jA2k4KNIQBfFR8KZ4hHGCblDruv4mmJMMKjDUci4LhBF+vmqKVpkZM+0wv0XWf9/SI=@vger.kernel.org X-Gm-Message-State: AFuF++k/67nSFdeYBJ/NvuUrzXxeVRSJNXGuETjlceRaF7Q+XfUwzCYD TGJNBQcdFEIj9rfPj/xxO+YQls15dPreVTEcFV7BELLcZ9epJc00J7sKx7KmuYpHRg== X-Gm-Gg: AR+sD10jqodMwGCW6bbG0wGijuCvoECYZ3sS4M9V2j2ImgEGK6n/Xj/heBkuBA6tgFx 1z+Fr2TKZh78oBAZb6hfkNDUxplf9a0dOg9PaBec9kYAn4yJsRdtALO9GvdCPCg/NX9/1KbYHft X112ykxm3fHmSFHXG7kf54/ZxX/p4EzaTWCk6THcmHL+OFsXRbJdE+xeEPGYmTt42f7+RP3p04o lyaE4eJMIqfCT2hJjJr8bttwhBkQWHbaUZA5tet1YNc2CCOrHs90QY6RYg9nD03ympYvFWTWiPG VjbjnEUZiaNMJdolW5EPteTonovACiZCdm1j82MRvTdtKkwJ9o3k8XSuQNH2gIxOHGYFrbv27yk SJNr7DUFE6ss8dpVl+JnILwN+DYjWBKdJtNkkqtNO1jBLTmOAWV9OplO7k69OEw0sVc/CxOfKRT rDmvYRgyqPBmJ/OW0/5PovhxftdFQ+Gd3PW5OugFPjk0qnwh3Wl5G3Uy0xFziD9ySP07flrwt25 399lCj95mMDvYjlPkkRVcH6QJFGxJW4G3Agezl+V4/nRYOT+8RspFIjdGk= X-Received: by 2002:a17:903:985:b0:2bf:3579:cdaa with SMTP id d9443c01a7336-2d6e072a392mr1090655ad.10.1787602402239; Mon, 24 Aug 2026 13:13:22 -0700 (PDT) Received: from google.com (210.87.127.34.bc.googleusercontent.com. [34.127.87.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39645b7ff6dsm795785a91.10.2026.08.24.13.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 13:13:21 -0700 (PDT) Date: Mon, 24 Aug 2026 20:13:18 +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 03/12] PCI: liveupdate: Track incoming preserved PCI devices Message-ID: References: <20260728221007.2098560-1-dmatlack@google.com> <20260728221007.2098560-4-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-4-dmatlack@google.com> On Tue, Jul 28, 2026 at 10:09:57PM +0000, David Matlack wrote: >During PCI enumeration, the previous kernel might have passed state about >devices that were preserved across kexec. The PCI core needs to fetch >this state to identify which devices are "incoming" and require special >handling. > >Add pci_liveupdate_setup_device() which is called during device setup >to fetch the serialized state (struct pci_ser) from the Live Update >Orchestrator. The first time this happens, pci_flb_retrieve() will run >and convert the array of pci_dev_ser structs into an xarray so that it >can be looked up efficiently. > >If a device is found in the xarray, the PCI core stores a pointer to its >state in dev->liveupdate_incoming until pci_liveupdate_finish() is >called by the driver. This pointer allows the PCI core and drivers to >apply Live Update-specific logic to incoming devices in subsequent >commits. > >Drivers can check if a device is an incoming preserved device (e.g. >during probe) by calling pci_liveupdate_is_incoming(). > >CONFIG_64BIT is now required to enable CONFIG_PCI_LIVEUPDATE so that the >domain and bdf can be guaranteed to fit in an unsigned long and be used >as the xarray key. > >Reviewed-by: Pranjal Shrivastava >Signed-off-by: David Matlack >--- > MAINTAINERS | 1 + > drivers/pci/Kconfig | 2 +- > drivers/pci/liveupdate.c | 256 ++++++++++++++++++++++++++++++++- > drivers/pci/liveupdate.h | 5 + > drivers/pci/probe.c | 3 + > include/linux/pci_liveupdate.h | 13 ++ > 6 files changed, 277 insertions(+), 3 deletions(-) > > [snip] > static void pci_flb_finish(struct liveupdate_flb_op_args *args) > { >+ struct pci_flb_incoming *incoming = args->obj; >+ > pr_debug("Finished struct pci_ser (0x%llx)\n", args->data); >- kho_restore_free(args->obj); >+ pci_check_all_devices_finished(incoming); This should handle FLB/FD lifecycle nicely. Thanks for adding this. >+ >+ xa_destroy(&incoming->xa); >+ kho_block_set_destroy(&incoming->block_set); >+ kho_restore_free(incoming->ser); >+ kfree(incoming); > } > Reviewed-by: Samiullah Khawaja