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. -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html