]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Initialize system_config earlier
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 26 Jan 2016 08:26:11 +0000 (09:26 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 26 Jan 2016 09:43:39 +0000 (10:43 +0100)
On x86, we want to make the debug UART configurable via the system
config. That means we will need this pointer in arch_dbg_write_init
already.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/paging.c
hypervisor/setup.c

index d049df8b304788b215937141dbe9f631904d425e..5f127d7a4a4a33026d28cda50539c1dad86007f5 100644 (file)
@@ -468,8 +468,6 @@ int paging_init(void)
        per_cpu_pages = hypervisor_header.max_cpus *
                sizeof(struct per_cpu) / PAGE_SIZE;
 
-       system_config = (struct jailhouse_system *)
-               (__page_pool + per_cpu_pages * PAGE_SIZE);
        config_pages = PAGES(jailhouse_system_config_size(system_config));
 
        page_offset = JAILHOUSE_BASE -
index 79f5696498b262f9c5bab8e3db1e92068f82a48b..0fb9f68eea72c05b9d315cebbb7d012239245671 100644 (file)
@@ -31,11 +31,15 @@ static volatile int error;
 
 static void init_early(unsigned int cpu_id)
 {
-       unsigned long core_and_percpu_size;
+       unsigned long core_and_percpu_size = hypervisor_header.core_size +
+               sizeof(struct per_cpu) * hypervisor_header.max_cpus;
        struct jailhouse_memory hv_page;
 
        master_cpu_id = cpu_id;
 
+       system_config = (struct jailhouse_system *)
+               (JAILHOUSE_BASE + core_and_percpu_size);
+
        arch_dbg_write_init();
 
        printk("\nInitializing Jailhouse hypervisor %s on CPU %d\n",
@@ -66,7 +70,6 @@ static void init_early(unsigned int cpu_id)
        hv_page.virt_start = paging_hvirt2phys(&hypervisor_header);
        hv_page.size = PAGE_SIZE;
        hv_page.flags = JAILHOUSE_MEM_READ;
-       core_and_percpu_size = (unsigned long)system_config - JAILHOUSE_BASE;
        while (core_and_percpu_size > 0) {
                error = arch_map_memory_region(&root_cell, &hv_page);
                if (error)