mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: gengdongjiu <gengdongjiu@huawei.com>
To: <suzuki.poulose@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [question] extract the feature bits width to 4
Date: Tue, 28 Nov 2017 19:17:40 +0800	[thread overview]
Message-ID: <17ab0a11-7ca2-ff22-35d6-7446dbccc3ea@huawei.com> (raw)

Hi,suzuki/mark,

  very sorry to disturb you, I have a question that want to consult with you. For the CPU feature detection,
why we use extract 4 bits width for the feature match instead of the actual bits number[1]?  may be the actual hardware feature bit more than 4 bits.
thanks!

static inline int __attribute_const__
cpuid_feature_extract_field(u64 features, int field, bool sign)
{
        return cpuid_feature_extract_field_width(features, field, 4, sign);
}

static bool
feature_matches(u64 reg, const struct arm64_cpu_capabilities *entry)
{
        int val = cpuid_feature_extract_field(reg, entry->field_pos, entry->sign);

        return val >= entry->min_field_value;
}

             reply	other threads:[~2017-11-28 11:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 11:17 gengdongjiu [this message]
2017-11-28 11:40 ` Suzuki K Poulose
2017-11-28 12:38   ` gengdongjiu
2017-11-28 14:37     ` Suzuki K Poulose
2017-11-29  1:27       ` gengdongjiu

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=17ab0a11-7ca2-ff22-35d6-7446dbccc3ea@huawei.com \
    --to=gengdongjiu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=suzuki.poulose@arm.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

all inboxes | Powered by JetHome®