On Wed, Jun 19, 2019 at 03:46:38PM +0300, Jarkko Sakkinen wrote: > On Mon, 2019-06-17 at 09:52 -0700, Sean Christopherson wrote: > > On Mon, Jun 17, 2019 at 07:40:25PM +0300, Jarkko Sakkinen wrote: > > > On Thu, Jun 13, 2019 at 07:30:07PM +0300, Jarkko Sakkinen wrote: > > > > Since the device file stays open up until all VMAs have been closed > > > > we do not need to increase encl->refcount for VMAs. sgx_open() will > > > > increase it once and sgx_release() will decrease at a point where > > > > the device file is not mapped. anymore. > > > > > > > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx> > > > > > > Cool if I merge this one? > > > > LGTM > > Awesome, merged. > > Sent another similar change just now for the page adder. Can you > check that so I can merge. > > I have a change in progress that will make the reclaimer also the > reaper and remove the need for the refcount altogether. Try to > get it possibly tonight out (i.e. daytime for you). I'm about to disappear on vacation for two weeks, can you post whatever you have, even if it's half baked? I have a working patch to use mmu_notifier.release() instead of per-vma refcounting, I'll post an RFC today. It'd be nice to have both approaches posted so that folks can weigh in on the options for dropping .vm_close().