From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796426568; b=21o0CEcdiNleGvdVMYbZH3kolmLj274LUnQJsixLRP1yuDiRr+L9vnOVCjB76sNJ5B1M t9PjqTJ66VQqNiAS56ynqEwN89ufwjTLDI+ITRAWn5o4WweMdP6pQFPGx0IzzR3tRF0SL sdgaWeaSLeeP76lZTJRdy+qJ9nzuEGQlEKMQKyeDwFiTz6WjuXk5aEhqG36eZvGZfl/3l 6b4joRwKKG6AIRC8WnjYcFEjkNThqBLSs5Tfwu5Zrk5k1GD8BIhESf6W2VRySUmIyJJSw s0MjtJOkgYUGMstUZZEYn5U7uJ7nW/nX0dYQq3ATsnLh5fucwM92M7JCanhilDCyL6g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796426568; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id: To:Cc:Subject:From:X-Mailer:References:In-Reply-To; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=L0WVwpI0tr5LYTsMqyRZDAfh11rv6PKfOxa3Th/QT7hKK1fwo8fa0Uqwa8ZoX5/NAeYC 1OL9dVf+gpBUxb+RPgmUkZ5lkhAFwGNIwEfTqAZDK5zHJGdoTsEy6Xdk+KABhXl34KuwR 1oF6cmNdj91BNhCp9eH0cxzS9FOVwVgsww+Ll3uqOHaDlkDCxo/8yfUw84YvjSo2yiIL8 c0K4h/agS4nVuu6H6dnmbVevjvX3VkXGaU0Fm3UKSelIdyLOD3AxQyySCZTfkVBkGhNmo Is0HovO5CdoqfePDnha2ZKXTXF++lG9T1nmlQ3ZmVW9dfTTXlxpfZQ8er4qF7ICK+tQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=mKUcmb98; arc=none smtp.remote-ip=209.85.210.181 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54E89606A32C for ; Fri, 4 Dec 2026 23:22:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 54E89606A32C 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.a=rsa-sha256 header.s=20260707 header.b=mKUcmb98 Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-8a07078200fso897441b3a.2 for ; Fri, 04 Dec 2026 15:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796426567; x=1797031367; darn=vger.kernel.org; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=mKUcmb98a8j0WA2Q5tcJMvfY5GvvwqbV0RJNJETwj6rRJsa0pLQKQoJhXq8BUbGKoJ 9T26FsKREDXJ9XOmDd7V4C1K1V/y69899t0z7osJqXkJaEVzvhMtbHcOaYQr9dq9+XpH BZeE/bUhiPFm1Fqvi3n0F7qMXqTIkL6sJgqLEe95EVtF2HOjsX7UwIPHYwN6kxT+PGQM 5OgGIzuqZDUbd5b832feGr2mwAc4fZ8hS7lgAxL5E0l6uIdpnZYmxHogNC3MfluNquPh mSvWaAD1M2GT6dOyDDO/1yjaXQ5UhTpE1rndnNYEUqxNT05p77Fxyhrr93sYRNyZkcFK eOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796426567; x=1797031367; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=Y4qUSt0px0HBMIEyxd9xSgIUchgsvKtSimCiZQ/Vj30hBB/woHoOJ64aExaXXvCFb0 iDFX8oIDYua7Dob5VgrImjJ0WhTrwmTQTqUMMHGDZg70b3kcvJwiPNPTBxGxAXodgv6o 9WywG5k0eE2sIFRafRQ7bKmxaAWBIwYTBh7QARwnMSDEEivCj0lHX/v8XibhivHv6Qrm Jois6mD9PtazoVKwnrlYGxj94Xm1ZhanpZ7hhbKfLdIPzV7ZvjiuLKlXjKtcL6MzMk00 I7lVsv7QLGD+sNjXvQ1IXBApzLBzQdWTPOm3ClpR4WvpA1ypg/gh2izj8GfE5iWN9qtx e1ZA== X-Forwarded-Encrypted: i=1; AL+hErGmzgTPuNcfnR/HthIpvDHNFBrZW9wQTA1OufHqQ5xpbqiOkAeTdJL6X4LAu05WscLVrRBTU3IQP+c=@vger.kernel.org X-Gm-Message-State: AB4q+uEyfcpWKwi27YkuF1xRD/3xfQ+IzfQdBhpY6lX8F2orJowXiHZY ZxNlbUyzJq4oVBaIvVvdWWBUzusZwFvy7H4/Q8lZNEa9nJ4tPNkY06+GofDtcHLf/w== X-Gm-Gg: AZFdTZdR4/NDqk9u2Id0NW+xhX8kTEoJGJ7tF19uViU13+BTXqwFRr9VlcAMJY5T/kF n4lQ7MWH1wbOjUz1IJlZaUytgnOBFzRNW881R6Bf26zo48VABeuVUi9HSQbELBSJG14Wz8LD/cb x5uO+URY+uq3eR3JTEkSDY9BAfj7CFLRFcOFy95d6adhabLMT01hVjE9A6cSiFwOU1KsNglenmN 1JS6AT6Eq1pd79kUILdRN3py1ULaBiTS9KcUmKUhf+QyGJ6QnRe5zkAHqDMGEjvm6XJRd/ia4sF 7nicpbe/oIOtz78SIEmii8l9X00MQWZVeIzIixxNJapmfdyBZINVbdZ7J8ZIbhlvlYyo7jucfMb L22pDxasFYgP4XqU1GV8+h57JKEKR6/n5UD+d26b0aWNXzzUFM8qjegevuVQsz3Ce6JDQSIqvWA jDhnq+HbmA2GB4zTRrXN7mC6kwAC1N1fVZdzP5fFsAgIgyJlu+woA1zW+pL+pWZsKtPtLZKbPeV sxFiPPb0nGp4NQEKSuF9BSym2v2mRrJF2FKWKIlUR53pQ1G4rQXxhY2DdLaTLW2w7F8BT8gaJsg c2aawHyZgclGM+kHzzNl+6aH0z7z3yixN3L9VoHukZUcb3hGn7udyi/inNEXWCU5dDs8MSv+qB1 VwvR/xW84xA== X-Received: by 2002:a17:90b:2d81:b0:3b5:35eb:5ea4 with SMTP id 98e67ed59e1d1-3b5e06a6759mr2859429a91.55.1796426567083; Fri, 04 Dec 2026 15:22:47 -0800 (PST) Received: from localhost (33.79.127.34.bc.googleusercontent.com. [34.127.79.33]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6166af840sm651056a91.2.2026.12.04.15.22.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 15:22:45 -0800 (PST) X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 04 Dec 2026 15:22:45 -0800 Message-Id: To: "Lukas Wunner" , "David Matlack" Cc: , , , , , , "Alexander Graf" , "Alex Williamson" , "Bjorn Helgaas" , "Jason Gunthorpe" , "Jonathan Corbet" , "Josh Hilke" , "Mahesh J Salgaonkar" , "Mike Rapoport" , "Oliver O'Halloran" , "Pasha Tatashin" , "Pratyush Yadav" , "Randy Dunlap" , "Samiullah Khawaja" , "Shuah Khan" , "Vipin Sharma" Subject: Re: [PATCH v2 02/17] PCI: Add an offset-indexed store for saved capability registers From: "David Matlack" X-Mailer: aerc 0.21.0 References: <20261106004218.604799-1-dmatlack@google.com> <20261106004218.604799-3-dmatlack@google.com> In-Reply-To: On Fri Dec 4, 2026 at 9:55 AM PST, Lukas Wunner wrote: > On Fri, Nov 06, 2026 at 12:42:03AM +0000, David Matlack wrote: >> The store holds capability registers only. The configuration space heade= r >> continues to be saved in pci_dev.saved_config_space, which is embedded i= n >> struct pci_dev so that saving it cannot fail. > > I'd prefer moving saved_config_space to the new store as well > for consistency and simplicity. As an optional optimization, > the saved-caps library could skip the hweight and test_bit > operations for the lowest 16 dwords. Agreed, I'll do both in v3 (more details in my reply to your other email on this patch). > >> +/* >> + * Return the slot holding the value saved for the DWORD containing @of= f, or >> + * NULL if there is nowhere to save it. Reservations that do not fit in= the >> + * device's configuration space and a failure to allocate the values we= re >> + * reported during setup, so return NULL quietly for those. Reaching an= y other >> + * register that was not reserved is a kernel bug. >> + */ >> +static u32 *pci_saved_cap_slot(struct pci_dev *dev, unsigned int off) > > Documentation should be kerneldoc-formatted so that it's recognized > by cross referencers such as elixir. Will do. > The "slot" terminology is a little unfortunate as it sounds as if > there's a connection with struct pci_slot.=20 Yes, good point. I'll swap "slot" with "ptr" in the next version. >> +/** >> + * pci_write_saved_cap_word - change the saved value of a 16-bit regist= er >> + * @dev: the PCI device >> + * @off: offset of the register in configuration space >> + * @val: value to save >> + */ >> +void pci_write_saved_cap_word(struct pci_dev *dev, unsigned int off, u1= 6 val) > > Another naming issue: "write" sounds like something is written to > config space. You're actually updating the saved config store. > > Same for pci_read_saved_cap_word(). Maybe "store" / "retrieve"? How about get/set? I'd like to avoid "retrieve" since patch 17 already uses it for Live Update, where it means something else (pci_liveupdate_retrieve_saved_state()). > Aside from the issues mentioned, this looks pretty good! Thanks for the review!