From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Move gfn_to_memslot() to kvm_host.h Date: Mon, 26 Dec 2011 15:22:48 +0200 Message-ID: <4EF87528.8000305@redhat.com> References: <20111220092102.GA5626@bloggs.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Graf , linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras Return-path: In-Reply-To: <20111220092102.GA5626@bloggs.ozlabs.ibm.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 12/20/2011 11:21 AM, Paul Mackerras wrote: > This moves gfn_to_memslot(), and the functions it calls, that is, > search_memslots() and __gfn_to_memslot(), from kvm_main.c to kvm_host.h > so that gfn_to_memslot() can be called from non-modular code even > when KVM is a module. On powerpc, the Book3S HV style of KVM has > code that is called from real mode which needs to call gfn_to_memslot() > and thus needs this. (Module code is allocated in the vmalloc region, > which can't be accessed in real mode.) > > With this, we can remove builtin_gfn_to_memslot() from book3s_hv_rm_mmu.c > and thus eliminate a little bit of duplication. Those functions are too big to be inlined IMO. How about moving them to another C file, and making it builtin for ppc? The only issue is what to call it. virt/kvm/builtin-for-ppc seems silly. Or we could move the implementation into a header file, with an extra __ prefix, and have the C stubs call those inlines, so we have exactly on instantiation. Your real mode code can then call the inlines. -- error compiling committee.c: too many arguments to function