[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/3] introduce GFN notification for translated domains
On 07.11.2019 12:35, George Dunlap wrote: > On 11/6/19 3:19 PM, Jan Beulich wrote: >> In order for individual IOMMU drivers (and from an abstract pov also >> architectures) to be able to adjust their data structures ahead of time >> when they might cover only a sub-range of all possible GFNs, introduce >> a notification call used by various code paths potentially installing a >> fresh mapping of a never used GFN (for a particular domain). > > So trying to reverse engineer what's going on here, you mean to say > something like this: > > --- > Individual IOMMU drivers contain adjuct data structures for gfn ranges > contained in the main p2m. For efficiency, these adjuct data structures > often cover only a subset of the gfn range. Installing a fresh mapping > of a never-used gfn may require these ranges to be expanded. Doing this > when the p2m entry is first updated may be problematic because <reasons>. > > To fix this, implement notify_gfn(), to be called when Xen first becomes > aware that a potentially new gfn may be about to be used. This will > notify the IOMMU driver about the new gfn, allowing it to expand the > data structures. It may return -ERESTART (?) for long-running > operations, in which case the operation should be restarted or a > different error if the expansion of the data structure is not possible. > In the latter case, the entire operation should fail. > --- > > Is that about right? With the exception of the -ERESTART / long running operations aspect, yes. Plus assuming you mean "adjunct" (not "adjuct", which my dictionary doesn't know about). > Note I've had to make a lot of guesses here about > the functionality and intent. Well, even after seeing your longer description, I don't see what mine doesn't say. >> Note that in gnttab_transfer() the notification and lock re-acquire >> handling is best effort only (the guest may not be able to make use of >> the new page in case of failure, but that's in line with the lack of a >> return value check of guest_physmap_add_page() itself). > > Is there a reason we can't just return an error to the caller? Rolling back what has been done by that point would seem rather difficult, which I guess is the reason why the code was written the way it is (prior to my change). Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |