From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 018742E88 for ; Fri, 21 Mar 2014 18:47:12 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1WR3Ye-0000QC-MK; Fri, 21 Mar 2014 13:48:44 -0400 Date: Fri, 21 Mar 2014 13:48:39 -0400 From: Neil Horman To: "H. Peter Anvin" Message-ID: <20140321174839.GB21998@hmsreliant.think-freely.org> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <1395413340-27392-1-git-send-email-nhorman@tuxdriver.com> <532C54C6.2060202@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532C54C6.2060202@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] eal_common_cpuflags: Fix %rbx corruption, and simplify the code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 17:47:13 -0000 On Fri, Mar 21, 2014 at 08:03:34AM -0700, H. Peter Anvin wrote: > On 03/21/2014 07:49 AM, Neil Horman wrote: > > From: "H. Peter Anvin" > > > > Neil Horman reported that on x86-64 the upper half of %rbx would get > > clobbered when the code was compiled PIC or PIE, because the > > i386-specific code to preserve %ebx was incorrectly compiled. > > > > However, the code is really way more complex than it needs to be. For > > one thing, the CPUID instruction only needs %eax (leaf) and %ecx > > (subleaf) as parameters, and since we are testing for bits, we might > > as well list the bits explicitly. Furthermore, we can use an array > > rather than doing a switch statement inside a structure. > > > > Reported-by: Neil Horman > > Signed-off-by: H. Peter Anvin > > Tested-by: Neil Horman > > > > Thank you for dealing with this! > > On the subject of my other email... are C99 initializers acceptable in > dpdk? If so, I think making that change, too, would be a good idea. > I'll have to defer this to others, I'm not sure what the accepted initalization method is. I'm guessing their fine, as both icc and gcc allow them and those are the supported compilers for dpdk, but I'd like to hear someone in the maintainership comment. Best Neil > -hpa > > >