lkml.org 
[lkml]   [2007]   [Feb]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 1/10] lguest: Don't rely on last-linked fallthru when no paravirt handler
    FromRusty Russell <>
    DateFri, 09 Feb 2007 20:14:18 +1100
    The current code simply calls "start_kernel" directly if we're under a
    hypervisor and no paravirt_ops backend wants us, because paravirt.c
    registers that as a backend and it's linked last.
    
    This was always a vain hope; start_kernel won't get far without setup.
    It's also impossible for paravirt_ops backends which don't sit in the
    arch/i386/kernel directory: they can't link before paravirt.o anyway.
    
    This implements a real fallthrough if we pass all the registered
    paravirt probes.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    
    ===================================================================
    --- a/arch/i386/kernel/Makefile
    +++ b/arch/i386/kernel/Makefile
    @@ -39,8 +39,6 @@ obj-$(CONFIG_EARLY_PRINTK)	+= early_prin
     obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
     obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
     obj-$(CONFIG_K8_NB)		+= k8.o
    -
    -# Make sure this is linked after any other paravirt_ops structs: see head.S
     obj-$(CONFIG_PARAVIRT)		+= paravirt.o
     
     EXTRA_AFLAGS   := -traditional
    ===================================================================
    --- a/arch/i386/kernel/head.S
    +++ b/arch/i386/kernel/head.S
    @@ -502,10 +502,11 @@ startup_paravirt:
     	pushl	%ecx
     	pushl	%eax
     
    -	/* paravirt.o is last in link, and that probe fn never returns */
     	pushl	$__start_paravirtprobe
     1:
     	movl	0(%esp), %eax
    +	cmpl	$__stop_paravirtprobe, %eax
    +	je	unhandled_paravirt
     	pushl	(%eax)
     	movl	8(%esp), %eax
     	call	*(%esp)
    @@ -517,6 +518,12 @@ 1:
     
     	addl	$4, (%esp)
     	jmp	1b
    +
    +unhandled_paravirt:
    +	/* Nothing wanted us: try to die with dignity (impossible trap). */ 
    +	movl	$0x1F, %edx
    +	pushl	$0
    +	jmp	early_fault
     #endif
     
     /*
    ===================================================================
    --- a/arch/i386/kernel/paravirt.c
    +++ b/arch/i386/kernel/paravirt.c
    @@ -481,9 +481,6 @@ static int __init print_banner(void)
     	return 0;
     }
     core_initcall(print_banner);
    -
    -/* We simply declare start_kernel to be the paravirt probe of last resort. */
    -paravirt_probe(start_kernel);
     
     struct paravirt_ops paravirt_ops = {
     	.name = "bare hardware",
    
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    
    
    \
     
     \ /
      Last update: 2007-02-09 10:17    [from the cache]
    ©2003-2008