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

Re: [Xen-devel] Unshared IOMMU issues



Hi, Jan.

On Wed, Feb 15, 2017 at 6:22 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>> On 15.02.17 at 16:52, <olekstysh@xxxxxxxxx> wrote:
>> I think, but I am not 100% sure that we could avoid actions above if
>> we would have knowledge about device assignment for particular
>> domain before making any updates in P2M.
>
> Well, one could in theory make this work for boot time assigned
> devices, but since this won't cover runtime assigned (hotplugged)
> ones, I don't think this would gain you anything.

Indeed, I didn't take into account hotplugged devices.

>
>> Could you please suggest me a right way in resolving such problems?
>
> Well, you described what you do (with quite a bit of ARM terminology
> I don't understand), but I'm not sure you made explicit what problem(s)
> you need to solve. I'm sorry if it's just me not understanding what you
> wrote.
Ok.

Sorry, if I was unclear. Let rephrase a bit.

I described some generic problems I had faced during playing with
new IOMMU driver (that doesn't share page table with the CPU unlike
existing SMMU driver) in XEN on ARM.
I described how I had resolved it somehow, just to see it working.
Now, I want to hear community opinion about
whether these changes are correct and might be acceptable in general
or these changes should be done in other way.

1.
I need:
Allow P2M core on ARM to update IOMMU mapping from the first "p2m_set_entry".
I do:
I explicitly set need_iommu flag for *every* guest domain during
iommu_domain_init() on ARM in case if page table is not shared.
At that moment I have no knowledge about will any device be assigned
to this domain or not. I am just want to receive all mapping updates
from P2M code. The P2M will update IOMMU mapping only when need_iommu
is set and page table is not shared.
I have doubts:
Is it correct to just force need_iommu flag? Or maybe another flag
should be introduced?
Or we don't need to check for need_iommu flag before updating IOMMU
mapping in P2M code, maybe iommu_enabled would be enough?

2.
I need:
Allow IOMMU driver to be ready to handle IOMMU mapping updates from
the first "p2m_set_entry".
I do:
I always allocate IOMMU page table during iommu_domain_init() for every
domain even this domain won't have any assigned devices in future. I
don't wait for iommu_construct.
I have doubts:
Is it correct? It might be just wasting memory and CPU time if domain
doesn't have any assigned devices in future.

>
> Jan
>



-- 
Regards,

Oleksandr Tyshchenko

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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