xen/x86: Do not call xen_init_time_ops() until shared_info is initialized

Routines that are set by xen_init_time_ops() use shared_info's
pvclock_vcpu_time_info area. This area is not properly available until
shared_info is mapped in xen_setup_shared_info().

This became especially problematic due to commit dd759d93f4 ("x86/timers:
Add simple udelay calibration") where we end up reading tsc_to_system_mul
from xen_dummy_shared_info (i.e. getting zero value) and then trying
to divide by it in pvclock_tsc_khz().

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
此提交包含在:
Boris Ostrovsky
2017-05-03 16:20:51 -04:00
提交者 Juergen Gross
父節點 40f4ac0b51
當前提交 d162809f85
共有 2 個檔案被更改,包括 8 行新增3 行删除

查看文件

@@ -974,6 +974,13 @@ void xen_setup_shared_info(void)
#endif
xen_setup_mfn_list_list();
/*
* Now that shared info is set up we can start using routines that
* point to pvclock area.
*/
if (system_state == SYSTEM_BOOTING)
xen_init_time_ops();
}
/* This is called once we have the cpu_possible_mask */
@@ -1272,8 +1279,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
x86_init.oem.arch_setup = xen_arch_setup;
x86_init.oem.banner = xen_banner;
xen_init_time_ops();
/*
* Set up some pagetable state before starting to set any ptes.
*/