From: Tim Deegan Subject: Re: [PATCH 1/3] x86: fix guest CPUID handling Date: Thu, 1 May 2014 17:29:42 +0200 Message-ID: <20140501152942.GF86038@deinos.phlegethon.org> References: <536120AF020000780000DD1B@mail.emea.novell.com> <53612347020000780000DD53@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wfsvj-0003yp-5h for xen-devel@lists.xenproject.org; Thu, 01 May 2014 15:29:47 +0000 Content-Disposition: inline In-Reply-To: <53612347020000780000DD53@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Campbell , xen-devel , Keir Fraser , Ian Jackson List-Id: xen-devel@lists.xenproject.org At 15:22 +0100 on 30 Apr (1398867751), Jan Beulich wrote: > The way XEN_DOMCTL_set_cpuid got handled so far allowed for surprises > to the caller. With this set of operations > - set leaf A (using array index 0) > - set leaf B (using array index 1) > - clear leaf A (clearing array index 0) > - set leaf B (using array index 0) > - clear leaf B (clearing array index 0) > the entry for leaf B at array index 1 would still be in place, while > the caller would expect it to be cleared. > > While looking at the use sites of d->arch.cpuid[] I also noticed that > the allocation of the array needlessly uses the zeroing form - the > relevant fields of the array elements get set in a loop immediately > following the allocation. > > Signed-off-by: Jan Beulich Reviewed-by: Tim Deegan