From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id CF40568F8 for ; Wed, 2 Apr 2014 14:40:29 +0200 (CEST) Received: by mail-wi0-f169.google.com with SMTP id hm4so6460846wib.4 for ; Wed, 02 Apr 2014 05:42:04 -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=cDrIQ7nj8FOFQAEhf24QH3D4l2Dyxo0UP7ZKNB/qTcY=; b=VnsTGW+Dln+VDbhYR3vVZ0alOhz5q1pVSnwmZ5eewuJxUZ78HUG7GafQ1PnPspqjPX gWrjgy1NqkPTERmazX5QQj5QgL5HCciBTfus8McZZmcMucWEt4CpN1zqhf/ofCjSoQDD n87hKgsUjJHWLsEN0B719mT9+tVkAeULjtBpLRsfsACO9rNVLTJ8eK6LpJzee440Q3tE 34lfWGNA5yZluAT3nFbuj2ABp/9efWM7ArlMjsMGovsoOMDizsdgY6F4QGSmJcGVsKg/ vkHBdfbVbVnkFmJktYv1FbisAnf2S1/fv/RNbViZUT3Mu764Q9f+Jrib6K5mZrkgNQlc NxUQ== X-Gm-Message-State: ALoCoQnRN5aead/NhfmzAJ0zFBB0e8Di1e5j3ToRd7CEumEv3ubfK19n3emf8rQIhn4FLusvXGvA X-Received: by 10.194.92.228 with SMTP id cp4mr275950wjb.81.1396442524496; Wed, 02 Apr 2014 05:42:04 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id w6sm2762786wjq.29.2014.04.02.05.42.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Apr 2014 05:42:03 -0700 (PDT) From: Thomas Monjalon To: "H. Peter Anvin" , Neil Horman Date: Wed, 02 Apr 2014 14:42:03 +0200 Message-ID: <3016744.X9vPJgkyJz@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.7-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <5331EC38.2070901@linux.intel.com> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <1395777179-4345-1-git-send-email-nhorman@tuxdriver.com> <5331EC38.2070901@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org 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: Wed, 02 Apr 2014 12:40:30 -0000 2014-03-25 13:51, H. Peter Anvin: > On 03/25/2014 12:52 PM, Neil Horman 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 > > Signed-off-by: H. Peter Anvin > > Signed-off-by: Neil Horman > > Looks good to me. > > Reviewed-by: H. Peter Anvin Applied for version 1.6.0r2. Thanks for this difficult fix. -- Thomas