[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [MINI-OS PATCH 2/6] setup: drop parameter from map_shared_info()
The parameter of map_shared_info() is evaluated in PV mode only, and it is always the pointer to the initial struct start_info from boot time. By setting start_info_ptr a little bit earlier the PV variant of map_shared_info() can just use start_info_ptr instead of a parameter. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- arch/arm/setup.c | 2 +- arch/x86/setup.c | 12 ++++++------ hypervisor.c | 2 +- include/hypervisor.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/setup.c b/arch/arm/setup.c index 3d112fae..1bcfa689 100644 --- a/arch/arm/setup.c +++ b/arch/arm/setup.c @@ -38,7 +38,7 @@ void arch_init(void *dtb_pointer, uint32_t physical_offset) device_tree = dtb_pointer; /* Map shared_info page */ - HYPERVISOR_shared_info = map_shared_info(NULL); + HYPERVISOR_shared_info = map_shared_info(); get_console(NULL); get_xenbus(NULL); diff --git a/arch/x86/setup.c b/arch/x86/setup.c index e30eb065..1bdf9509 100644 --- a/arch/x86/setup.c +++ b/arch/x86/setup.c @@ -79,11 +79,10 @@ static inline void sse_init(void) { #ifdef CONFIG_PARAVIRT #define hpc_init() -shared_info_t *map_shared_info(void *p) +shared_info_t *map_shared_info(void) { int rc; - start_info_t *si = p; - unsigned long pa = si->shared_info; + unsigned long pa = start_info_ptr->shared_info; if ( (rc = HYPERVISOR_update_va_mapping((unsigned long)shared_info, __pte(pa | 7), UVMF_INVLPG)) ) @@ -185,6 +184,8 @@ arch_init(void *par) { static char hello[] = "Bootstrapping...\n"; + start_info_ptr = par; + hpc_init(); (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(hello), hello); @@ -206,7 +207,7 @@ arch_init(void *par) get_cmdline(par); /* Grab the shared_info pointer and put it in a safe place. */ - HYPERVISOR_shared_info = map_shared_info(par); + HYPERVISOR_shared_info = map_shared_info(); /* print out some useful information */ print_start_of_day(par); @@ -214,7 +215,6 @@ arch_init(void *par) #ifdef CONFIG_PARAVIRT memcpy(&start_info, par, sizeof(start_info)); #endif - start_info_ptr = (start_info_t *)par; start_kernel(); } @@ -253,7 +253,7 @@ void arch_post_suspend(int canceled) } #endif - HYPERVISOR_shared_info = map_shared_info((void*) start_info_ptr); + HYPERVISOR_shared_info = map_shared_info(); #ifndef CONFIG_PARAVIRT xen_callback_vector(); #endif diff --git a/hypervisor.c b/hypervisor.c index ba535556..6476d658 100644 --- a/hypervisor.c +++ b/hypervisor.c @@ -65,7 +65,7 @@ int hvm_set_parameter(int idx, uint64_t value) return HYPERVISOR_hvm_op(HVMOP_set_param, &xhv); } -shared_info_t *map_shared_info(void *p) +shared_info_t *map_shared_info(void) { struct xen_add_to_physmap xatp; diff --git a/include/hypervisor.h b/include/hypervisor.h index b852a42a..aef142d1 100644 --- a/include/hypervisor.h +++ b/include/hypervisor.h @@ -42,7 +42,7 @@ extern union start_info_union start_info_union; int hvm_get_parameter(int idx, uint64_t *value); int hvm_set_parameter(int idx, uint64_t value); #endif -shared_info_t *map_shared_info(void *p); +shared_info_t *map_shared_info(void); void unmap_shared_info(void); void force_evtchn_callback(void); void do_hypervisor_callback(struct pt_regs *regs); -- 2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |