From: Jan Kiszka Date: Tue, 26 Jan 2016 08:26:11 +0000 (+0100) Subject: core: Initialize system_config earlier X-Git-Url: https://rtime.felk.cvut.cz/gitweb/jailhouse.git/commitdiff_plain/4a67ce2e06bfeabd0bd7149f24b1fa5d5e44188e core: Initialize system_config earlier 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 --- diff --git a/hypervisor/paging.c b/hypervisor/paging.c index d049df8..5f127d7 100644 --- a/hypervisor/paging.c +++ b/hypervisor/paging.c @@ -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 - diff --git a/hypervisor/setup.c b/hypervisor/setup.c index 79f5696..0fb9f68 100644 --- a/hypervisor/setup.c +++ b/hypervisor/setup.c @@ -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)