From: Catalin Marinas Subject: Re: [Android-virt] [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support Date: Fri, 10 Jun 2011 10:58:03 +0100 Message-ID: <20110610095803.GA18133@e102109-lin.cambridge.arm.com> References: <20110603150318.17011.82777.stgit@ubuntu> <4DEB785C.5060906@redhat.com> <211B3F42-9B68-41BB-B1FA-348B5500C60A@suse.de> <20110610092323.GA16047@e102109-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Cc: Christoffer Dall , Robin Randhawa , Avi Kivity , "kvm@vger.kernel.org" , "a.costa@virtualopensystems.com" , "android-virt@lists.cs.columbia.edu" , "s.raho@virtualopensystems.com" To: Alexander Graf Return-path: Received: from service87.mimecast.com ([94.185.240.25]:60487 "HELO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750769Ab1FJKEV convert rfc822-to-8bit (ORCPT ); Fri, 10 Jun 2011 06:04:21 -0400 In-Reply-To: Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jun 10, 2011 at 10:53:06AM +0100, Alexander Graf wrote: > Am 10.06.2011 um 11:23 schrieb Catalin Marinas : > > On Fri, Jun 10, 2011 at 09:40:34AM +0100, Christoffer Dall wrote: > >> OK, so I looked into compiling KVM/ARM as a module and there are a few > >> obstacles: > >> > >> I need to export several symbols (identitiy_mapping_add, > >> pgd_clear_bad, __irq_svc). __irq_svc is tricky because it's in the > >> entry-armv.S assembly file, so it's not obvious where to export it > >> from. Recommendations? (dedicated KVM export file as in PPC or simply > >> adding EXPORT_SYMBOL_GPL(...) or alternative? > > > > There is arch/arm/kernel/armksyms.c where we export extra symbols coming > > from .S files. I haven't looked at the code yet, maybe some of the > > symbols could be avoided. > > > >> Also, iirc, modules are loaded using vmalloc, wouldn't that make it > >> impossible for me to use virt_to_phys, which I need to do on some of > >> the code pages for Hypervisor initialization? If any of the ARM people > >> could give an advise here, it would be much appreciated - of course I > >> can kmalloc a page and relocate the init code, but I really would like > >> to avoid this. > > > > You could alloc a page (or a few) an copy the hypervisor code in there. > > Just make sure that it is position independent (which is not difficult > > with hand-written assembly). > > What we do on ppc is to select another kernel option =Y when we set > kvm=M. Based on that other option, we then add the code that need to > run in real mode (linear map) to the main kernel binary. > > That way, the guest entry/exit code for example is always in the > kernel, while the logic that dispatches what to do on a specific guest > exit can stay as module, making development a lot easier. Good point. We could do the same on ARM. Thanks. -- Catalin