diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-02-13 07:26:26 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:26 -0500 |
commit | 992af68147299bb635be97f789e4f66ba7add477 (patch) | |
tree | 55c647547b5f5642e78497c2a930d95ee7cf658c /arch/i386 | |
parent | 9af3cf054615862c86efcf55a37bb40f0d96e406 (diff) |
[PATCH] i386: paravirt unhandled fallthrough
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.
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.
Keep it simple: if we pass all the registered paravirt probes, BUG().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/i386/kernel/head.S | 7 | ||||
-rw-r--r-- | arch/i386/kernel/paravirt.c | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 97f1e961d684..223969377de4 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile | |||
@@ -41,8 +41,6 @@ obj-$(CONFIG_HPET_TIMER) += hpet.o | |||
41 | obj-$(CONFIG_K8_NB) += k8.o | 41 | obj-$(CONFIG_K8_NB) += k8.o |
42 | 42 | ||
43 | obj-$(CONFIG_VMI) += vmi.o vmitime.o | 43 | obj-$(CONFIG_VMI) += vmi.o vmitime.o |
44 | |||
45 | # Make sure this is linked after any other paravirt_ops structs: see head.S | ||
46 | obj-$(CONFIG_PARAVIRT) += paravirt.o | 44 | obj-$(CONFIG_PARAVIRT) += paravirt.o |
47 | 45 | ||
48 | EXTRA_AFLAGS := -traditional | 46 | EXTRA_AFLAGS := -traditional |
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 734be5572eb9..b322f72ffaad 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S | |||
@@ -513,10 +513,11 @@ startup_paravirt: | |||
513 | pushl %ecx | 513 | pushl %ecx |
514 | pushl %eax | 514 | pushl %eax |
515 | 515 | ||
516 | /* paravirt.o is last in link, and that probe fn never returns */ | ||
517 | pushl $__start_paravirtprobe | 516 | pushl $__start_paravirtprobe |
518 | 1: | 517 | 1: |
519 | movl 0(%esp), %eax | 518 | movl 0(%esp), %eax |
519 | cmpl $__stop_paravirtprobe, %eax | ||
520 | je unhandled_paravirt | ||
520 | pushl (%eax) | 521 | pushl (%eax) |
521 | movl 8(%esp), %eax | 522 | movl 8(%esp), %eax |
522 | call *(%esp) | 523 | call *(%esp) |
@@ -528,6 +529,10 @@ startup_paravirt: | |||
528 | 529 | ||
529 | addl $4, (%esp) | 530 | addl $4, (%esp) |
530 | jmp 1b | 531 | jmp 1b |
532 | |||
533 | unhandled_paravirt: | ||
534 | /* Nothing wanted us: we're screwed. */ | ||
535 | ud2 | ||
531 | #endif | 536 | #endif |
532 | 537 | ||
533 | /* | 538 | /* |
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c index ebe82552ad30..c156ecfa3872 100644 --- a/arch/i386/kernel/paravirt.c +++ b/arch/i386/kernel/paravirt.c | |||
@@ -482,9 +482,6 @@ static int __init print_banner(void) | |||
482 | } | 482 | } |
483 | core_initcall(print_banner); | 483 | core_initcall(print_banner); |
484 | 484 | ||
485 | /* We simply declare start_kernel to be the paravirt probe of last resort. */ | ||
486 | paravirt_probe(start_kernel); | ||
487 | |||
488 | struct paravirt_ops paravirt_ops = { | 485 | struct paravirt_ops paravirt_ops = { |
489 | .name = "bare hardware", | 486 | .name = "bare hardware", |
490 | .paravirt_enabled = 0, | 487 | .paravirt_enabled = 0, |