From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wright Subject: Re: [PATCH v4] eal_common_cpuflags: Fix %rbx corruption, and simplify the code Date: Tue, 25 Mar 2014 10:06:36 -0700 Message-ID: <20140325170636.GX12042@x220.localdomain> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <1395767000-28709-1-git-send-email-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev-VfR2kkLFssw@public.gmane.org, "H. Peter Anvin" To: Neil Horman Return-path: Content-Disposition: inline In-Reply-To: <1395767000-28709-1-git-send-email-nhorman-2XuSBdqkA4R54TAoqtyWWQ@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" * Neil Horman (nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org) wrote: (given the format, I'd expect a From hpa here) > 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 And an S-o-B by you (sorry for the otherwise content free nitpick)