[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Wed, 29 Mar 2023 10:14:23 +0200
- 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=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=6ffu8UzT4EyYI0xuDQ4y8k/B7uxLU278y9xgVNBg13Y=; b=SwO+kG8ox4KKSzszGfxh1OT52gAmEWHqu6gYnXoezYfePsCKjZl4QqGNyiN7Ka19CQrSOYnsO0i9UstMlEaA3FmNABUngk3iMY4wEAZqh8hGVLiisjE5SLAnp+Nrbaads5NddfdIaaRO2wxKN2UNuTdjeRhrjvyVbp/b38N+JGp9NWJW8b7Sn3zBLqttekAVcBIPZS7zJEGuvjnS8niSH44ShcrAZRzj/sYn6JGrJI3XAiMlfFsoaGFGGWtkE/MX2P8/IEkc/iBiYlNLwFoRW6sCzU6UfuIYNPOv5inA6WLlP3SBX/KMYVUDcFawxqSpi0wgKypceX9IxatSdZGvYA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FM8z3jgZNIuyyHHiqwR6xs7j8HCM90bq5B3QdoB7LSApi2X3lxq08i9cw1hFWeb1i7BVvS3ASxzl6WHtaJlIDWimRebvghEOMigTrFcpe5u2O3ubrewx6ArTNlI8VBtT2NOasgadnOQT5GhyMrQWowDvBcNLcV+WxfEylyOb4yau5hnkq6mWYRGzAjU9pVoenWbQUOPE88tyobo6zSIPbC2ykrNxcMg8O5gfQcZDy0v19rIUt/qxnNQQwQzdQS1UCF1V9IZCq+LFJKWo8eVG2wUbNZjU2ldQh5HOKEu9wtMoLi46ewMXygnB75O/VP9Y1gapx9IaMPVC2VPmcsdoDQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 29 Mar 2023 08:15:11 +0000
- Ironport-data: A9a23:nRFGdK11+8o7ttwQU/bD5cFwkn2cJEfYwER7XKvMYLTBsI5bpzwBy TAXXT3XaK3eZWajeNl+OYjk80wOv8LXm9BhSFc6pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+HuDgNyo4GlD5gdkNKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfWEdh8 NkGKys3PkqvpsaxwJKYVup2r5F2RCXrFNt3VnBI6xj8VKxjZK+ZBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxpvS6PkGSd05C0WDbRUsaNSshP2F6Ru 0rN/njjAwFcP9uaodaA2iv03bKXx3yiBer+EpWG/fRSjQKJ2FBNKy0dZ1md/fiSkEGhDoc3x 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8Uq5QfIxqfK7gKxAmkfUiUHeNEgrNUxRzEhy hmOhdyBONB0mLicSHbY86jOqzq3YHIRNTVaOXNCShYZ6d7+po11lgjIUttoDK+yiJvyBC30x DeJ6iM5gt3/kPI26klyxnif6xrEm3QDZlVpjukLdgpJNj9EWbM=
- Ironport-hdrordr: A9a23:M8JPuapnAlQP4VpZztTfVJkaV5tBLNV00zEX/kB9WHVpm5Oj+v xGzc5w6farsl0ssREb9uxo9pPwJE800aQFmbX5XI3SJTUO3VHFEGgM1+vfKlHbak7DH6tmpN xdmstFeaHN5DpB/KHHCWCDer5PoeVvsprY49s2p00dMD2CAJsQizuRZDzrcHGfE2J9dOAE/d enl716jgvlXU5SQtWwB3EDUeSGj9rXlKj+aRpDKw875BKIhTaI7qe/NxSDxB8RXx5G3L9nqA H+4kfEz5Tml8v+5g7X1mfV4ZgTsNz9yuFbDMjJptkJJi7qggOIYp0kf7GZpjg6rMym9V5vut jRpBULOdh19hrqDymIiCqo/zOl/Ccl6nfkx1PdqXz/ofbhTDZ/L8Zan4pWfjbQ9kJl5bhHoe t29lPck6ASIQLLnSz76dSNfxZ2lnCsqX5nteIIlXRQXaYXdbcUh40C+0F+FosGAUvBmfYaOd grKPuZyOddcFucYXyclm5zwOa0VnB2JRuCSlhqgL3m7xFm2FRCi2cIzs0WmXkNsLgnTYNf2u jCOqN00JlTU84/d8tGdag8aPryLlaIbQPHMWqUL1iiProAIWjxp5n+56hwzP22eaYP0IA5lP 36IR9lXFYJCgPT4PC1rd12GkinehT/Yd2t8LAS23FBgMyzeFKxWhfzCmzHkKOb0oYi64PgKr OO0altco7exFvVaPl0NjLFKudvwFklIbgoU4UAKiazi/OODLHWncrmV9uWDIbRMF8fKxPC6z 04LXLOGPk=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
Roger.
|