From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH v17 18/23] platform/x86: Intel SGX driver Date: Mon, 17 Dec 2018 21:37:58 +0200 Message-ID: <20181217193758.GC29785@linux.intel.com> References: <20181116010412.23967-1-jarkko.sakkinen@linux.intel.com> <20181116010412.23967-19-jarkko.sakkinen@linux.intel.com> <7d5cde02-4649-546b-0f03-2d6414bb80b5@intel.com> <20181217180102.GA12560@linux.intel.com> <20181217183613.GD12491@linux.intel.com> <20181217184333.GA26920@linux.intel.com> <20181217184858.GF12491@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Dave Hansen Cc: Sean Christopherson , x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-sgx@vger.kernel.org, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@linux.intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, mark.shanahan@intel.com, luto@amacapital.net, Suresh Siddha , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Darren Hart , Andy Shevchenko , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" List-Id: platform-driver-x86.vger.kernel.org On Mon, Dec 17, 2018 at 11:09:33AM -0800, Dave Hansen wrote: > On 12/17/18 10:48 AM, Sean Christopherson wrote: > > We can't set mm to NULL as we need it to unregister the notifier, and > > I'm fairly certain attempting to unregister in the release callback > > will deadlock. > > Suggestion: > > It looks like you only expect one VMA per enclave. Things go bonkers if > this is not true. So, instead of storing encl->mm, don't. You can get > the mm from vma->vm_mm and you could just store encl->vma instead. The code actually supports having multiple VMAs per enclave. /Jarkko