From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 246C3AFD9 for ; Tue, 15 Apr 2014 16:10:35 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 15 Apr 2014 07:10:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,864,1389772800"; d="scan'208";a="513543149" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga001.fm.intel.com with ESMTP; 15 Apr 2014 07:10:26 -0700 Received: from irsmsx107.ger.corp.intel.com (163.33.3.99) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 15 Apr 2014 15:09:34 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.172]) by IRSMSX107.ger.corp.intel.com ([169.254.10.157]) with mapi id 14.03.0123.003; Tue, 15 Apr 2014 15:09:34 +0100 From: "De Lara Guarch, Pablo" To: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5] eal_common_cpuflags: Fix %rbx corruption, and simplify the code Thread-Index: Ac9YtDx9dE/WEkIuRFeYmOjh07cPyw== Date: Tue, 15 Apr 2014 14:09:34 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5] 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: Tue, 15 Apr 2014 14:10:36 -0000 Hi, I have checked that on gcc-4.5, I get a compilation error due to the follow= ing patch: > > Neil Horman reported that on x86-64 the upper half of %rbx would get=20 > > clobbered when the code was compiled PIC or PIE, because the=20 > > i386-specific code to preserve %ebx was incorrectly compiled. > >=20 > > However, the code is really way more complex than it needs to be. =20 > > For one thing, the CPUID instruction only needs %eax (leaf) and %ecx > > (subleaf) as parameters, and since we are testing for bits, we might=20 > > as well list the bits explicitly. Furthermore, we can use an array=20 > > rather than doing a switch statement inside a structure. > >=20 > > Reported-by: Neil Horman > > Signed-off-by: H. Peter Anvin > > Signed-off-by: Neil Horman The compilation error is: /root/dpdk/lib/librte_eal/common/eal_common_cpuflags.c: In function 'rte_cp= u_check_supported': /root/dpdk/lib/librte_eal/common/eal_common_cpuflags.c:271:48: error: array= subscript is above array bounds make[7]: *** [eal_common_cpuflags.o] Error 1 This error is not present in newer gcc versions (4.6 and above). Thanks, Pablo de Lara DPDK SW Engineer -------------------------------------------------------------- Intel Shannon Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Reg= istered Number: 308263 Business address: Dromore House, East Park, Shannon,= Co. Clare