From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 38D471A08AF for ; Thu, 30 Apr 2026 21:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777583770; cv=none; b=kF9GRcxat0VLvh5aacsZEJp5eoIeAy8w/z65gnoAWdKGPKfpDz25lzId+KOjPZftSmiaCfvqFl8pqGnZ4kJGL66nA7pIvwRtDrz0+MxyOZo6i4aeUsSIWciW8Z8NycBwg1BCxtGyBtB2LFvBEaBXyycUGHwRtKHkuxLN7ea5YY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777583770; c=relaxed/simple; bh=p74IfHhIob98pzABSKbeddeDIJ3TxaKYlP05kGBMvAE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l5z0ltQJ50DEdFC5UPbpBNxNVuaNbK7fFFDlVBWQZDtzAUS4ppXhcI3s7QgB8rCiecs92jjclsaHoO5EtBJDg4hFbg5yBm4iTKF0sJFu6vT5+fNxLmakU7yumol7x75FraXyFm4GIMPgPT9g9CSqUDnulxG9iGsvGxINMdv9t9w= 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=iobmpRok; arc=none smtp.client-ip=209.85.214.175 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="iobmpRok" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2b9705613ddso8667755ad.1 for ; Thu, 30 Apr 2026 14:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777583768; x=1778188568; 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=qKjNRn2md89MeJaRqxCLA5wY9NhKNsbLMVT1tb1aOVs=; b=iobmpRokjeWaAmiUZ9Yustwkb240NMj+cqkmA/OGo/PhrcvcJUoWSSjnj168wxhMWs yMf0ODt0bScdnzLDNMfrTTpBrZV7DSIxcllc7QaqK0YS/DfxZH4fD7a5b6S3JSzJ4AdW LeOKYfrphvMgSsm2T0PPVsdtGkyJWlxE4LQrd8xAHnIx4wE2X3wTcZRSu0QRGjUrUzzG 3d6fZMBkaHjELXiD9Y0CXEIGmPQQndBj/bYPCMD4+oNEnyQF4rfhxFBrN6lsKQN8BrQj ZW4/hJmaSp7ZQoukN80ND5YvQQLiqdyycmiqvEVuXUJxOrv4/beDbbGjlsPYVBhs9kIr KG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777583768; x=1778188568; 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=qKjNRn2md89MeJaRqxCLA5wY9NhKNsbLMVT1tb1aOVs=; b=CawVeUOqE/xpVC9aIuNvjJZyR20kPMqsJunTACzy+XOXqvsqwqwYcRONHg8gCXbb03 rBC6uS0KmdQkux5UEdR741jSH8AOdZs+FqslcQ7oSxzIKkI1w0z3PXy+2GtJe4Byzdgo fVTrI1cd6rEraV+fKosPwWPwJ0bwsEh8IRzQQZOGauqe7EZvh8qxeaXoft+uOw6HzBHH nJ2g8rJ/dQ+dGWYoOYSQxxJHT2vPdm1BmOLlqzTzWwvsZ7/FUYAIpvPocBp+a/mGD9qO Vg3D4/G5TJ9rGa/VgIY5ZS4NYG/tCUcXsF+ugTq6DsQc6DDhrbbKA+DI+KOqXXT5S/vn ighw== X-Forwarded-Encrypted: i=1; AFNElJ+3KIhvqiMYn2V8R0h9xMbjn4Fl9vrRLI4Hftc9v/S11SOU7uqDYkVWJvu8QNJ9NnjopkIYlt860WTyOT8=@vger.kernel.org X-Gm-Message-State: AOJu0YxXKoyVAzhqWbtruJdgF8aN6N7d+OVKx2b4bELaLXzydOjmJA0I dc6jAsiBOkIB0Y/klRIirMK1P/yCJcLUhyWJHCflhNbErTL6vsriM/wDOloUdaxbJw== X-Gm-Gg: AeBDietbNSfkqiz6q7/0Eic6OKiDgFA5Pvni+Y5dKp+RWPgXRItX6GRBLSfGIadOh6m ojzY33R4/C3wbApj+1lD0ojIS+C/+ogCeymGeO0aKAROGhvsGu6My2Q3z44iyFPBwdve/of2ouL cu6GSiS2CNGMotBBzZJS9zE8QZDX+HXSQBlJyVCw2/Ehw+HAAVGd0ULVXWULpqhOmiBEAJfMIcm ME5xOT4qp7X/+AEsFegX35xXmPaa6Z/pnc01wJomj1bsBX7RgkyN3Nz5wy/s5QHvR4W71MBFDW1 yzk4g+x/2r1+50Lw5ugXdtDtJGvMdrObEwpFNLy8Sf9XVftitX8QDTxh8IcCK4uRlB7OFgFKtUo m9SIkFe85xRXA4Of9ppI7LM0v9paLUGJFMQFLuVk+7HrTrEPLh0+98T3l8QAmJ1sZ1vz3UFXMae 3ZX7drH7YV+SoY0/yNhqXooSFk22X/rps4VYIwzUjV0jMndY3A59SphlfcpiVTrTdgfC8NzzQ0f ldksw== X-Received: by 2002:a17:903:22c8:b0:2b9:9086:da9c with SMTP id d9443c01a7336-2b9a234e736mr49645755ad.17.1777583767972; Thu, 30 Apr 2026 14:16:07 -0700 (PDT) Received: from google.com (76.9.127.34.bc.googleusercontent.com. [34.127.9.76]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b9cae67196sm5018815ad.79.2026.04.30.14.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 14:16:07 -0700 (PDT) Date: Thu, 30 Apr 2026 21:16:03 +0000 From: David Matlack To: Samiullah Khawaja 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 Content-Disposition: inline In-Reply-To: On 2026-04-28 05:35 PM, Samiullah Khawaja wrote: > 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. Ack, I will clarify that more in the kerneldoc in v5, thanks.