From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Wed, 02 Sep 2009 06:52:46 +0000 Subject: Re: [GIT PULL] Add KVM support for Book3s_64 (PPC64) hosts v3 Message-Id: <1251874366.14675.442.camel@pasglop> List-Id: References: <1248453028-49627-1-git-send-email-agraf@suse.de> In-Reply-To: <1248453028-49627-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Wed, 2009-09-02 at 08:34 +0200, Alexander Graf wrote: > On 02.09.2009, at 08:23, Benjamin Herrenschmidt wrote: > > >> Well, we need mm_alloc to reserve a VA range. And since that happens > >> in module code, it needs to be exported. > > > > Hrm... I've missed where you call it. Can't you directly allocate > > a context ID instead of a whole mm ? > > It's in the vcpu init code: > > ./book3s.c:862: vcpu->arch.mm_guest = mm_alloc(); > > And the mm_alloc() call was the closest I could find to only allocate > a context ID. I didn't really want to change too much code in there > unless I really have to and it seems like mm_alloc doesn't have that > much overhead. > > I'm open for suggestions on how to get a context_id easily/cleanly > without exporting mm_alloc. I see ... init_new_context() and destroy_context() only operate on an mm_struct... Well, in that case, I'm open to something that would change those two to __init_new_context() and __destroy_conext() that respectively return the new ID and take an ID as an argument, which you can export, and have static inlines in mmu-context.h that implement init_new_context() and destroy_context() in terms of the above. Cheers, Ben.