mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-05 08:48:53 +00:00
x86/xen: split xen_smp_prepare_boot_cpu()
Split xen_smp_prepare_boot_cpu() into xen_pv_smp_prepare_boot_cpu() and xen_hvm_smp_prepare_boot_cpu() to support further splitting of smp.c. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
parent
04e95761fa
commit
a2d1078a35
@ -297,35 +297,46 @@ static void __init xen_filter_cpu_maps(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init xen_smp_prepare_boot_cpu(void)
|
static void __init xen_pv_smp_prepare_boot_cpu(void)
|
||||||
{
|
{
|
||||||
BUG_ON(smp_processor_id() != 0);
|
BUG_ON(smp_processor_id() != 0);
|
||||||
native_smp_prepare_boot_cpu();
|
native_smp_prepare_boot_cpu();
|
||||||
|
|
||||||
if (xen_pv_domain()) {
|
if (!xen_feature(XENFEAT_writable_page_tables))
|
||||||
if (!xen_feature(XENFEAT_writable_page_tables))
|
/* We've switched to the "real" per-cpu gdt, so make
|
||||||
/* We've switched to the "real" per-cpu gdt, so make
|
* sure the old memory can be recycled. */
|
||||||
* sure the old memory can be recycled. */
|
make_lowmem_page_readwrite(xen_initial_gdt);
|
||||||
make_lowmem_page_readwrite(xen_initial_gdt);
|
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
/*
|
/*
|
||||||
* Xen starts us with XEN_FLAT_RING1_DS, but linux code
|
* Xen starts us with XEN_FLAT_RING1_DS, but linux code
|
||||||
* expects __USER_DS
|
* expects __USER_DS
|
||||||
*/
|
*/
|
||||||
loadsegment(ds, __USER_DS);
|
loadsegment(ds, __USER_DS);
|
||||||
loadsegment(es, __USER_DS);
|
loadsegment(es, __USER_DS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xen_filter_cpu_maps();
|
xen_filter_cpu_maps();
|
||||||
xen_setup_vcpu_info_placement();
|
xen_setup_vcpu_info_placement();
|
||||||
}
|
|
||||||
|
/*
|
||||||
|
* The alternative logic (which patches the unlock/lock) runs before
|
||||||
|
* the smp bootup up code is activated. Hence we need to set this up
|
||||||
|
* the core kernel is being patched. Otherwise we will have only
|
||||||
|
* modules patched but not core code.
|
||||||
|
*/
|
||||||
|
xen_init_spinlocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __init xen_hvm_smp_prepare_boot_cpu(void)
|
||||||
|
{
|
||||||
|
BUG_ON(smp_processor_id() != 0);
|
||||||
|
native_smp_prepare_boot_cpu();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup vcpu_info for boot CPU.
|
* Setup vcpu_info for boot CPU.
|
||||||
*/
|
*/
|
||||||
if (xen_hvm_domain())
|
xen_vcpu_setup(0);
|
||||||
xen_vcpu_setup(0);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The alternative logic (which patches the unlock/lock) runs before
|
* The alternative logic (which patches the unlock/lock) runs before
|
||||||
@ -717,7 +728,7 @@ static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct smp_ops xen_smp_ops __initconst = {
|
static const struct smp_ops xen_smp_ops __initconst = {
|
||||||
.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu,
|
.smp_prepare_boot_cpu = xen_pv_smp_prepare_boot_cpu,
|
||||||
.smp_prepare_cpus = xen_smp_prepare_cpus,
|
.smp_prepare_cpus = xen_smp_prepare_cpus,
|
||||||
.smp_cpus_done = xen_smp_cpus_done,
|
.smp_cpus_done = xen_smp_cpus_done,
|
||||||
|
|
||||||
@ -754,5 +765,5 @@ void __init xen_hvm_smp_init(void)
|
|||||||
smp_ops.cpu_die = xen_cpu_die;
|
smp_ops.cpu_die = xen_cpu_die;
|
||||||
smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
|
smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
|
||||||
smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
|
smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
|
||||||
smp_ops.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu;
|
smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user