]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core/driver: Consolidate bss_start/end header fields to core_size
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 28 Jan 2014 16:41:41 +0000 (17:41 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 28 Jan 2014 16:45:42 +0000 (17:45 +0100)
We only need to know how large the hypervisor core is, i.e. the part
that is loaded into RAM during initialization. That this size is derived
from the end of the bss section can be seen in our linker script.
bss_start was completely unused so far.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/hypervisor.lds.S
hypervisor/include/jailhouse/header.h
hypervisor/setup.c
main.c

index ce30f2c30e0c12025c4d12e3ed29efbca02a4148..51a0cd41c95b111525d9779c9b5b11ecb432a92b 100644 (file)
@@ -33,11 +33,8 @@ SECTIONS
        }
 
        . = ALIGN(16);
-       .bss            : {
-               __bss_start = .;
-               *(.bss)
-               __bss_end = .;
-       }
+       .bss            : { *(.bss) }
+       __hv_core_end = .;
 
        . = ALIGN(PAGE_SIZE);
        __page_pool = .;
index 05599be7dc41bfb3dfb3389bac9643d35aa0d48f..debc6539a15a4b4959e08c6036790c9d58360821 100644 (file)
@@ -15,8 +15,7 @@
 struct jailhouse_header {
        /* filled at build time */
        char signature[8];
-       unsigned long bss_start;
-       unsigned long bss_end;
+       unsigned long core_size;
        unsigned long percpu_size;
        unsigned long entry;
 
index 696d1f98b403583374972f9318ccbb349de22849..2178e82319a60ed56a851060ffca38e2a0b2342e 100644 (file)
@@ -18,7 +18,7 @@
 #include <jailhouse/string.h>
 #include <asm/spinlock.h>
 
-extern u8 __bss_start[], __bss_end[];
+extern u8 __hv_core_end[];
 
 void *config_memory;
 
@@ -175,8 +175,7 @@ int entry(struct per_cpu *cpu_data)
 struct jailhouse_header __attribute__((section(".header")))
 hypervisor_header = {
        .signature = JAILHOUSE_SIGNATURE,
-       .bss_start = (unsigned long)__bss_start,
-       .bss_end = (unsigned long)__bss_end,
+       .core_size = (unsigned long)__hv_core_end,
        .percpu_size = sizeof(struct per_cpu),
        .entry = (unsigned long)arch_entry,
 };
diff --git a/main.c b/main.c
index 24bebe04d779f245bc4d25bb3b618d318ab48252..1aea1beadc36060cf23981975fb6bd0f9feb6c09 100644 (file)
--- a/main.c
+++ b/main.c
@@ -130,7 +130,7 @@ static int jailhouse_enable(struct jailhouse_system __user *arg)
                   sizeof(header->signature)) != 0)
                goto error_release_fw;
 
-       hv_core_size = PAGE_ALIGN(header->bss_end);
+       hv_core_size = PAGE_ALIGN(header->core_size);
        percpu_size = num_possible_cpus() * header->percpu_size;
        config_size = jailhouse_system_config_size(&config_header);
        if (hv_mem->size <= hv_core_size + percpu_size + config_size)