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

Re: [PATCH for-4.17 v3 2/2] vpci: refuse BAR writes only if the BAR is mapped


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Oct 2022 16:31:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=GgEHVT/gYchzDXCf/78mHRzmvt3VdVeADW4P/SMvYxo=; b=gJ9FcTA13XFBM2xCqPfTUYeGTPrt4JGR/ejXwhhTt4h1vc376vzKd12zY6PX7QxusTNS02WWNXYscogBwM4v/pYlLC2jyq1C8yOpxvD6GkvwqTkGRPYoQofynJcGjrM8fu+6OsJWFCAAIakQkaQN2QjBGkMsTmoOvOpn8EbHXbaCH8OK5jOPokcN1zk87hnXRIOmCe7HUWoT+0onuFwwEDp95M40gt5bkDRz7W8Unu3mOU2zrptCjZQN3rbcYJaXFae5efYedf6inzBlbxsAE5bKbHg39UpcE5LJnjDd3Ryw2Remwv/f+Kb87YXuiVBvwGcfWwpSw8A8fZs5M/K4Ng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgQUXbSfZMtffI3N6Y2NlJ2uZz43fSr9eohvv42Y4NJe4b2oR9C2iB3rKIcMBFLL3gcpzyRmPteWkY0/DCC1LSsiHJGpVGuw3yn/BIkYR46bUE4rFZbLfQXdfp4GsvvDpXF/LQBb9NgtCtvx8EJkjJ/LQkbGZFtrOHIa6uiKgcmw+EXP8F6SuMyZjrvA6f7ITvwopL66fZFbE61DXzL729COgluz7IkHcZCJWeAOwhkLwN487UGLjF/eXpvVG49CyOIb4DgUhoZ1zDYd/RucHjBXjJQZLqsn/zJsVbgVbIgrjT34bDD0YV7alYJaEP9C7r7bI9bN0GkVb9ZoeE36mg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry.Wang@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Oct 2022 14:31:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.10.2022 15:23, Roger Pau Monne wrote:
> Writes to the BARs are ignored if memory decoding is enabled for the
> device, and the same happen with ROM BARs if the write is an attempt
> to change the position of the BAR without disabling it first.
> 
> The reason of ignoring such writes is a limitation in Xen, as it would
> need to unmap the BAR, change the address, and remap the BAR at the
> new position, which the current logic doesn't support.
> 
> Some devices however seem to (wrongly) have the memory decoding bit
> hardcoded to enabled, and attempts to disable it don't get reflected
> on the command register.
> 
> This causes issues for well behaved domains that disable memory
> decoding and then try to size the BARs, as vPCI will think memory
> decoding is still enabled and ignore the write.
> 
> Since vPCI doesn't explicitly care about whether the memory decoding
> bit is disabled as long as the BAR is not mapped in the domain p2m use
> the information in the vpci_bar to check whether the BAR is mapped,
> and refuse writes only based on that information.  This workarounds
> the issue, and allows domains to size and reposition the BARs properly.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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