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

Re: [PATCH v4] vpci/msix: handle accesses adjacent to the MSI-X table


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 28 Mar 2023 14:16:41 +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=nRmXVPK24nPfY7pgIbbDlalW9xrFtKsQ5snuwt5GU44=; b=OtPakWgbToTp4AD46tFcVhtTziPWfNTXHadNlGH2XcCBr++l85q9E54JMum6QXBh2HXSw2VPg3HNYkoHNmrcc7F9wNfNyp5VVjpvuTsILE7OsxYddebMavG4zK2ASsSV/nLbsODObjC6FKE1cvlQbkXtA7wTiSxqCmJVEjs8R9Qu71LDWSUV2s1UkMAtPa+M4cK1jLwxT0v9xVwMpV/dqZv40hVpkvqwy9CUQgpVMwAPa+LwR1Gd3Q4w6BmbS/cLkLhWFjoIDzmiGaqQlTjKF/Jj1fGTeSzoieTgIGTP8iJGrsIEOfja6XakLGqbmwTqiCW8fLgIdNUYbb9yzY4OKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oa/PAlTOyaD2+pukA+xRy8QZN+lt3jf2G6bUHa5rfmqd/sRrz1/e8bsVtRxyZF8QeBqa6E5Z7odo8vlcGogQ3pMt2t1cfY40yuVdht4oTphaiBocQRsHNPDYRx/7iLRGNxzspA2Ij4iI0OYQhcm3aJ3udZeRCOKxBBV8myOTGpTi3Qsl8UXpeAq1ZjQt1JMETW09S0P4ENhdzuTccBf8njSLHrq5SC9yfHnPo9UmouWLl3LJJI6NLlk1n4NDPGRp+Oy42eHMUoCIsRCN2goAWLHqrViS3fx/ovBUAlc4ZixYWVDgTDW6JEi96SZHC+kyAdUJxltWmNtAxEtQO1as5A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 28 Mar 2023 12:17:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.03.2023 13:17, Roger Pau Monne wrote:
> The handling of the MSI-X table accesses by Xen requires that any
> pages part of the MSI-X related tables are not mapped into the domain
> physmap.  As a result, any device registers in the same pages as the
> start or the end of the MSIX or PBA tables is not currently
> accessible, as the accesses are just dropped.
> 
> Note the spec forbids such placing of registers, as the MSIX and PBA
> tables must be 4K isolated from any other registers:
> 
> "If a Base Address register that maps address space for the MSI-X
> Table or MSI-X PBA also maps other usable address space that is not
> associated with MSI-X structures, locations (e.g., for CSRs) used in
> the other address space must not share any naturally aligned 4-KB
> address range with one where either MSI-X structure resides."
> 
> Yet the 'Intel Wi-Fi 6 AX201' device on one of my boxes has registers
> in the same page as the MSIX tables, and thus won't work on a PVH dom0
> without this fix.
> 
> In order to cope with the behavior passthrough any accesses that fall
> on the same page as the MSIX tables (but don't fall in between) to the
> underlying hardware.  Such forwarding also takes care of the PBA
> accesses, so it allows to remove the code doing this handling in
> msix_{read,write}.  Note that as a result accesses to the PBA array
> are no longer limited to 4 and 8 byte sizes, there's no access size
> restriction for PBA accesses documented in the specification.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> Changes since v3:
>  - Keep the vpci lock taken for the duration of the access to the
>    mapped region.
>  - Move back the handling of unaligned accesses before getting the
>    table map.

I can see why you've done this; let's hope the excessive logging won't
trigger in reality.

Jan



 


Rackspace

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