[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)
From: |
Lan Tianyu |
Subject: |
Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT) |
Date: |
Thu, 20 Apr 2017 15:10:54 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 2017年04月20日 15:04, Peter Xu wrote:
> On Thu, Apr 20, 2017 at 06:36:16AM +0000, Liu, Yi L wrote:
>
> [...]
>
>>>> In my understanding, container->space->as->root cannot work here no
>>>> matter passthru-mode is enabled or not. The code here is aiming to
>>>> check if vIOMMU exists. After the vfio series, the vtd_dev_as->root is
>>>> not initialized to be a iommu MemoryRegion. Compared with checking if
>>>> it is system_memory(), I think adding a mechanism to get the iommu
>>> MemoryRegion may be a better choice. Just like the current
>>> pci_device_iommu_address_space().
>>>
>>> Isn't pci_device_iommu_address_space() used to get that IOMMU memory region?
>
> Again I should say s/memory region/address space/...
>
>>
>> It actually returns the AddressSpace, and the AddressSpace includes a memory
>> region.
>> It is as->root. But after adding the vfio series, through the IOMMU memory
>> region
>> is got, but it has no iommu_ops. Just as the following code shows. That's
>> why I said
>> even without passthru-mode, Tianyu's that code snippet is not able to get
>> the correct
>> check.
>>
>> memory_region_init(&vtd_dev_as->root, OBJECT(s),
>> "vtd_root", UINT64_MAX);
>> address_space_init(&vtd_dev_as->as, &vtd_dev_as->root, name);
>
> The problem is, I am not sure whether there is always _only_ one IOMMU
> region behind one device. E.g., IIUC ppc can have more than one IOMMU
> memory regions, but translate for different address ranges.
>
If we really want to check this via memory region, we may check all
subregions under container's address space. Register vIOMMU related
notifiers if one of them has iommu_ops,
--
Best regards
Tianyu Lan
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), (continued)
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/18
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Liu, Yi L, 2017/04/18
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/18
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Liu, Yi L, 2017/04/18
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Lan Tianyu, 2017/04/19
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/19
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Liu, Yi L, 2017/04/20
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/20
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Liu, Yi L, 2017/04/20
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/20
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT),
Lan Tianyu <=
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Lan, Tianyu, 2017/04/20
- Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Peter Xu, 2017/04/20
Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT), Liu, Yi L, 2017/04/19
Re: [Qemu-devel] [PATCH v2 0/7] VT-d: PT (passthrough) mode support and misc fixes, Paolo Bonzini, 2017/04/18