[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 Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 29 Mar 2023 10:52:38 +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=rgqRLCvRS8UdDHfNHohzGN2fUAUG3Qc8bc8B8ab12HE=; b=P1+sh6wnYgVwPlGhOKLuQJ988brRmyVi37jXU3Rqfp62bcgEOKkvd/TDgwNaDWatSJImyCOIBOWsaFQ9WJfVqnvTJg19IA6Wy+V++JkNNnZVDYpSLzFyKffKvEAW94P12zVe6rdhw7BsZrCAHIwMwjwKNQ7uNfdX6c2QQtAdX9Czrhdk3JUXRsV9O9i4wP9tz7R974LJB90/zD73W26fy9m4bh//pRHpL5xMm4fXnl1cada360wt8Pbg5iSPSzAGKM9oWak+pPnaWBBjOepr+eSBOA/Twn7nxI5xjltSz1fEKLb9SU9z2hf1RdCku7a+Pd9tFABgODfiPsBrR0Z9uQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BpNelwCLnH03khw8CLOoLpW6les24SyttU9DupJNE+tNKEa3KM+Tfl4Xbq1ppVKrm30ppQL+0BwkRO+Zy0Q9SJEaGTgku+1d93ybv+iT4p6y4MRAXt5TUHyWKBhn6F+M7QmjzBOeInQRDJRUINyiESRxWP4krISBKbq9tmVE16kGI9UOm6VgsExXhygYlvRdZddSOJwMwo8kk3Mjuxk5p7zxFqs561fe1TfV5bpSXZkdGYwBaXSAW347kbgJnEQjXm+BszSWhqMzaHqivpneEveSQrsDQgu/QZpargb6wQ3pGD4i3mpeJsXJafBkg8YiYc1lMyUrH5pPmkQ4Og/VFQ==
  • 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 08:52:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.03.2023 10:14, Roger Pau Monné wrote:
> On Wed, Mar 29, 2023 at 09:55:27AM +0200, Jan Beulich wrote:
>> 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."
> 
> Thanks for noticing, I really wasn't able to spot it when I checked.
> I guess because of the intermixed "Implementation Note" sections in
> the spec.
> 
> Will amend and resend v5 then.

The patch was committed already, so it'll need to be a incremental new one
if we want to enforce to constraint again. (For just a description change
it's too late now.)

Jan



 


Rackspace

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