From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 BA8E23EEAD4 for ; Tue, 9 Jun 2026 10:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781001950; cv=none; b=E2TCdgalfx7hRrLNuUefnVJ3MOe01BhmuH4njM677sLsvfhA4tEnNI7EW4ubDPmummlKhJvIoKYnFga9F9W7DmLAAQxdO6FZ6rpCMeWhrRz0mrk2mDm5SL2HL/Uszibpfh7cc8e5R63/425ezIaCoaQF7VHS2MnYZzaY1lJDYSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781001950; c=relaxed/simple; bh=inxauirSdSBtUq285TjdHRaUOR7xwNsC6MkSXARnYKY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PGLeqcU7CcpVS2bNBT3AVYvG+ynO9yZxOpr4qFdH5oW6xEMhdfY+uAyPJn3Hc0ULfHy9ruADOxBTuPHP8LeDC2TDhEfSt9G2Hio/ySRj+Fde2ZP0o0Ozrk54tiY4NTabsL1qVGXIg0tEaceHhanjTi1TVMQgjg7Vbuf5xP/DvzI= 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=VVrRvQZ4; arc=none smtp.client-ip=209.85.214.171 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="VVrRvQZ4" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2bf22c18ad3so504215ad.0 for ; Tue, 09 Jun 2026 03:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781001949; x=1781606749; 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=No+49IMmQGsjPk0qMclq8vTdt88psTr6uq6iD4QVA2E=; b=VVrRvQZ441Tn5SAsCO0q5dhRuqPc8o3fxKL+T4oL79bkTHDFpwDskSSH7mWAdfXM3c yQk8diufRbgYN3IoX5Ol/aRRXB6X5rG38N8sDb1GH4Eg00iwuM/bEkMdmSvK8Yrn/Cli WvtoO4gt5kAej7avzE4ebJBK7E0/JXKntOmnvj3fERsziSCzV3M95H5rafE7yVCpWFv/ nbqV0QXgKGzLAecEa5U0VgnR/j0L6oGNQJDrjRyH1Hny8ZOXXA15JQTPDvZaOSNZU6Du FQyGCkIZ5wrVnEE7dNsPvUxoQ+i8WO0RY0cz+9rvSkK2YfnWLGBwh1v9nFNC+Ms0gGj7 2djQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781001949; x=1781606749; 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=No+49IMmQGsjPk0qMclq8vTdt88psTr6uq6iD4QVA2E=; b=rjOwD463APYTiC3N34rTLu7RW5XT4YLLKRvXI0UCZUYZKA2YRqGwhe/olJad6I6jte EaZFRyrP2zMFoUBsBdfrAlaTHw2i25LD+MMgyP9BS1MASuaxji3Q+a93KjLexpZXdI0j FPM9A7DaGt7q5wSm7yyAQCY8B7XN1tJmOy72r/8MNX6CizmackvA99YPAcH/nwrMWuGT U6FyqwC8wq9LzDqopnXWPeTTGOlBF8l+Ps5T4NxS9pEWBkMkkfXifGXQQa+oW5v+GyV/ Pj3sFpN66JpFrqQMrXqRBr8m6+wdGLMkcg4H7TaBC1njvN+I1lUwQXrzfOUKBvP9vBmv CzXw== X-Forwarded-Encrypted: i=1; AFNElJ8ePQWtlSKsj3sL23h5KK6vMdNbB6Yl+taBDlprm+BdwSBeC90H569Dn+Y/8I+n7+eWTq1b/EdH6HQTVRs=@vger.kernel.org X-Gm-Message-State: AOJu0YwoWnLGR+6P5vrOTawauSOMznaQ3+f/0j3/q+eissW0XjhqaaDz FAzvjF3FGtoq2PJw1UgHkGD2j0tb4+wo2NR0htQizg9CwC1nX5/CmEXRLyyH3WqrCA== X-Gm-Gg: Acq92OHJO/lLPf67oe+DDenjyjFn2K1LgWt+uYcO4kJ1krQUt7W8bpnMVKCorfToJOs a5FHpLpAS+W8YzCC+QnZQNZP0hXspsFvZ2suGIMDkh8xU0zCJjM/bHitxkhM9fwM12aF/256WQ7 XOoQvTuWtcm/+T8lxTzm0fIuxQSnkavOnF0VDR8Xxczei77hLKsP9QJXAff3TUYnsTeMnF2WMN2 6oHn1QQtndv+lnGXY02lZBbUww2yNBRvGHv3sdlT50q4i06eeDG7zWyuaSMpjoudNBHJkwOH/TC nKL7LuOh15cyiVkOTe/xWpknoxZHoW0OV8sN9LN5JB2O1I6OkTgeEIcjwphXMsLyKfyfn3AC63P 6yt5LAPidDp7QbHebT15Rogf420mVAw7TBRRFRUXoxrWTBFmLlPxWOpmbcPee6Ekdpdebv8FGx+ GCt/VjpWTVxybpL/WVd4IvS4G3SwkXr1jjpMb+CSYfRpic6yQsUY26ochV+5UDstWo1DMskug= X-Received: by 2002:a17:903:fa5:b0:2c1:ee6e:4e4c with SMTP id d9443c01a7336-2c1ee6e51e8mr7663135ad.29.1781001948407; Tue, 09 Jun 2026 03:45:48 -0700 (PDT) Received: from google.com (199.255.142.34.bc.googleusercontent.com. [34.142.255.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-842828e228asm22864909b3a.47.2026.06.09.03.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 03:45:47 -0700 (PDT) Date: Tue, 9 Jun 2026 10:45:39 +0000 From: Pranjal Shrivastava 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 , 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> 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 Mon, Jun 08, 2026 at 08:51:00PM +0000, David Matlack wrote: > On 2026-06-05 05:41 AM, Pranjal Shrivastava wrote: > > On Fri, May 22, 2026 at 08:23:59PM +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. > > > [...] > > > + * struct pci_ser - PCI Subsystem Live Update State > > > + * > > > + * This struct tracks state about all devices that are being preserved across > > > + * a Live Update for the next kernel. > > > + * > > > + * @max_nr_devices: The length of the devices[] flexible array. > > > + * @nr_devices: The number of devices that were preserved. > > > + * @devices: Flexible array of pci_dev_ser structs for each device. > > > + */ > > > +struct pci_ser { > > > + u32 max_nr_devices; > > > + u32 nr_devices; > > > + struct pci_dev_ser devices[]; > > > +} __packed; > > > + > > > +/* Ensure all elements of devices[] are naturally aligned. */ > > > +static_assert(offsetof(struct pci_ser, devices) % sizeof(unsigned long) == 0); > > > +static_assert(sizeof(struct pci_dev_ser) % sizeof(unsigned long) == 0); > > > > Minor Nit: Shall we consider using specific bitwidth types here? > > I'm wondering if down the line another u32 field is added to > > struct pci_dev_ser.. in that case on a 32-bit machine 12 % 4 == 0 but on > > a 64-bit machine 12 % 8 != 0.. > > I think natural alignment is what matters for efficient access of the > array elements. So failing the assert only on 64-bit architectures seems > like the correct behavior. > Ack. I guess what I was trying to say was we'd anyway need to keep both architectures in mind, i.e. adding members should be 64-bit aligned (which implicitly also handles 32-bit) as with the current assert any new addition would have to be both 32 & 64-bit aligned. I guess we can keep this as is. Thanks, Praan