[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 1/5] x86/xen: disable swiotlb for xen pvh
- To: Huang Rui <ray.huang@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 15 Mar 2023 07:52:21 +0100
- 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=CgJ/4y+3OdzOCLSAi9fZwcyeMn10s23vUP6pYpL7MAc=; b=ImUVv61nHY2pHMVtIhadU9+xT9XJCzt6HkHkDm9VQfslw/squVeUgfG1KePdO8LU+7w8DYhB+VMPjjXyy1zROv1bvf3iwK8iBmn+nn63DnckOnU0Qq+qGLRjP0KQDUleGpHPsWSNIWLBrHCPwN7i7BTrvYCY1tcv83W71Fs+K+x5bZ2vwOIKFPzUDGj49C6iZtcJtjSo5KJUVPu9fNvhm9atvQrNRve+QE+Da/YUdQPd4BQvJ4CuU8XUFPb8SjQcKrjyYDA4fxfkpy3bMRJpnrucbwiwnfzX4omUmDMj1rtPlku8Fyj47BLTHYvZU72Ch2t4RsaKfZkE5b4UWp5bPQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnIGa4bkFquuXCrxE9+j1anhsQC1T3IhzNm12CL1d/B/jHPSDI+WPapCM8BoUt6XoGKCKvzzfevryT28+RInI3rU5kF2qo04iCaoi+Hpvu8ulWCeTVts/wNRdCzQBLCMe54efLTI63QgMJQkD+qOWXQUg831yqxGZAAuARIsCmVfnpKSGt3WKzaZnwtlWp8qbF2rHWj4YCBmB20t4czlVX5XCLGB3H1C31U5kHn6iy3PgyV73gzurpqsQDnmlf00oDabSSoii3zIf3RKnf4Hk31N7BsMGVBU3QZZWPKOZKmqlpD5FrUq7u9xRV9TdLTPc9zNHLGtRhXAXf7Hw+6qmg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Juergen Gross <jgross@xxxxxxxx>, "Huang, Honglei1" <Honglei1.Huang@xxxxxxx>, "amd-gfx@xxxxxxxxxxxxxxxxxxxxx" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, "dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, "Deucher, Alexander" <Alexander.Deucher@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, "Zhang, Julia" <Julia.Zhang@xxxxxxx>, Roger Pau Monn� <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Koenig, Christian" <Christian.Koenig@xxxxxxx>
- Delivery-date: Wed, 15 Mar 2023 06:52:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.03.2023 05:14, Huang Rui wrote:
> On Wed, Mar 15, 2023 at 08:52:30AM +0800, Stefano Stabellini wrote:
>> On Mon, 13 Mar 2023, Jan Beulich wrote:
>>> On 12.03.2023 13:01, Huang Rui wrote:
>>>> Xen PVH is the paravirtualized mode and takes advantage of hardware
>>>> virtualization support when possible. It will using the hardware IOMMU
>>>> support instead of xen-swiotlb, so disable swiotlb if current domain is
>>>> Xen PVH.
>>>
>>> But the kernel has no way (yet) to drive the IOMMU, so how can it get
>>> away without resorting to swiotlb in certain cases (like I/O to an
>>> address-restricted device)?
>>
>> I think Ray meant that, thanks to the IOMMU setup by Xen, there is no
>> need for swiotlb-xen in Dom0. Address translations are done by the IOMMU
>> so we can use guest physical addresses instead of machine addresses for
>> DMA. This is a similar case to Dom0 on ARM when the IOMMU is available
>> (see include/xen/arm/swiotlb-xen.h:xen_swiotlb_detect, the corresponding
>> case is XENFEAT_not_direct_mapped).
>
> Hi Jan, sorry to late reply. We are using the native kernel amdgpu and ttm
> driver on Dom0, amdgpu/ttm would like to use IOMMU to allocate coherent
> buffers for userptr that map the user space memory to gpu access, however,
> swiotlb doesn't support this. In other words, with swiotlb, we only can
> handle the buffer page by page.
But how does outright disabling swiotlb help with this? There still wouldn't
be an IOMMU that your kernel has control over. Looks like you want something
like pvIOMMU, but that work was never completed. And even then the swiotlb
may continue to be needed for other purposes.
Jan
|