From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C94D6606A322 for ; Fri, 4 Dec 2026 23:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=sPNkgKEQ; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=d1hPqPjE DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:From: Subject:Cc:To:Message-Id:Date:Content-Type:Content-Transfer-Encoding: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=egEB4tqKAmYu1OVv3TLkXydv5XcabfSGoUbOmkXHZ48=; b=sPNkgKEQAKuO27 j2ZonkeUPiH7YVXn4dsZWxGuUgRT0ILB9WOI4NcibEId1L0R5x7D1oRIvdss1Oy2l6jUHSY1xOfZw dO+rX0UpPubigek8B+WUyfI9DVmKjqhd5yMpLmRplTeWK0WzPMziwiWLdn1LBaqRkXXScaGiZangc OTd4BC4zsMHI1NY2XOFNBUNE2aYxJ9IMvESxFof/vu2r2UGA2uNHGqWfYLoQFhZD8J4pHGPsCX7oS p0T9vdBRe2+Pk0g45P8pLaemMG3GI3uIHd1KgHlMsSnlh1+NAnmpIQeeoGEuLElZs29IlKJbGiZQf GD7Aw505dw74BJos/8Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZccU-00000001k6X-0eAw; Fri, 04 Dec 2026 23:23:14 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZcc4-00000001k4Y-2pX6 for kexec@lists.infradead.org; Fri, 04 Dec 2026 23:23:07 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-8b5a6f2f27fso764134b3a.3 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=1796426568; x=1797031368; darn=lists.infradead.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=d1hPqPjEoo6DSukdMp8HDDz6yDO0fcFwiJVneHh1Np/5oCgphi7Q6YBOIgt/+okAkd Q46eO2v/79W2rSTd5wwGx+VLtPsA4lD2cT9JOUNopOlTBDFmCd/q9RWssm0augU+a4ZA YvJOG3YaQlL0OwQfeEeRP89jbLBSLWW0vzCA0gLRA2mWD19df+6H/2Mj1NQj09lbrzy9 ccFAARnHFVNEHXKeUraEGC+kZJfcxPbyEj7D4Hin8PA4ihE+SN8fK+P6iXR664dKS4NP i809GRe8OcMPImZdi3RtAfvs7g4b8XtIH4LX55uclZKnXZ/2k84jRitr41toYtn4f7x4 VyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796426568; x=1797031368; 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=JAK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c1IYNFUcEcNkckmdHvD+F6ytcuIPVU4p8WYvhYu8D0Ed3SNN2qlx472KGl2p4LuKdmN+1d7I3g m6CX2s7mHxA== 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-Archived-By: 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_152255_336903_166B413E X-CRM114-Status: GOOD ( 17.39 ) X-Spam-Score: -17.6 (-----------------) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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!