aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lguest
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/lguest')
-rw-r--r--arch/x86/lguest/Makefile1
-rw-r--r--arch/x86/lguest/boot.c19
2 files changed, 15 insertions, 5 deletions
diff --git a/arch/x86/lguest/Makefile b/arch/x86/lguest/Makefile
index 27f0c9ed7f60..94e0e54056a9 100644
--- a/arch/x86/lguest/Makefile
+++ b/arch/x86/lguest/Makefile
@@ -1 +1,2 @@
1obj-y := i386_head.o boot.o 1obj-y := i386_head.o boot.o
2CFLAGS_boot.o := $(call cc-option, -fno-stack-protector)
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 8f935c6d5512..4e0c26559395 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -67,6 +67,7 @@
67#include <asm/mce.h> 67#include <asm/mce.h>
68#include <asm/io.h> 68#include <asm/io.h>
69#include <asm/i387.h> 69#include <asm/i387.h>
70#include <asm/stackprotector.h>
70#include <asm/reboot.h> /* for struct machine_ops */ 71#include <asm/reboot.h> /* for struct machine_ops */
71 72
72/*G:010 Welcome to the Guest! 73/*G:010 Welcome to the Guest!
@@ -642,7 +643,7 @@ static void __init lguest_init_IRQ(void)
642 643
643void lguest_setup_irq(unsigned int irq) 644void lguest_setup_irq(unsigned int irq)
644{ 645{
645 irq_to_desc_alloc_cpu(irq, 0); 646 irq_to_desc_alloc_node(irq, 0);
646 set_irq_chip_and_handler_name(irq, &lguest_irq_controller, 647 set_irq_chip_and_handler_name(irq, &lguest_irq_controller,
647 handle_level_irq, "level"); 648 handle_level_irq, "level");
648} 649}
@@ -1094,13 +1095,21 @@ __init void lguest_init(void)
1094 * lguest_init() where the rest of the fairly chaotic boot setup 1095 * lguest_init() where the rest of the fairly chaotic boot setup
1095 * occurs. */ 1096 * occurs. */
1096 1097
1098 /* The stack protector is a weird thing where gcc places a canary
1099 * value on the stack and then checks it on return. This file is
1100 * compiled with -fno-stack-protector it, so we got this far without
1101 * problems. The value of the canary is kept at offset 20 from the
1102 * %gs register, so we need to set that up before calling C functions
1103 * in other files. */
1104 setup_stack_canary_segment(0);
1105 /* We could just call load_stack_canary_segment(), but we might as
1106 * call switch_to_new_gdt() which loads the whole table and sets up
1107 * the per-cpu segment descriptor register %fs as well. */
1108 switch_to_new_gdt(0);
1109
1097 /* As described in head_32.S, we map the first 128M of memory. */ 1110 /* As described in head_32.S, we map the first 128M of memory. */
1098 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT; 1111 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;
1099 1112
1100 /* Load the %fs segment register (the per-cpu segment register) with
1101 * the normal data segment to get through booting. */
1102 asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory");
1103
1104 /* The Host<->Guest Switcher lives at the top of our address space, and 1113 /* The Host<->Guest Switcher lives at the top of our address space, and
1105 * the Host told us how big it is when we made LGUEST_INIT hypercall: 1114 * the Host told us how big it is when we made LGUEST_INIT hypercall:
1106 * it put the answer in lguest_data.reserve_mem */ 1115 * it put the answer in lguest_data.reserve_mem */