[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] vpci/msix: check for BARs enabled in vpci_make_msix_hole


  • To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 4 Mar 2026 16:23:37 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7eDQGeM3BN14L0eXKMI26nHxKJwZ35+HWJqpeczVuNs=; b=F9gLIdhDtwfUT1Uzge/WVHuqwEeHmKhKOPVTI3hwF33jyNzL8sRDYS2MGyA7mY7hbIpw9Gnc+Wb1EGfHcM1XsKurKZ5jDAl+DEl3XmBjzwqZn5dYoXGj4/SRhAMwP7z7cYRgYCDgcDZbgHCptdRZ/VeyWlcf9X44OKEk9NJp9YZ+xYTFblhUzVoxalGhIE722ICPCoEg3xIhtG1u9/iMVMDA6U9UNkqs/XkeLzq0wqRDnetYQcxGSPxV5hgYuNCTwTtETIbmFDFsFdjUJQ36GbpXjpaC7rjMTuNqppoKZMEAgIXSqwsF0t/FgFkyg1wNCUyc6UMOAsmQzsl4FHHr0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VbkyTNPSRCM52UNnz/RrbYSaHcfDseT0h4UVDzqlBeLiE/jRvGIUjzi3W4AB/bej9pARRsrn85qk2yt65wUv8bNDxoxUU4BN7sRkRpb3uSSQBmjnLrHZZjibddaUw+ndnJiOrcR0fk+1L9YG/3VQ19ZV08+q//CRKOGn0lT/ifMkqeFldgYg5iCRcxpWU0g6C+Yf+A29MncbCbzvdCKG8Zk8t3Wcy0WEZ0f/Uaj0ovXllJ2EMGHz8qcgx7kMGmBMPsdJSaIK5zmbwGrzFG825u5u7IQ7WYsz7psqVmQP+sfdG4bACByn1PaNZQgnfZ5J4+SMOK6JMQ6v4+5LsHpVwQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Wed, 04 Mar 2026 15:23:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Feb 25, 2026 at 09:57:38PM -0500, Stewart Hildebrand wrote:
> A hotplugged PCI device may be added uninitialized. In particular,
> memory decoding might be disabled and the BARs might be zeroed. In this
> case, the BARs will not be mapped in p2m. However, vpci_make_msix_hole()
> unconditionally attempts to punch holes in p2m, leading to init_msix()
> failing:
> 
> (XEN) d0v0 0000:01:00.0: existing mapping (mfn: 1c1880 type: 0) at 0 clobbers 
> MSIX MMIO area
> (XEN) d0 0000:01:00.0: init legacy cap 17 fail rc=-17, mask it
> 
> vpci_make_msix_hole() should only attempt to punch holes if the BARs
> containing the MSI-X/PBA tables are mapped in p2m. Introduce a helper
> for checking if a BAR is enabled, and add a check for the situation
> inside vpci_make_msix_hole().
> 
> As a result of the newly introduced checks in vpci_make_msix_hole(),
> move the call to vpci_make_msix_hole() within modify_decoding() to after
> setting ->enabled.
> 
> Fixes: ee2eb6849d50 ("vpci: Refactor REGISTER_VPCI_INIT")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.