All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/1] tag IOMMU-protected devices in Dom0 fdt
@ 2021-10-04  9:54 Roman Skakun
  2021-10-04  9:54 ` [RFC 1/1] xen/arm: set iommu property for IOMMU-protected devices Roman Skakun
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Roman Skakun @ 2021-10-04  9:54 UTC (permalink / raw)
  To: Stefano Stabellini, Julien Grall, xen-devel
  Cc: Roman Skakun, Roman Skakun, Volodymyr Babchuk, Andrii Anisov

From: Roman Skakun <roman_skakun@epam.com>

At the moment, Dom0 can't distinguish which devices are protected by
IOMMU and which are not. In some cases, this can cause swiotlb bounce
buffer use for DMA addresses above 32 bits, which in turn can lead
to poor performance. I started a conversation at [1], where we discussed
addition of a new device tree property to mark IOMMU-protected devices for Dom0.

As a result of negotiation at [1], I would like to present two
patches:

1. The first patch for the hypervisor. It adds a new device property
'xen,behind-iommu' to a relevant device node when the device is
IOMMU-protected.

2. The second patch is a Linux kernel counterpart. It detects the said
property and disables swiotlb for a device.

There is a possible issue: some devices may not be able to use DMA
addresses above 32 bit boundaries, so we can have problems in the
direct DMA mechanism when swiotlb-xen is disabled for a such
device. More generally, this can affect any device which DMA address
range is narrower than CPU one.
 
In this case,
the device DMA address should be no bigger than 32 bit boundaries for
each device that is not using swiotlb-xen.

Several ideas on how to overcome it:
1. Do not use high memory for Dom0.
2. Set DMA 32bit mask for each device if swiotlb is not used for this device.
3. Force balloon driver to allocate buffers only below 4GB.

I will be glad to get any comments or suggestions.

[1] https://lore.kernel.org/xen-devel/AM7PR03MB65936E5D0B25567D1B2FAECA85CC9@AM7PR03MB6593.eurprd03.prod.outlook.com/

Roman Skakun (1):
  xen/arm: set iommu property for IOMMU-protected devices

 xen/arch/arm/domain_build.c | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.27.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-10  2:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04  9:54 [RFC 0/1] tag IOMMU-protected devices in Dom0 fdt Roman Skakun
2021-10-04  9:54 ` [RFC 1/1] xen/arm: set iommu property for IOMMU-protected devices Roman Skakun
2021-10-06 12:45   ` Oleksandr
2021-10-07 11:04     ` Roman Skakun
2021-11-08 18:30   ` Julien Grall
2021-11-10 21:12     ` Stefano Stabellini
2021-12-07 15:40       ` Sergiy Kibrik
2021-12-10  2:04         ` Stefano Stabellini
2021-10-04  9:54 ` [RFC PATCH] dma-mapping: don't set swiotlb-xen fops " Roman Skakun
2021-10-12 14:11 ` [RFC 0/1] tag IOMMU-protected devices in Dom0 fdt Roman Skakun
2021-10-12 14:20   ` Julien Grall
2021-10-12 14:23     ` Roman Skakun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.