From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] eal_common_cpuflags: Fix %rbx corruption, and simplify the code Date: Mon, 24 Mar 2014 12:18:22 +0100 Message-ID: <2299174.zzRGPuydMQ@xps13> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <532C54C6.2060202@linux.intel.com> <20140321174839.GB21998@hmsreliant.think-freely.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Neil Horman , "H. Peter Anvin" Return-path: In-Reply-To: <20140321174839.GB21998-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 21/03/2014 13:48, Neil Horman: > 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. Yes, DPDK use C99 syntax. Feel free to use it in a v3 :) -- Thomas