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

Re: [Xen-devel] [PATCH v7 5/7] iommu / vtd: introduce a new 'refcount' flag...

>>> On 15.10.18 at 12:35, <paul.durrant@xxxxxxxxxx> wrote:
> ...to mean 'the page (being) mapped is reference counted'.
> An important pre-requisite for PV-IOMMU mapping is being able to tell the
> difference between IOMMU entries added at start-of-day by Xen and those
> that have been added by a PV-IOMMU map operation. The reason for this is
> that the pages for the former do not have an extra reference taken prior to
> mapping but the latter will (for safety/security reasons).

Makes me wonder whether proper ref-counting, at least in the
non-shared-page-tables case, shouldn't be a prereq to PV IOMMU.
Otherwise this introduces clumsiness just to work around other

> This patch therefore introduces a new IOMMF_refcount flag that the
> subsequent patch adding the PV-IOMMU map operation will use to mark
> entries that it adds. When the VT-d mapping code encounters this flag
> it will set a bit in the IOMMU PTE that is ignored by the IOMMU itself,
> such that a subsquent lookup operation can determine whether the mapped
> page was reference counted or not (and hence forbid a PV-IOMMU unmap
> operation in the latter case).

I don't understand this: If you can't unmap start-of-day mappings,
then how can you ever establish your own mappings using the new

Furthermore, looking at the patch, you don't appear to ref-count
anything. You really only set a PTE bit. IOMMU_refcount looks like
a misnomer then. IOMMU_map_dyn perhaps? (In this case my
remark further up regarding ref-counting as a prereq of course is
irrelevant, but I've left it there just to also document the
confusion arising from the naming. Then again I have yet to see
what the next patch does.)


Xen-devel mailing list



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