[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disable swiotlb for Dom0


  • To: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Roman Skakun <Roman_Skakun@xxxxxxxx>
  • Date: Tue, 10 Aug 2021 15:38:42 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-SenderADCheck; bh=X8yHShqa4/XyGig7OsoZWyemFpNUfJEEIWDrQk+XoH4=; b=UpGG4+/t8bPEijG2HsLGKjfqXZxbozwYebJeNeVmPW3q5J9kHYBrPNdtcHjKRG6p35uEJZbPYexC8Rcz/pCKGV5s0Ov0uFeiPbRIQrVbP+r4mo+2a0sxW+Y9iTRySSPRUyu4d5/7f2N7W3UdaLsEdEh+VatLrkM5qL/8GJzJ5GaNrBXS60QC7ZmeEh98QdWqOmz91neG7QtTbKWWhHbb3iXet49syyqf9QXBDAzPcmYNpJLREDGZBUnbpTcSg/KYjK+zxi77y4ku0UylreDADWc0fgp+ADEpoPp4XzVMCatXb4aKWSQR2yzd35SlDZy3poPVflUTzS2dJyJggHqJbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aQLXdBn3ydZTc/rao22RbHqPolJQoSyAJJ4IwG7bb+MU+6jNpPBgfD014GcrBgYk0aCiIdun/rav4yIHBKaZYqTtjSnWiXhzvERN3i62PmM9B63bwA4hI89b+m+WobKd/MXQZ06gsRjsCzFNmCrcjWcOYaXM/lgtZ95GvsFIHsYFc1ro+qFG7r2bpYG9gnxZBsrMUGXhCeBkotL4wCC1g7UNTifPNCz4E9yANkcjrtUSNY03WbKmelnyzNaVojZfAlhdlWwLuwOObDg6Ew4eYPuasn3mJe7TnXdWhV4Gtczcs6hyTRXc7vclXvEbSgRJJgjHCM8tKHX4UiOzhdyhZg==
  • Authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=epam.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrii Anisov <Andrii_Anisov@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roman Skakun <Roman_Skakun@xxxxxxxx>, Roman Skakun <rm.skakun@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Tue, 10 Aug 2021 15:39:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXjfwJK3kYIT7XAUWdmOu1AWm+tA==
  • Thread-topic: Disable swiotlb for Dom0

Hi, Stefano!

I have observed your patch here:
https://patchwork.kernel.org/project/xen-devel/patch/alpine.DEB.2.21.2102161333090.3234@sstabellini-ThinkPad-T480s/

And I collided with the same issue, when Dom0 device trying to use
swiotlb fops for devices which are controlled by IOMMU.

Prerequisites:
https://github.com/xen-project/xen/tree/stable-4.15
https://github.com/torvalds/linux/tree/v5.10

Issue caused in xen_swiotlb_map_page():
```
 dev: rcar-fcp, cap: 0, dma_mask: ffffffff, page: fffffe00180c7400, 
page_to_phys: 64b1d0000, 
xen_phys_to_dma(phys): 64b1d0000
```

There is retrieved MFN(0x64b1d0000), which belongs to DomU. Dom0
swiotlb couldn't proceed to this address and throws the log:

```
[   99.504990] rcar-fcp fea2f000.fcp: swiotlb buffer is full (sz: 3686400 
bytes), total 32768 (slots), used 64 (slots)
```

Temporary, I resolved this issue by disabling swiotlb for dom0 at all
because sure that all devices goes through IOMMU, but this mention can
be true only for me.

But, I think of a more reliable way is to declare a special IOMMU
property in xen dts for each device. If the device controlled by IOMMU
not need to set swiotlb fops in arch_setup_dma_ops.
What do you think about it?


 


Rackspace

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