From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id F1D8A593A for ; Tue, 25 Mar 2014 19:12:41 +0100 (CET) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2PICWoO001618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Mar 2014 14:14:14 -0400 Received: from x220.localdomain (ovpn-113-60.phx2.redhat.com [10.3.113.60]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id s2PH6bnb021120; Tue, 25 Mar 2014 13:06:37 -0400 Date: Tue, 25 Mar 2014 10:06:36 -0700 From: Chris Wright To: Neil Horman 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 Content-Disposition: inline In-Reply-To: <1395767000-28709-1-git-send-email-nhorman@tuxdriver.com> User-Agent: Mutt/1.5.21+63 (2f2ebc24920d) (2011-07-01) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Cc: dev@dpdk.org, "H. Peter Anvin" Subject: Re: [dpdk-dev] [PATCH v4] 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, 25 Mar 2014 18:12:42 -0000 * Neil Horman (nhorman@tuxdriver.com) 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)