From: Rusty Russell paravirt_probe() and its infrastructure proved as popular as it was pretty. In anticipation of its imminent demise, this switches lguest to use a magic string to identify a different entry point. This is not the long-term solution: that will take a new bootloader rev and will hopefully be done in the next few months. Signed-off-by: Rusty Russell Signed-off-by: Andrew Morton --- drivers/lguest/lguest.c | 2 -- drivers/lguest/lguest_asm.S | 23 +++++++++-------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff -puN drivers/lguest/lguest.c~lguest-the-guest-code-dont-use-paravirt_probe-its-dying drivers/lguest/lguest.c --- a/drivers/lguest/lguest.c~lguest-the-guest-code-dont-use-paravirt_probe-its-dying +++ a/drivers/lguest/lguest.c @@ -43,7 +43,6 @@ extern const char lgstart_sti[], lgend_s extern const char lgstart_popf[], lgend_popf[]; extern const char lgstart_pushf[], lgend_pushf[]; extern const char lgstart_iret[], lgend_iret[]; -extern asmlinkage void lguest_maybe_init(void); extern void lguest_iret(void); struct lguest_data lguest_data = { @@ -500,4 +499,3 @@ __init void lguest_init(void) pm_power_off = lguest_power_off; start_kernel(); } -paravirt_probe(lguest_maybe_init); diff -puN drivers/lguest/lguest_asm.S~lguest-the-guest-code-dont-use-paravirt_probe-its-dying drivers/lguest/lguest_asm.S --- a/drivers/lguest/lguest_asm.S~lguest-the-guest-code-dont-use-paravirt_probe-its-dying +++ a/drivers/lguest/lguest_asm.S @@ -1,29 +1,24 @@ #include #include #include +#include /* FIXME: Once asm/processor-flags.h goes in, include that */ #define X86_EFLAGS_IF 0x00000200 /* - * This is where we begin: head.S notes that paging is already enabled (which - * doesn't happen in native boot) and calls the registered paravirt_probe - * functions one at a time. Ours is a simple assembler test for magic - * registers. If they're correct we jump to lguest_init. + * This is where we begin: we have a magic signature which the launcher looks + * for. The plan is that the Linux boot protocol will be extended with a + * "platform type" field which will guide us here from the normal entry point, + * but for the moment this suffices. * * We put it in .init.text will be discarded after boot. */ .section .init.text, "ax", @progbits -ENTRY(lguest_maybe_init) - cmpl $LGUEST_MAGIC_EBP, %ebp - jne out - cmpl $LGUEST_MAGIC_EDI, %edi - jne out - cmpl $LGUEST_MAGIC_ESI, %esi - jne out - je lguest_init -out: - ret +.ascii "GenuineLguest" + /* Set up initial stack. */ + movl $(init_thread_union+THREAD_SIZE),%esp + jmp lguest_init /* The templates for inline patching. */ #define LGUEST_PATCH(name, insns...) \ _