[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Wed, 4 Mar 2026 10:39:56 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=vyhb4HtPgNTNTQK78/KCtQ5UY9dl0XWdx5R5IX5sM0k=; b=d+MKV2m4MoyiZ3gDmY2vQt6khSc84sFyeFt33YUbQMhff2erIxpiHao0g92hkqDJHBvsra9p7+lHvutMzkcS9/MwiEL/sAMolhUS707pIZ5jVM8SoVtDX4I3F4iPK10sd4DKv9O1saxDmKJ8GXdtE5wLMNQUI90lwcsyjbO2wUKMHpRS95NcVTDt8Cr4GKAut2oZ9bh3aFqXVU2NwjgJ3alpspJskKhDlMv7W3w3LeKWjQX+Q45ZRnRm24CGLkey1IIgf306vXv60aiR9xeoMjw7cJPyIj4B9MLvIUP9vPLkroIS2u3j2qfjrzpjurN98kjVI+Kw4IFOSHJIXwpWLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uFdiVgCPP+aJXFZ02qJTAAqeW8c2H19VtiZJsPyI2iejWuJnVeB4LAZbOjjOBt1tk9risT2wXfw+4NXYB6K8POqueW+QYQ0DOQBeE1suhiL7SuVIsEtMdbtfM2pcip0POoZXUVWGpduaD2Gj4ebiTwr/OzRbbdPOkjgg2srJExbRRtV+EqPkVTbfxs+xuiu1aWdL0zHUfulMjvdM1H/Eh9eqMwjKK3qgc46mHJF8QcTo8NqHhwi4B3DEVDlzXpJgZvbJuLs54lDnFBwJnlLTurDbyOWbce1Uk1tDIPz5PWdcBY69bZ1h3WAQto1MGddlGVqRIsnbYKSJq0fPAoLeXA==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Wed, 04 Mar 2026 15:40:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 3/4/26 10:23, Roger Pau Monné wrote:
> 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.

Thanks!

I would like to point out that this now needs a rebase:
The helper vmsix_table_bar_valid() should be moved to the new private.h.
I'd be happy to send v4, assuming I can retain your R-b.



 


Rackspace

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