From: maheen butt Subject: smp_prepare_boot_cpu Date: Sun, 9 Dec 2012 22:27:39 -0800 (PST) Message-ID: <1355120859.46777.YahooMailNeo@web120003.mail.ne1.yahoo.com> Reply-To: maheen butt Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8191420588852697460==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============8191420588852697460== Content-Type: multipart/alternative; boundary="-1007318780-1574078396-1355120859=:46777" ---1007318780-1574078396-1355120859=:46777 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AIn start_xen():xen/arch/x86/setup.c=0Ahas function smp_prepare_boo= t_cpu() which also exist in vanilla kernel=0Athe kernel version is given th= at:=0Avoid __init native_smp_prepare_boot_cpu(void)=0A{=0A=A0=A0=A0 int me = =3D smp_processor_id();=0A=A0=A0=A0 switch_to_new_gdt(me);=0A=A0=A0=A0 /* a= lready set me in cpu_online_mask in boot_cpu_init() */=0A=A0=A0=A0 cpumask_= set_cpu(me, cpu_callout_mask);=0A=A0=A0=A0 per_cpu(cpu_state, me) =3D CPU_O= NLINE;=0A}=0A=0AWhera in case of Xen we have:=0Avoid __init smp_prepare_boo= t_cpu(void)=0A{=0A=A0=A0=A0 cpumask_set_cpu(smp_processor_id(), &cpu_online= _map);=0A=A0=A0=A0 cpumask_set_cpu(smp_processor_id(), &cpu_present_map);= =0A}=0AMy question is that why there is no need to change gdt pointer to cu= rrent cpu segment as it is=0Adone in case of kernel code?=0A=0AThanks=0A ---1007318780-1574078396-1355120859=:46777 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
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:
void __init native_smp_prepare_boot_cpu(void)
{
    int me =3D sm= p_processor_id();
    switch_to_new_gdt(me);
 &nb= sp;  /* already set me in cpu_online_mask in boot_cpu_init() */
&nb= sp;   cpumask_set_cpu(me, cpu_callout_mask);
   = ; per_cpu(cpu_state, me) =3D CPU_ONLINE;
}

Wher= a in case of Xen we have:
void __init smp_prepare_boot_cpu(void)<= br>{
    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 ne= ed to change gdt pointer to current cpu segment as it is
done in = case of kernel code?

Thanks
= ---1007318780-1574078396-1355120859=:46777-- --===============8191420588852697460== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8191420588852697460==--