On Fri, Jun 10, 2011 at 11:58 AM, Catalin Marinas <catalin.marinas@xxxxxxx> wrote: > On Fri, Jun 10, 2011 at 10:53:06AM +0100, Alexander Graf wrote: >> Am 10.06.2011 um 11:23 schrieb Catalin Marinas <catalin.marinas@xxxxxxx>: >> > 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, I will follow your suggestions for next patch series. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html