Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 614F5E6748D for ; Mon, 22 Dec 2025 08:39:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1191978.1511350 (Exim 4.92) (envelope-from ) id 1vXbS8-00042u-Go; Mon, 22 Dec 2025 08:39:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1191978.1511350; Mon, 22 Dec 2025 08:39:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vXbS8-00042n-Dw; Mon, 22 Dec 2025 08:39:40 +0000 Received: by outflank-mailman (input) for mailman id 1191978; Mon, 22 Dec 2025 08:39:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vXbS6-00042h-I4 for xen-devel@lists.xenproject.org; Mon, 22 Dec 2025 08:39:38 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bf3a4df3-df11-11f0-9cce-f158ae23cfc8; Mon, 22 Dec 2025 09:39:36 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-42fb0fc5aa4so3008737f8f.1 for ; Mon, 22 Dec 2025 00:39:36 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324ea1b1bdsm20250637f8f.8.2025.12.22.00.39.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Dec 2025 00:39:35 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bf3a4df3-df11-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1766392776; x=1766997576; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=kM/G+3vOlIVJr3eIOgvO/AXnK7vKxY6uR+eXbYXpnBI=; b=b9RkonsTa5gejcIMoQWk7VqE7aawvxxdeYPR3CPSrQGBbDfcbnyz1bfLdeENQVKhl7 swA3TcqWcqRbbFWdK97BBQKIKxA1GUgCtwiLo5DvzyAzOUlS7JKgAq1R6VzxOk/i2tUS B/7WMTXBPcfz/6xMLAwIMTLtmutZUnMeHCC9PzqssHtUYpuezAE1LH+1z0i+NPi/guUj /OHdNJ3c+HL9BvP2EX3DYwdADVMlq9oVbxd8s8Yy1+WlUKYSmUwxMjSOj4rCPm4s4mqC dOE91AXPv/o7fr+q8R3SkEh9C6RjfjvFGAXTa+aq5nZSsdiWyeMGz/c9Y8DYuAI64a1w Khpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766392776; x=1766997576; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kM/G+3vOlIVJr3eIOgvO/AXnK7vKxY6uR+eXbYXpnBI=; b=rpaRRL0RHSYluJ2MJ/EWqhoP8sKlDbJ02rNQ7bmGrzJMRSbqgode3clqXx48WKuGxq Rl0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56cc with SMTP id ffacd0b85a97d-4324e4fdb0bmr10316197f8f.30.1766392775951; Mon, 22 Dec 2025 00:39:35 -0800 (PST) Message-ID: <4159dd59-4301-4265-bb5c-82949ed095a9@suse.com> Date: Mon, 22 Dec 2025 09:39:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] vPCI: avoid bogus "overlap in extended cap list" warnings To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: "xen-devel@lists.xenproject.org" , Chen Jiqian References: <26294a6d-e99b-4290-988a-da7b7b838651@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 19.12.2025 09:39, Roger Pau Monné wrote: > On Thu, Dec 18, 2025 at 08:56:24AM +0100, Jan Beulich wrote: >> Legacy PCI devices don't have any extended config space. Reading any part >> thereof may very well return all ones. That then necessarily means we >> would think we found a "loop", when there simply is nothing. >> >> Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0") >> Signed-off-by: Jan Beulich > > Acked-by: Roger Pau Monné > > With the U suffix added to the constant, as noted by Stewart. Thanks, albeit I'm not quite convinced I actually should put it in. Imo ... >> --- >> This is the minimalistic change to get rid of "overlap in extended cap >> list" warnings I'm observing. We may want to avoid any attempt to access >> extended config space when there is none - see Linux'es >> pci_cfg_space_size() and it helper pci_cfg_space_size_ext(). This would >> then also avoid us interpreting as an extended cap list what isn't one at >> all (some legacy PCI devices don't decode register address bits 9-11, some >> return other non-0, non-all-ones data). Including the risk of reading a >> register with read side effects. Thoughts? > > I think that's likely too much - for the hardware domain we want to > allow the domain to access all the PCI config space, regardless of > Xen's thinking there's nothing there. ... we really need to do better here, irrespective of this intended behavior for hwdom. Us accessing the supposed extended capabilities list is already a mistake when there's no extended config space. Us then calling vpci_add_register() to "pin down" the value read is wrong too in that case. Question here is whether even with that fixed the check being added here would make sense to keep. In that case putting it in now and then doing the other re-work would likely be the right thing to do. >> The DomU part of the function worries me as well. Rather than making it >> "read 0, write ignore" for just the first 32 bits, shouldn't we make it so >> for the entire extended config space, and shouldn't we also make it "read >> all ones, write ignore" when there is no extended config space in the >> first place (then in particular also for the first 32 bits)? > > If there's no explicitly handler added, the behavior for domU will > already be to drop writes, and return reads as all 1s, which is fine > for the rest of the extended config space? We just need to return 0 > for the first 32bits to avoid seeming to have extended capability > support. > > Maybe we want to keep the same behavior as expected from native for > legacy devices and just return all 1s consistency for the extended > space? > > Hence we don't need to special case this region, as it's already > covered by how unhandled accesses are resolved for domUs. > > Or is there something else I'm missing? Imo correct behavior would be to return 0 for the first 32 bits when there is extended config space, and ~0 when there isn't. Jan