Skip to content

Commit

Permalink
inmates: Clear bss during initialization
Browse files Browse the repository at this point in the history
Stop relying on the Jailhouse loader to clear call memory and perform
the required bss initialization to zero on our own.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Feb 16, 2014
1 parent bf7390e commit 74e9c53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions inmates/header.S
Expand Up @@ -62,6 +62,11 @@ start32:
start64: start64:
mov $stack_top,%rsp mov $stack_top,%rsp


xor %rax,%rax
mov $bss_start,%rdi
mov $bss_qwords,%rcx
rep stosq

mov $inmate_main,%rax mov $inmate_main,%rax
jmpq *%rax jmpq *%rax


Expand Down
9 changes: 7 additions & 2 deletions inmates/inmate.lds
Expand Up @@ -22,10 +22,15 @@ SECTIONS
. = ALIGN(16); . = ALIGN(16);
} }


/* 32-bit sections */ /* 32/64-bit sections */
. = 0xe0000; . = 0xe0000;
stack_top = .; stack_top = .;
.bss : { *(.bss) } bss_start = .;
.bss : {
*(.bss)
. = ALIGN(8);
}
bss_qwords = SIZEOF(.bss) / 8;


. = 0xf0000 + SIZEOF(.startup); . = 0xf0000 + SIZEOF(.startup);
.text : AT (ADDR(.text) & 0xffff) { .text : AT (ADDR(.text) & 0xffff) {
Expand Down

0 comments on commit 74e9c53

Please sign in to comment.