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

Re: [Xen-devel] [PATCH v5 11/15] mm / iommu: split need_iommu() into has_iommu_pt() and sync_iommu_pt()



> -----Original Message-----
> From: Tian, Kevin [mailto:kevin.tian@xxxxxxxxx]
> Sent: 07 August 2018 04:41
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Julien Grall
> <julien.grall@xxxxxxx>; Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>;
> George Dunlap <George.Dunlap@xxxxxxxxxx>; Ian Jackson
> <Ian.Jackson@xxxxxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>; Konrad
> Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>; Tim (Xen.org) <tim@xxxxxxx>;
> Wei Liu <wei.liu2@xxxxxxxxxx>; Tamas K Lengyel <tamas@xxxxxxxxxxxxx>;
> George Dunlap <George.Dunlap@xxxxxxxxxx>; Nakajima, Jun
> <jun.nakajima@xxxxxxxxx>; Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>;
> Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>; Brian Woods
> <brian.woods@xxxxxxx>
> Subject: RE: [PATCH v5 11/15] mm / iommu: split need_iommu() into
> has_iommu_pt() and sync_iommu_pt()
> 
> > From: Paul Durrant [mailto:paul.durrant@xxxxxxxxxx]
> > Sent: Saturday, August 4, 2018 1:22 AM
> >
> > The name 'need_iommu' is a little confusing as it suggests a domain needs
> > to use the IOMMU but something might not be set up yet, when in fact it
> > doesn't become true until IOMMU mappings for the domain have been
> > created.
> >
> > Two different meanings are also inferred from it in various places in the
> > code:
> >
> > - Some callers want to test whether a domain has IOMMU mappings
> > - Some callers want to test whether they need to synchronize the domain's
> >   P2M and IOMMU mappings
> >
> > This patch therefore creates two new boolean flags, 'has_iommu_pt' and
> > 'sync_iommu_pt' to convey those meanings separately and creates the
> > corresponding macros. All callers of need_iommu() are then modified to
> > use the macro appropriate to what they are trying to test.
> 
> sync_iommu_pt sounds like an operation. what about need_sync_iommu?
> 
> and for has_iommu_pt, what about iommu_enabled where 'enabled'
> implies page table created?

I could do 'need_iommu_pt_sync', perhaps, but 'iommu_enabled' will clash with 
the global host flag which is why I went with 'has_iommu_pt'.

  Paul

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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