On Mon, 2012-12-10 at 06:27 +0000, maheen butt wrote:> Hi,
>
>
> In start_xen():xen/arch/x86/setup.c
> has function smp_prepare_boot_cpu() which also exist in vanilla kernel
> the kernel version is given that:
I''m not sure that you can infer that because these functions are
similarly named in Linux and Xen that they should have the same
behaviour / semantics.
> void __init native_smp_prepare_boot_cpu(void)
> {
> int me = smp_processor_id();
> switch_to_new_gdt(me);
> /* already set me in cpu_online_mask in boot_cpu_init() */
> cpumask_set_cpu(me, cpu_callout_mask);
> per_cpu(cpu_state, me) = CPU_ONLINE;
> }
>
>
> Whera in case of Xen we have:
> void __init smp_prepare_boot_cpu(void)
> {
> cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
> cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
> }
> My question is that why there is no need to change gdt pointer to
> current cpu segment as it is done in case of kernel code?
Perhaps it is done somewhere else?
IIRC the gdtr contains a virtual address and Xen uses a fixed virtual
address for the GDT with per-PCPU mappings, so perhaps loading the gdtr
here is simply not necessary.
Ian.