From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 B413143C07C for ; Tue, 28 Apr 2026 17:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777397759; cv=none; b=QWkZm9BD9dQVcbBwql3hkRTf92J1fwndeuOh5BdO/urFomuxi2Ri2dMb4p47dq5cByDREQLw/hI53bVy1inQdUpaetQztUODEzxZxoBJ54ZgorIirIZBYwAM/siRAVaEqDjEekU0cgzaBoy4uuCudGDcrwGh4hmlukLvPBl7GzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777397759; c=relaxed/simple; bh=6BOFmV1sfaExkGiH3CUmno76chlBrIHAsLEqmzM/9QQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NdGCgf2KCYG8SOIrKa1h5SHppiJ5SLeL72KNXMgcAIFGQzdJrbzWXfNly+a7EtNHcsLLOhawAwl7mZt5cu/st5BTBejCkiNnZwuaUj64aGSnTikrgj9R+P6HBFLxuRVGywiOkNAaGV9B+sT/lGesAW1S6ZtbdBKR7UJ8WiQQMhc= 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=nMvrIq/y; arc=none smtp.client-ip=209.85.214.177 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="nMvrIq/y" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2b243198058so132125ad.1 for ; Tue, 28 Apr 2026 10:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777397757; x=1778002557; 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=ncltMbqb0oRbMvugQb2r0egpAWKoVDCs8cMwwYz9oEg=; b=nMvrIq/yZ/KS2OxUDqe41xLYPVOAeWQZYLfttPxfHzJ7EwMylXburbqgyNw0SwYior BbWInMYE42B7q/EI9/VvFci/H3RtwRbro+awc+w123iFybR8S1sNtn4iaQD4FdvQaFXl oEnG/UeuRSSqtBs2BSuGvEQ7O1xqayH4NEa+TLNBIK4quPNlwfwqMRGqzdSJtAt8fVB8 QYafZhT/ZTH5+ThNqGLRF5H8srmZ42KO/SydZLNe7rntBjLAyK2U8TYxya/uHP3hzsGK x5vJeuSMg7tzQ0AAFMRNe2XcDDGhLFvABojZ/WfonlaWXwoRpqZSwdsXNvKoEGfV6YyG PlqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777397757; x=1778002557; 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=ncltMbqb0oRbMvugQb2r0egpAWKoVDCs8cMwwYz9oEg=; b=HXTKRiE9hCqh3T7yZbTIOgafFxOhAY7V0hxoOdKz6q4zKrP9nWfVUAbSkD5+6vDPmA eIRi18MnWNaYp3whX2ShXVNARE7Xka9rVIGA13fNsJ1WyGLmOfoJmxE0GkuXk2jTonTz /Kkw1sEO0OGvpcmwZxZ1z2fpQqCPIIvPueBKRbUCmePrlsn4JxA/bdVGC1Fc0RmqvEiy YHaKsOL/F9qz0fiDyOZgfLwtuMgybkm36lgev+DItFpCeGFI6+O34ECplw6kS3hgswyD ndpt6kS6vX0ZSjDYkhuQ+iLiErtivCXLIsP8s2zFJ9xljLGXYHtPwiY+UDSlFsT4y0gY 66KQ== X-Forwarded-Encrypted: i=1; AFNElJ98wcxSew3E8arxMcbDSqRdSVH6rTmTC4KwsS0kkHRcdrTmrIE65O5KmG46QrhvQ9o9EiDKWlYciGtMUYU=@vger.kernel.org X-Gm-Message-State: AOJu0YwTXteL4RfVXp6bHMjr1h5YukLk4M/LhaBQO76uIHxR9I+MA0Jh tL3Y5WsB2aEaXDb57EhYnwi4Q/BEkZ2XCeNcr0tB5+kEJyB8D64pq0D0jnE/+f4vAerhBhXmZYT 3GyN1El7K X-Gm-Gg: AeBDiesXaZCM5YxWD8QYPm5Q1Su3vJtiulzlzP/3hxbT7Ld5Ehxv4bgqdWoNwAVujPJ Jawvo5z8T7hfThhCV1PLHFLzfTG6697uGsHpM+tHe9gEFqNUhbN5rtlspyGsSLiVE8mhvJAf8e1 hCjubCbS1PbvxR44cO6Ny0SqE5TklJj9m7BUrsqMpsSAKG3Id7XB6AwaZ5/K0IiNpNmSSWkbhQ/ 6NX8fm92w6zgECD/5q//azvp4Yai0fCd3Zwxa/wDWkhy7CHGwAGZWV2SSlSB9421PxpqhguxUg3 2JsIQeGVnCajT6YDzkhq5Kplqh9fB6AdjCYo0dta7dl1u4Bf9Orw5KdmHDnQkMnh+YlXSomiM0l dhoZ0B3CAMNMzwwnshkAc0CAv+hCziAZX+j88vdLE5Ra2EBelk5nVrQ6kTCiDtcUlmH25XZw65k KFsMrdOpHivjnAN3bgdUx8kjztLb5Hme9Ml5xXpW5V48iz6iEG4M5rZbFonlCss5hr4vG+GgP47 HYJ58VBlXI= X-Received: by 2002:a17:902:cec2:b0:2b7:b03d:9dce with SMTP id d9443c01a7336-2b987ed382bmr144705ad.18.1777397756522; Tue, 28 Apr 2026 10:35:56 -0700 (PDT) Received: from google.com (195.236.83.34.bc.googleusercontent.com. [34.83.236.195]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-834daf7f43bsm3432664b3a.58.2026.04.28.10.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2026 10:35:56 -0700 (PDT) Date: Tue, 28 Apr 2026 17:35:52 +0000 From: Samiullah Khawaja To: David Matlack Cc: iommu@lists.linux.dev, 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 , Joerg Roedel , Jonathan Corbet , Josh Hilke , Leon Romanovsky , Lukas Wunner , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pranjal Shrivastava , Pratyush Yadav , Robin Murphy , Saeed Mahameed , Shuah Khan , Will Deacon , William Tu , Yi Liu Subject: Re: [PATCH v4 02/11] PCI: liveupdate: Track outgoing preserved PCI devices Message-ID: References: <20260423212316.3431746-1-dmatlack@google.com> <20260423212316.3431746-3-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: On Tue, Apr 28, 2026 at 05:24:53PM +0000, Samiullah Khawaja wrote: >On Thu, Apr 23, 2026 at 09:23:06PM +0000, David Matlack wrote: >>Add APIs to allow drivers to notify the PCI core of which devices are >>being preserved across a Live Update for the next kernel, i.e. >>"outgoing" devices. >> >>Drivers must notify the PCI core when devices are preserved so that the >>PCI core can update its FLB data (struct pci_ser) and track the list of >>outgoing devices. pci_liveupdate_preserve() notifies the PCI core that a >>device must be preserved across Live Update. pci_liveupdate_unpreserve() >>reverses this (cancels the preservation of the device). >> >>This tracking ensures the PCI core is fully aware of which devices may >>need special handling during shutdown and kexec, and so that it can be >>handed off to the next kernel. >> >>Signed-off-by: David Matlack >>--- >>drivers/pci/liveupdate.c | 101 ++++++++++++++++++++++++++++++++++++ >>include/linux/kho/abi/pci.h | 7 +-- >>include/linux/pci.h | 26 ++++++++++ >>3 files changed, 131 insertions(+), 3 deletions(-) >> >>diff --git a/include/linux/kho/abi/pci.h b/include/linux/kho/abi/pci.h >>index 5c0e92588c00..5b4c8d9e462c 100644 >>--- a/include/linux/kho/abi/pci.h >>+++ b/include/linux/kho/abi/pci.h >>@@ -23,19 +23,20 @@ >> * incrementing the version number in the PCI_LUO_FLB_COMPATIBLE string. >> */ >> >>-#define PCI_LUO_FLB_COMPATIBLE "pci-v1" >>+#define PCI_LUO_FLB_COMPATIBLE "pci-v2" >> >>/** >> * struct pci_dev_ser - Serialized state about a single PCI device. >> * >> * @domain: The device's PCI domain number (segment). >> * @bdf: The device's PCI bus, device, and function number. >>- * @reserved: Reserved (to naturally align struct pci_dev_ser). >>+ * @refcount: Reference count used by the PCI core to keep track of whether it >>+ * is done using a device's struct pci_dev_ser. nit: I was wondering why is this named refcount and why it is needed. It seems you are using it to track the preservation dependency between parent devices and leaf. Maybe add a comment to clarify that. >> */ >>struct pci_dev_ser { >> u32 domain; >> u16 bdf; >>- u16 reserved; >>+ u16 refcount; >>} __packed; >> >>/** Sami