> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Sent: Friday, November 25, 2022 5:07 PM > > > > Current gvt internal cache is handled with .open_device() > and .close_device() pair, > > so those internal cache is now re-initialized for each device session, how is > that > > handled for iommufd? Looks that's missed in this patch.. > > you are right. I noticed below two helpers are used to destroy. However, > the code seems to be more clear the internal cache. So seems no need to > re-initialize. I'm no expert here. :) > > gvt_cache_destroy() > kvmgt_protect_table_destroy() > It's common practice to have init in the probe path and then do the housekeeping in the close path. Re-init in every open is unnecessary.