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

Re: [PATCH] xen/vpci: zero guest-visible BAR addresses to ensure domU asssigns its own


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 4 Mar 2026 16:46:44 +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=cow4Ee/eldGQKE8TcB2/TyGw1p+U5zfANcUH1l9/wyE=; b=QR5+Xxvp3cpAOMZ9gvJM+PMI0a1Kviq2cTVsZKksjmE4N5tzPnxby9AyZiYYKRRlPOKZOAJo6RlPli4YGW0v0xTIrXdbQIASuIoB1hCV+GMQrpJD3LyA19DHl6zQ5XWxOsJQBuahVmsBk8qjo/SqYJqw7C8eVegSlJHHn0mWLr2jnyL6Wud6SVidJ3AASUoxpORX2w0U/iiGgPqmn2BWWm9Pklx0y6hEI+ZLjWyc0pGLIqqyY5h8LPqAcvzzDn7wmW9FvG9DrTUgjOMrBIFbpwn8rWgUpasGRfuSPW3CQdJq31UMN8NkA9YXMvWddqlb3Hk9KTdseFGOV3N4f794ag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HYQJ2QaT+r01EeoYFzmxo1kOSfA54ndTS+ZXsxg2WTVezoamAz4v3dp8CPLH9jPWQQkbuApTjm3nehioQyIVz7ocB31VeTLtqovxIb/nMIaTkHl+W6Ire9GML5qCJQVljzvHTZzBYTVxXjaacVSpfa5ip9xvPGaWhqGIyfyqLqBqhHYpzUIsd30Q29LKR3f+GPJ8WjrK4clFkvtz1ef7FfwxreTO7/AkHYnTuGOyKIrL+KYd2qsQ5zSqYAfADe/uE86/nJixgKwqi+0NFVqKvh//dnGwMRtvFL2eAy+TzeZqg2/s5r8rOp1I0EYX49W97U0kAbOVgsTDVX20hEN42w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Ariadne Conill <ariadne@ariadne.space>, Steven Noonan <steven@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 04 Mar 2026 15:47:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Feb 26, 2026 at 08:47:52AM +0100, Jan Beulich wrote:
> On 26.02.2026 03:50, Stewart Hildebrand wrote:
> > On 2/25/26 10:37, Jan Beulich wrote:
> >> On 25.02.2026 00:12, Ariadne Conill wrote:
> >>> From: Steven Noonan <steven@xxxxxxxxx>
> >>>
> >>> If we just use the host's BAR addresses, the domU might not attempt to
> >>> reconfigure the BAR ranges and may never try to map them with the IOMMU.
> >>> Zeroing them ensures the guest kernel knows the BARs are not configured
> >>> and needs to make its own choices about where to map the BARs.
> >>
> >> Yet for this, don't we first need to expose a full topology to the guest,
> >> i.e. at least a host bridge, and maybe further bridges?
> > While we eventually do want to expose (a) virtual bridge(s) to vPCI domUs 
> > (this
> > work is currently in development), I don't think it's pre-requisite for the 
> > code
> > change herein: clearly, leaking host BAR addresses to domUs isn't right, and
> > there's no need to wait to address that.
> > 
> > With that said, the commit title/description don't align well with the code
> > change. Assuming we want to move the code change forward, for v2 of the 
> > patch I
> > suggest dropping the 2nd half of the title, and reworking the commit 
> > description
> > to focus on describing the code change at hand and less on what the domU 
> > might
> > do.
> 
> That would indeed work for me.

+1.  The "try to map them with the IOMMU" wording is not accurate
IMO, and wants replacing.

It would also be nice to mention that zeroing unconditionally is fine,
because for domUs the memory decoding bit is also unconditionally
cleared, so there will be no attempt to map the BARs into the guest
p2m by vpci_init_header().

Thanks, Roger.



 


Rackspace

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