From: Keir Fraser Subject: Re: [PATCH] microcode update support for AMD CPUs Date: Mon, 15 Sep 2008 15:42:17 +0100 Message-ID: References: <18638.27841.714797.640342@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <18638.27841.714797.640342@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson , Christoph Egger Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 15/9/08 15:10, "Ian Jackson" wrote: > Christoph Egger writes ("[Xen-devel] [PATCH] microcode update support for AMD > CPUs"): >> + edx = (unsigned int)((unsigned long)(addr >> 32)); > > This is wrong. addr is an unsigned long, ie 32 bits so you are > shifting by >= the word size, which is not permitted. Helpfully, many > compilers warn about it. > > But addr came from this: > addr = (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. -- Keir