mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [question] extract the feature bits width to 4
@ 2017-11-28 11:17 gengdongjiu
  2017-11-28 11:40 ` Suzuki K Poulose
  0 siblings, 1 reply; 5+ messages in thread
From: gengdongjiu @ 2017-11-28 11:17 UTC (permalink / raw)
  To: suzuki.poulose, mark.rutland, Linux Kernel Mailing List

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;
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-29  1:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 11:17 [question] extract the feature bits width to 4 gengdongjiu
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

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®