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:23:23 +0100 Message-ID: <20110610092323.GA16047@e102109-lin.cambridge.arm.com> References: <20110603150318.17011.82777.stgit@ubuntu> <4DEB785C.5060906@redhat.com> <211B3F42-9B68-41BB-B1FA-348B5500C60A@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Cc: Alexander Graf , Robin Randhawa , Avi Kivity , "kvm@vger.kernel.org" , "a.costa@virtualopensystems.com" , "android-virt@lists.cs.columbia.edu" , "s.raho@virtualopensystems.com" To: Christoffer Dall Return-path: Received: from service87.mimecast.com ([94.185.240.25]:41287 "HELO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750774Ab1FJJXg convert rfc822-to-8bit (ORCPT ); Fri, 10 Jun 2011 05:23:36 -0400 In-Reply-To: Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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). Alternatively, you could set up the Hyp translation tables to also include the modules area (pretty much duplicating the corresponding swapper_pg_dir entries, with some attributes changed). But for now you can probably ignore this issue and get back to it once everything else is working. -- Catalin