Jeremy Fitzhardinge wrote: > Zachary Amsden wrote: >> Doesn't this work and give a common entry point with the regular >> kernel, eliminating all the need for string processing? > > Which string processing? > > J > The crazy string extraction Xen has to do to figure out hypervisor features from the xen_guest section - which is a really bad idea. Putting this in the kernel is unnecessary if you have a paravirt_ops initialization function which can negotiate this information to the hypervisor. Putting this code into Linux sets an extremely bad precedent by encouraging ad-hoc, hypervisor specific sections to be put in the kernel. It is ugly, gratuitous, and unnecessary change to Linux, Please fix your loader so this doesn't need to be part of the maintained Linux code: /* * __xen_guest information */ .macro utoa value .if (\value) < 0 || (\value) >= 0x10 utoa (((\value)>>4)&0x0fffffff) .endif .if ((\value) & 0xf) < 10 .byte '0' + ((\value) & 0xf) .else .byte 'A' + ((\value) & 0xf) - 10 .endif .endm .section __xen_guest .ascii "GUEST_OS=linux,GUEST_VER=2.6" .ascii ",XEN_VER=xen-3.0" .ascii ",VIRT_BASE=0x" utoa __PAGE_OFFSET .ascii ",HYPERCALL_PAGE=0x" utoa ((__PHYSICAL_START+HYPERCALL_PAGE_OFFSET)>>PAGE_SHIFT) .ascii ",FEATURES=writable_page_tables" .ascii "|writable_descriptor_tables" .ascii "|auto_translated_physmap" .ascii "|pae_pgdir_above_4gb" .ascii "|supervisor_mode_kernel" #ifdef CONFIG_X86_PAE .ascii ",PAE=yes" #else .ascii ",PAE=no" #endif .ascii ",LOADER=generic" .byte 0