From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 6FF903A2541 for ; Thu, 30 Apr 2026 20:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777581905; cv=none; b=o0qyo30EC9cVJcllit2QrZEpK3Sy9wivoknBwluvTsbQuQfKzufxogVDSRDtX1aODAA2lXcgvzBWswyLcldf+7dytuzgLrqvmMLgh3WeUiIBM79gBC/L1L4UHFlu8J8F2S69BnB5K6kFcPq0SlaPngUENwVaULAkgE7L9/tRdgs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777581905; c=relaxed/simple; bh=NfdHaeQSfqq3H+A37t2n3ZLxXNIDGtu4NkmeTlmQkBo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HNa3CeLRzXhXlcYwh+P76qm+uDUrp9yGRshJGystuY3hOLK+3E2f156g9zZx86GVzAaxvuigYquDVQnll/vCEMV6NCHiS0C7WgHAkWd6prXw2QjWTJ4aKEDC9EFOcgVOqbvwHVOACneNfhWX3IZ0asAordiV1j3u1dvtHdwbBUA= 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=Ikst+acL; arc=none smtp.client-ip=209.85.214.181 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="Ikst+acL" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2b461310af5so5688695ad.1 for ; Thu, 30 Apr 2026 13:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777581904; x=1778186704; darn=lists.linux.dev; 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=JvD+uC7yGlafUSeu2Mn7DdblXz0CDLD8RU3/xZfrtps=; b=Ikst+acL5kG7M+NQs3f2yttfWyKd2xdM6EK2b0AZv03isCkDTL+sfHrUuXET4+3fC6 NcKxNlXEvTZlgCbOcNmKIym+HkQuS8GjFcoODSD6V+ClngaEzNtZAH0/NMSXnuz1EoDZ EaXZQ4GfSxXGg8KNg3uBYT2ogqxMWVycJq/R727JEEh94nhI2d/YQKx26xrrDhPh5Nik 7C51UIi2ciZfUm2h2UJ6XsiCIs6IV1+L4ptQsZeiyuL8K0jAgri/+Q8FcsrIYP26bYTz q9MTuslLoE/+yt0aUBXpCOzYQNuLk6wrJy7kXOgEj2An0MEtwtssQ/j6QHNO2FqgOJFN KwXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777581904; x=1778186704; 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=JvD+uC7yGlafUSeu2Mn7DdblXz0CDLD8RU3/xZfrtps=; b=iLZZ65RuPWYWg/1IPErVAl/5IkluDw3hceqGmGeRWWTvD7UWKRHdwu2FTm1M7D4Hl+ ArLwoL/T2CfpZf6Vj1tED1rCsrys2zd2aoPD1Pl50cqpxNuI2aM14v4Tq5Up9cMx9nFQ S8VBq4Idz3UMUe0bZTP86IWGyi5KsvV65oDOyjFB0FaJQaC06wL9eX8hJvrTRwed0tu9 Luqm0Sc3HuGvzKWbMDh0Xb11dfzooDlnPTAXaQri7AJHBvqrCD4PcNdxCu25tUr/qiYe IcD/smY9nRaigUYV+C70r1UspuV45YqXZR9U5uKMS0IAUgSaMoQa2UyjSEjtQJ2CjVTK vvDg== X-Gm-Message-State: AOJu0YyK2YbfoVEr3chh5sEUHXsPEvhk2p4rl/8RoK99EG5uOCt6EhGK ygCahlJ0YREa+pcsxuz5u/edO+Kc/2gN6zir6IZ+kYWc4YCLWN7DXM+00isyjrZDhA== X-Gm-Gg: AeBDiet84sUry3dfKzikDeLwaoHHolpc64HrtkSw0VMsmlptQX6Tpmtxt3gOBWAXEgN GmVqUH/1jnnHaAXti1BYQzWTAav+CAL3nsztT9lxifK84RF2v3w3rPSeAVJGeLAoGiDDMtJWuTO tUiBGdbbmADc7ImRDQ8ESN8yRXXwlefszXNBfjOTS2XLC1sK59m+TGNwODkS4TZso6ynmWQshTk HsNaBYayOCGy12Y2pLjjxpiBqgmiwaYzn7LwaZLpArrD83OdfIrTmPhIJ7ua1Y5/4dThSUMUvwI udsyYfzKrZbmWppQRX5hRJdZ9Vzjw1KQWDwZWYELczGCUUVf9+q7fn83hGTV630e5IVhmeSYfIm JqN9OaDxz1Rb3sIfds1PJuKRTgUNq84HoSa18nPtba31P1e9aAZEmqimOMGmQqX79Aw8qWMO9ut 0uWxUEEKksBOJXXlok8V26NanYjlAc9nSFTy1sM4okfwn82aO1G/CBSMFGU0McgL/8CxEeQap8l PJUVw== X-Received: by 2002:a17:903:200a:b0:2b2:6cab:3127 with SMTP id d9443c01a7336-2b9a44c5da2mr25533465ad.20.1777581903207; Thu, 30 Apr 2026 13:45:03 -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-2b9cae5cc52sm4845105ad.78.2026.04.30.13.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 13:45:02 -0700 (PDT) Date: Thu, 30 Apr 2026 20:44:58 +0000 From: David Matlack To: Vipin Sharma 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 , Samiullah Khawaja , Shuah Khan , Will Deacon , William Tu , Yi Liu Subject: Re: [PATCH v4 01/11] PCI: liveupdate: Set up FLB handler for the PCI core Message-ID: References: <20260423212316.3431746-1-dmatlack@google.com> <20260423212316.3431746-2-dmatlack@google.com> <20260428185242.GB3825533.vipinsh@google.com> <20260430182532.GB13902.vipinsh@google.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260430182532.GB13902.vipinsh@google.com> On 2026-04-30 11:48 AM, Vipin Sharma wrote: > On Tue, Apr 28, 2026 at 11:51:37PM +0000, David Matlack wrote: > > On 2026-04-28 12:45 PM, Vipin Sharma wrote: > > > On Thu, Apr 23, 2026 at 09:23:05PM +0000, David Matlack wrote: > > > > + pr_debug("Preserving struct pci_ser with room for %u devices\n", > > > > + max_nr_devices); > > > > + > > > > + ser = kho_alloc_preserve(size); > > > > + if (IS_ERR(ser)) > > > > + return PTR_ERR(ser); > > > > > > Should there be a similar pr_debug() in case of failure to denote that above > > > "Preserving ..." message didn't finish, or, maybe just print one > > > pr_debug() after the error check above? > > > > Hm... I guess there could always be more pr_debug()s but I don't want to > > instrument every error path. I could move it to the success path but I > > don't see how that makes it any better. > > > > In current way, it is printing that it is preserving pci_ser, but there > is no indication did it succeed or not in logs. If we are printing the > logs then may be complete picture will be to know what is the action and its > result. > > I think moving to success path or printing again based on the failure > provides assurance of what happened. If this gets printed in happy > path, then we will know it succeeded in preserving that struct on > kho. Absence means it didn't. > > We can also remove pr_debug(), if this is of no value. I think I'll just drop these. BPF can be used to trace this function and what it returns when debugging issues. > > > > > > > > +/** > > > > + * 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). > > > > + */ > > > > +struct pci_dev_ser { > > > > + u32 domain; > > > > + u16 bdf; > > > > + u16 reserved; > > > > > > Should this be renamed to 'u8 __padding[2];' instead? This will allow to > > > just change the array length based on the need (0, 1, 2, 3). > > > > Sorry I'm not following what you mean here. What is the reason to rename > > this field and change it to an array? > > > > Having a padding explicitly tells there is a requirement of being > aligned. Reserved sounds more like don't use this u16. It's documented above, but agree padding is a better name. > If someone add more field down the line say u8, then to make struct size > aligned they will need to add another u8, u16, u32, and name those > fields padding or reserved. IMO, having a u8 array named padding makes > it easier to just change array length as per the need. This field does get replaced in the next patch. But I see your point that if we need to pad by an amount other than u8, u16, or u32, then we would need an array.