From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by dpdk.org (Postfix) with ESMTP id 25AAC3F9 for ; Mon, 24 Mar 2014 12:16:51 +0100 (CET) Received: by mail-bk0-f41.google.com with SMTP id d7so444858bkh.14 for ; Mon, 24 Mar 2014 04:18:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=GRIegdEx9GAjvaOM3vlv7uzK4aR/spSaH9oCzNVHMyM=; b=Q7P9lpNbCI60iYimnH6oBww0ukRl3yuFirkZFmRde9CUVi6C1v6Ob2rW61E0x2Q3Mw W+2bODywkqZWpOM3WIayQoE2dHM6HHp4kom06M0VL1ICEw6ChfAECT9/P3JiIWAL0DeT 5ZNMTztnzaAm5lo82nhVpAgTSvMivCLlGksI33IOqtaeLgT5LwsGk5cUfqzhElWgzuxH QbNshMLXEEtLq/hC/MTKjEhqQ0gl6B5tFJNUSw1Pgi6YXIYXIFHbPpvr3agfbLy+D+KW GsPbKK5N0YA9wgcE3U3ONac6btDOBSFIXLgkRqMKAAXP+o2msf1ANvHuMGPeA0ezUyS3 vn8Q== X-Gm-Message-State: ALoCoQmmZo+XToQxRifxNWeAPrezJ0tWOkFpnkQ/+YYiuG2QFFVKjMcvl0J0Er0egaf8y2XZ6Rni X-Received: by 10.204.241.131 with SMTP id le3mr35625773bkb.0.1395659903502; Mon, 24 Mar 2014 04:18:23 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ew15sm6568145bkb.1.2014.03.24.04.18.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 04:18:22 -0700 (PDT) From: Thomas Monjalon To: Neil Horman , "H. Peter Anvin" Date: Mon, 24 Mar 2014 12:18:22 +0100 Message-ID: <2299174.zzRGPuydMQ@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.6-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <20140321174839.GB21998@hmsreliant.think-freely.org> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <532C54C6.2060202@linux.intel.com> <20140321174839.GB21998@hmsreliant.think-freely.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Mon, 24 Mar 2014 11:16:51 -0000 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