x86: reduce scope of some symbols used with reset_stack_and_jump() By making the macro properly advertise the use of the input symbol to the compiler, it is no longer necessary for them to be global if they're defined and used in just one source file. Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -74,17 +74,6 @@ static void paravirt_ctxt_switch_to(stru static void vcpu_destroy_pagetables(struct vcpu *v); -static void continue_idle_domain(struct vcpu *v) -{ - reset_stack_and_jump(idle_loop); -} - -static void continue_nonidle_domain(struct vcpu *v) -{ - check_wakeup_from_wait(); - reset_stack_and_jump(ret_from_intr); -} - static void default_idle(void) { local_irq_disable(); @@ -118,7 +107,7 @@ static void play_dead(void) (*dead_idle)(); } -void idle_loop(void) +static void idle_loop(void) { for ( ; ; ) { @@ -141,6 +130,17 @@ void startup_cpu_idle_loop(void) reset_stack_and_jump(idle_loop); } +static void continue_idle_domain(struct vcpu *v) +{ + reset_stack_and_jump(idle_loop); +} + +static void continue_nonidle_domain(struct vcpu *v) +{ + check_wakeup_from_wait(); + reset_stack_and_jump(ret_from_intr); +} + void dump_pageframe_info(struct domain *d) { struct page_info *page; --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -63,6 +63,8 @@ #include #include +void svm_asm_do_resume(void); + u32 svm_feature_flags; /* Indicates whether guests may use EFER.LMSLE. */ --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -508,7 +508,7 @@ static void __init kexec_reserve_area(st } } -void init_done(void) +static void noinline init_done(void) { /* Free (or page-protect) the init areas. */ memset(__init_begin, 0xcc, __init_end - __init_begin); /* int3 poison */ --- a/xen/include/asm-x86/asm_defns.h +++ b/xen/include/asm-x86/asm_defns.h @@ -8,6 +8,10 @@ #endif #include +#ifndef __ASSEMBLY__ +void ret_from_intr(void); +#endif + #ifdef __x86_64__ #include #else --- a/xen/include/asm-x86/current.h +++ b/xen/include/asm-x86/current.h @@ -56,8 +56,8 @@ static inline struct cpu_info *get_cpu_i #define reset_stack_and_jump(__fn) \ __asm__ __volatile__ ( \ - "mov %0,%%"__OP"sp; jmp "STR(__fn) \ - : : "r" (guest_cpu_user_regs()) : "memory" ) + "mov %0,%%"__OP"sp; jmp %c1" \ + : : "r" (guest_cpu_user_regs()), "i" (__fn) : "memory" ) #define schedule_tail(vcpu) (((vcpu)->arch.schedule_tail)(vcpu)) --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -7,8 +7,6 @@ extern bool_t early_boot; extern unsigned long xenheap_initial_phys_start; -void init_done(void); - void early_cpu_init(void); void early_time_init(void); void early_page_fault(void);