[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: Wed, 29 Mar 2023 09:55:27 +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=aw+6nKsp25v0JyTW/mJ0Av+Mg24DK3K6bNYchYNO60g=; b=XszwJ1pXSTayxRcMPE7NHa2ajdZlfuaxnPhF89zIp+cxGjvmBK//1kwlfyialPaM56i6DuN5Dly/YEnf9FA4FpbdX+QVku++xLqy50pHhoUGyU7sJkY27iBJbBfyEngQ7SsnT/za67EedMINX+6O5Qzk0yTPmUB2/bZUU+oXszly6JH2gc9YSd/bSopjVmzQAaBOh5csy9nJQDGunPApyhYe60Vw2yyst0ybUa26ZKNLLH3rC9jnAZPWkS2fAnShhc/Zoo9M1c9gf8h2PdomZvCwfqvwpkISLNxe/Qdzt+UPDHcLRIarCHWP/pdXSKe0Iut4ZmGzmuDmXrGLTvFKYg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kUW+GQs8nNwFSyb0N2EoUJnnTb8b04LjywLP85c9owWm16yDVf3enuivMrOSdBlDLH5pP1zr/hKgKTLFIjzVHTGfvYc3YxghkM/bd5735vPdzh65C+CbDzzpki7l0Am2Oo0Sff210DYv8K/ZzmE6GEz1paqA/0aSrNBnJxL61AIKocIauzEAtcZ4p/Op4G+CbbSeWO3xIiksn0rpGt4nIjoq+11ro/2ZD807iOscbKieOT5x41/TCKijPdL/Za/5X6GKJryqdVYEXO5VIq0/Sfefk0lVoUXPmTKfnq7J3vWOWUNRp4TVrL3uZP5OWgPZKU0mDOd5KWsOEsl7KuVejA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 29 Mar 2023 07:55:46 +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.

I should have (re)checked the spec. There is a restriction, common to table
and PBA: "For all accesses to MSI-X Table and MSI-X PBA fields, software
must use aligned full DWORD or aligned full QWORD transactions; otherwise,
the result is undefined."

Jan




 


Rackspace

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