Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145479
b: refs/heads/master
c: 2cb7878
h: refs/heads/master
i:
  145477: ec1fb84
  145475: a264719
  145471: f826d57
v: v3
  • Loading branch information
Rusty Russell authored and Linus Torvalds committed Jun 4, 2009
1 parent 24cd98c commit 3be2615
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fa7eb283c5cdc2b0f4a8cfe6387ed82e5e9a3d3
refs/heads/master: 2cb7878a3a4341d1faa208de962d66f0817d3e7a
1 change: 1 addition & 0 deletions trunk/arch/x86/lguest/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
obj-y := i386_head.o boot.o
CFLAGS_boot.o := $(call cc-option, -fno-stack-protector)
17 changes: 13 additions & 4 deletions trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#include <asm/mce.h>
#include <asm/io.h>
#include <asm/i387.h>
#include <asm/stackprotector.h>
#include <asm/reboot.h> /* for struct machine_ops */

/*G:010 Welcome to the Guest!
Expand Down Expand Up @@ -1088,13 +1089,21 @@ __init void lguest_init(void)
* lguest_init() where the rest of the fairly chaotic boot setup
* occurs. */

/* The stack protector is a weird thing where gcc places a canary
* value on the stack and then checks it on return. This file is
* compiled with -fno-stack-protector it, so we got this far without
* problems. The value of the canary is kept at offset 20 from the
* %gs register, so we need to set that up before calling C functions
* in other files. */
setup_stack_canary_segment(0);
/* We could just call load_stack_canary_segment(), but we might as
* call switch_to_new_gdt() which loads the whole table and sets up
* the per-cpu segment descriptor register %fs as well. */
switch_to_new_gdt(0);

/* As described in head_32.S, we map the first 128M of memory. */
max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;

/* Load the %fs segment register (the per-cpu segment register) with
* the normal data segment to get through booting. */
asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory");

/* The Host<->Guest Switcher lives at the top of our address space, and
* the Host told us how big it is when we made LGUEST_INIT hypercall:
* it put the answer in lguest_data.reserve_mem */
Expand Down

0 comments on commit 3be2615

Please sign in to comment.