mbox series

[v2,0/5] x86/iommu: make CX16 mandatory for IOMMU

Message ID 20250124120112.56678-1-roger.pau@citrix.com (mailing list archive)
Headers show
Series x86/iommu: make CX16 mandatory for IOMMU | expand

Message

Roger Pau Monné Jan. 24, 2025, 12:01 p.m. UTC
Hello,

The following series is the original CX16 series sent by Teddy, with the
CX16 checks split into a separate patch, plus one extra patch to switch
AMD-Vi to use CMPXCHG16B when updating Interrupt Remapping Entries.

Note that last patch to use CMPXCHG16B fixes a real bug with AMD
hardware.

Thanks, Roger.

Roger Pau Monne (1):
  iommu/amd: atomically update IRTE

Teddy Astie (4):
  x86/iommu: check for CMPXCHG16B when enabling IOMMU
  iommu/vtd: remove non-CX16 logic from interrupt remapping
  x86/iommu: remove non-CX16 logic from DMA remapping
  iommu/vtd: cleanup MAP_SINGLE_DEVICE and related code

 xen/drivers/passthrough/amd/iommu_intr.c    | 88 ++++++++++----------
 xen/drivers/passthrough/amd/iommu_map.c     | 42 ++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  6 ++
 xen/drivers/passthrough/vtd/intremap.c      | 88 +++++++-------------
 xen/drivers/passthrough/vtd/iommu.c         | 90 +++++++--------------
 xen/drivers/passthrough/vtd/vtd.h           |  5 +-
 6 files changed, 121 insertions(+), 198 deletions(-)

Comments

Andrew Cooper Jan. 24, 2025, 2:24 p.m. UTC | #1
On 24/01/2025 12:01 pm, Roger Pau Monne wrote:
> Hello,
>
> The following series is the original CX16 series sent by Teddy, with the
> CX16 checks split into a separate patch, plus one extra patch to switch
> AMD-Vi to use CMPXCHG16B when updating Interrupt Remapping Entries.
>
> Note that last patch to use CMPXCHG16B fixes a real bug with AMD
> hardware.
>
> Thanks, Roger.
>
> Roger Pau Monne (1):
>   iommu/amd: atomically update IRTE
>
> Teddy Astie (4):
>   x86/iommu: check for CMPXCHG16B when enabling IOMMU
>   iommu/vtd: remove non-CX16 logic from interrupt remapping
>   x86/iommu: remove non-CX16 logic from DMA remapping
>   iommu/vtd: cleanup MAP_SINGLE_DEVICE and related code

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

CC Oleksii.  Patch 5 is a real bugfix that needs backporting, and the
prior patches have been in an almost-ready state for more than a release
now.

~Andrew
Roger Pau Monné Jan. 24, 2025, 2:27 p.m. UTC | #2
On Fri, Jan 24, 2025 at 02:24:34PM +0000, Andrew Cooper wrote:
> On 24/01/2025 12:01 pm, Roger Pau Monne wrote:
> > Hello,
> >
> > The following series is the original CX16 series sent by Teddy, with the
> > CX16 checks split into a separate patch, plus one extra patch to switch
> > AMD-Vi to use CMPXCHG16B when updating Interrupt Remapping Entries.
> >
> > Note that last patch to use CMPXCHG16B fixes a real bug with AMD
> > hardware.
> >
> > Thanks, Roger.
> >
> > Roger Pau Monne (1):
> >   iommu/amd: atomically update IRTE
> >
> > Teddy Astie (4):
> >   x86/iommu: check for CMPXCHG16B when enabling IOMMU
> >   iommu/vtd: remove non-CX16 logic from interrupt remapping
> >   x86/iommu: remove non-CX16 logic from DMA remapping
> >   iommu/vtd: cleanup MAP_SINGLE_DEVICE and related code
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

> CC Oleksii.  Patch 5 is a real bugfix that needs backporting, and the
> prior patches have been in an almost-ready state for more than a release
> now.

I've split the checks into a pre-patch, and did a bit more cleanup of
code that was no longer needed (pre/post interrupt mask before IRTE
update), but overall the code is the same plus the extra fix.

Thanks, Roger.
Oleksii Kurochko Jan. 27, 2025, 10:38 a.m. UTC | #3
On 1/24/25 3:27 PM, Roger Pau Monné wrote:
> On Fri, Jan 24, 2025 at 02:24:34PM +0000, Andrew Cooper wrote:
>> On 24/01/2025 12:01 pm, Roger Pau Monne wrote:
>>> Hello,
>>>
>>> The following series is the original CX16 series sent by Teddy, with the
>>> CX16 checks split into a separate patch, plus one extra patch to switch
>>> AMD-Vi to use CMPXCHG16B when updating Interrupt Remapping Entries.
>>>
>>> Note that last patch to use CMPXCHG16B fixes a real bug with AMD
>>> hardware.
>>>
>>> Thanks, Roger.
>>>
>>> Roger Pau Monne (1):
>>>    iommu/amd: atomically update IRTE
>>>
>>> Teddy Astie (4):
>>>    x86/iommu: check for CMPXCHG16B when enabling IOMMU
>>>    iommu/vtd: remove non-CX16 logic from interrupt remapping
>>>    x86/iommu: remove non-CX16 logic from DMA remapping
>>>    iommu/vtd: cleanup MAP_SINGLE_DEVICE and related code
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

As we disscussed in matrix, with proper review R-Acked-by: Oleksii 
Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii

> Thanks.
>
>> CC Oleksii.  Patch 5 is a real bugfix that needs backporting, and the
>> prior patches have been in an almost-ready state for more than a release
>> now.
> I've split the checks into a pre-patch, and did a bit more cleanup of
> code that was no longer needed (pre/post interrupt mask before IRTE
> update), but overall the code is the same plus the extra fix.
>
> Thanks, Roger.