[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 17:54:25 +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=uC7NLkYgKm3Arkz4reuBJQX25+4AxfjyXOCHSyXKcG8=; b=EcN5WfLSWybXB7sWPqWJisrTbeIAO//SRLqTaM/q+3EWGJ2SrdAH9GbweU4B5W7wkiWCbLyHT75crXpZOiXhYMPGyLStewUGfcLv+9MtLK6ZoqzOLEf70RlMdq7Ra+rrgnFMEAaug9bKfFA1DOOlqSvvR4tfcLNpRm3xz0F3FaadpXhsrgBwP+xWrnVgiJgzDYAKGC5JnqRSjRA0mKFDCUUwIeRb9YVj1IkOJMmVr2W6Wc4cBAPUgrO29/cV3qLRJh6qcComXQVnAGY68jHHodl/BkE7vzvwDLuhlRhhPwVZo1NdZkh2gYkW2xd9rvfouaz308FHJhQYA+TbFK37pQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yi1nqTE2m9zIv2CAm++COvJmPlUuCsmb38rM7nyAhjF4pB5pJZyHZTwHq17iNYEyNb26X6ZCrgJ6eXRD6bOT3YZdtEPxMEVJnpii+qehbP6EXokeYxzeNyq5IziVh7OtLoD45uoTiX7CQE4A069907dnEER6sn2vPkJoHe/kWd6RtuN5vWOvOHpgPurqLSJODDxRMraKmZkkhkUkMZmDc4ADPtIk84bWgRzoo4mRxr80z3Kg6iaZOYGJqAxsua9nzeMRxoPr7MkjKINZ7vbsZXgjIUqLDveim6vbSZ8UU1pYth1hUE9lD8KGx2kB+5KCSpfN+TW3UmYCiAxRtriaKQ==
  • 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 16:54:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Mar 04, 2026 at 10:39:56AM -0500, Stewart Hildebrand wrote:
> 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.

Sure, please keep the RB.

Thanks, Roger.



 


Rackspace

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