DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] eal_common_cpuflags: Fix %rbx corruption, and simplify the code
Date: Tue, 25 Mar 2014 06:41:56 -0400	[thread overview]
Message-ID: <20140325104156.GA8102@hmsreliant.think-freely.org> (raw)
In-Reply-To: <533099FB.5030702@linux.intel.com>

On Mon, Mar 24, 2014 at 01:47:55PM -0700, H. Peter Anvin wrote:
> On 03/24/2014 12:52 PM, Neil Horman wrote:
> >>
> > 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.
> 
> It actually isn't: there aren't any flags in CPUID leaf 0, so since the
> code only looks for bits it'd be perfectly okay to reject leaf 0.
> 
> Another thing that I noted is that the code doesn't actually check that
> any particular leaf is valid (by checking the maximum leaf number in
> CPUID leaf 0xXXXX0000:EAX).  Especially for the leaf 7 features this
> could result in false positives, which obviously would be disastrous.
> 
Thanks, I'll improve this checking today.

> 	-hpa
> 
> 
> 

  reply	other threads:[~2014-03-25 10:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1395330830-1310-1-git-send-email-hpa@linux.intel.com>
2014-03-20 16:39 ` [dpdk-dev] [RFC UNTESTED PATCH] " Neil Horman
2014-03-20 17:02   ` Thomas Monjalon
2014-03-20 18:04   ` Neil Horman
2014-03-21 14:49   ` [dpdk-dev] [PATCH v2] " Neil Horman
2014-03-21 15:03     ` H. Peter Anvin
2014-03-21 17:48       ` Neil Horman
2014-03-24 11:18         ` Thomas Monjalon
2014-03-24 17:44   ` [dpdk-dev] [PATCH v3] " Neil Horman
2014-03-24 18:09     ` H. Peter Anvin
2014-03-24 19:52       ` Neil Horman
2014-03-24 20:47         ` H. Peter Anvin
2014-03-25 10:41           ` Neil Horman [this message]
2014-03-25 17:03   ` [dpdk-dev] [PATCH v4] " Neil Horman
2014-03-25 17:06     ` Chris Wright
2014-03-25 17:37     ` H. Peter Anvin
2014-03-25 19:52   ` [dpdk-dev] [PATCH v5] " Neil Horman
2014-03-25 20:51     ` H. Peter Anvin
2014-04-02 11:16       ` Neil Horman
2014-04-02 11:53         ` Thomas Monjalon
2014-04-02 12:42       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140325104156.GA8102@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=hpa@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).