[dpdk-dev] [RFC UNTESTED PATCH] eal_common_cpuflags: Fix %rbx corruption, and simplify the code

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Mar 20 18:02:52 CET 2014


20/03/2014 12:39, Neil Horman :
> On Thu, Mar 20, 2014 at 08:53:50AM -0700, H. Peter Anvin wrote:
> > 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 <nhorman at tuxdriver.com>
> > Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
> Acked-by: Neil Horman <nhorman at tuxdriver.com>

This is a RFC UNTESTED patch.
So should I understand with this acknowledgement that you have tested it?
As a shared library? in 32-bit mode?


More information about the dev mailing list