From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Horman Subject: Re: [PATCH v3] eal_common_cpuflags: Fix %rbx corruption, and simplify the code Date: Mon, 24 Mar 2014 15:52:06 -0400 Message-ID: <20140324195206.GG19368@hmsreliant.think-freely.org> References: <20140320163921.GC7721@hmsreliant.think-freely.org> <1395683088-19687-1-git-send-email-nhorman@tuxdriver.com> <533074F0.3060204@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev-VfR2kkLFssw@public.gmane.org To: "H. Peter Anvin" Return-path: Content-Disposition: inline In-Reply-To: <533074F0.3060204-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Mon, Mar 24, 2014 at 11:09:52AM -0700, H. Peter Anvin wrote: > On 03/24/2014 10:44 AM, Neil Horman wrote: > > * Modified cpuid_reg enum to start at 1 rather than zero > > * Added CPUID_REG macro to drop enum value by 1 during access > > I guess I don't get it... why? > To add an extra sanity check in rte_get_flag_enabled. If we were moving to the use of C99 initalizers, I wanted something to catch the possibility that we skip a flag by accident (i.e. leave a zero initalized hole in the array). Except 0 from my read is a valid value for all the fields of the array. So I bumped up the cpuid register enum by one and wrapped it in a macro. That way we can test for !feat->reg as an indicator that we're requesting feature support for a flag thats not listed in the array. Neil > -hpa > >