From: "Jan Beulich" Subject: [PATCH] linux/x86: don't initialize cpu_data[]'s apicid field on generic code Date: Wed, 13 May 2009 15:27:12 +0100 Message-ID: <4A0AF4E00200007800000BFC@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Afaict, this is not only redundant with the intialization done in drivers/xen/core/smpboot.c, but actually results - at least for secondary CPUs - in the Xen-specific value written to be later overwritten with whatever the generic code determines (with no guarantee that the two values are identical). As usual, written and tested on 2.6.30-rc4 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich --- head-2009-05-04.orig/arch/i386/kernel/cpu/common-xen.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/arch/i386/kernel/cpu/common-xen.c 2009-05-04 = 11:04:43.000000000 +0200 @@ -301,11 +301,13 @@ void __cpuinit generic_identify(struct c if (c->x86 >=3D 0x6) c->x86_model +=3D ((tfms >> 16) & 0xF) << = 4; c->x86_mask =3D tfms & 15; +#ifndef CONFIG_XEN #ifdef CONFIG_X86_HT c->apicid =3D phys_pkg_id((ebx >> 24) & 0xFF, 0); #else c->apicid =3D (ebx >> 24) & 0xFF; #endif +#endif } else { /* Have CPUID level 0 only - unheard of */ c->x86 =3D 4; --- head-2009-05-04.orig/arch/x86_64/kernel/setup-xen.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/arch/x86_64/kernel/setup-xen.c 2009-05-04 = 11:04:43.000000000 +0200 @@ -1378,7 +1378,9 @@ void __cpuinit identify_cpu(struct cpuin c->x86_capability[2] =3D cpuid_edx(0x80860001); } =20 +#ifndef CONFIG_XEN c->apicid =3D phys_pkg_id(0); +#endif =20 /* * Vendor-specific initialization. In this section we