From: Christoph Egger Subject: Re: [PATCH] microcode update support for AMD CPUs Date: Mon, 15 Sep 2008 17:26:08 +0200 Message-ID: <200809151726.08894.Christoph.Egger@amd.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: 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: Keir Fraser Cc: xen-devel@lists.xensource.com, Ian Jackson List-Id: xen-devel@lists.xenproject.org On Monday 15 September 2008 16:42:17 Keir Fraser wrote: > On 15/9/08 15:10, "Ian Jackson" wrote: > > Christoph Egger writes ("[Xen-devel] [PATCH] microcode update support f= or > > AMD > > > > CPUs"): > >> + edx =3D (unsigned int)((unsigned long)(addr >> 32)); > > > > This is wrong. addr is an unsigned long, ie 32 bits so you are > > shifting by >=3D the word size, which is not permitted. Helpfully, many > > compilers warn about it. > > > > But addr came from this: > > addr =3D (unsigned long)&uci->mc.mc_amd->hdr.data_code; > > surely this cannot be right if you're expecting the address to be > > longer than 32 bits in some cases ? > > The code's correct when targeting x86_64. It just isn't careful enough for > the i386 target. I'll check in a fix, since it's pretty trivial. Thanks for fixing this. I should have compile-tested for 32bit at least. gcc actually warns with shifting >=3D count . Christoph =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy