From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 02 May 2013 00:30:04 +0000 Subject: Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions Message-Id: <1367454604.29231.21@snotra> List-Id: References: <20130502001553.GA2363@amt.cnet> <1367454443.29231.20@snotra> In-Reply-To: <1367454443.29231.20@snotra> (from scottwood@freescale.com on Wed May 1 19:27:23 2013) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Scott Wood Cc: Marcelo Tosatti , Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org On 05/01/2013 07:27:23 PM, Scott Wood wrote: > On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote: >> This is not good practice (codepaths should either hold srcu or not >> hold >> it, unconditionally). > > How is it different from moving the srcu lock into individual cases > of the switch? I just did it this way to make it easier to add new > exception types if necessary (e.g. at the time I thought I'd end up > adding exceptions which lead to instruction emulation, but I ended up > acquiring the lock further down the path in that case). > >> Can you give more details of the issue? (not obvious) > > ITLB/DTLB miss call things like gfn_to_memslot() which need the lock > (but don't grab it themselves -- that seems like the real bad > practice here...). Never mind on the parenthetical -- grabbing it themselves wouldn't work because they return RCU-protected data. -Scott