Skip to content

Commit

Permalink
eal/x86: fix some CPU extended features definitions
Browse files Browse the repository at this point in the history
[ upstream commit aae3037 ]

Caught while checking CPUID related stuff in OVS.

According to [1], for Structured Extended Feature Flags Enumeration Leaf
(EAX = 0x07H, ECX = 0):

- BMI1 is associated to EBX, bit 3 (was incorrectly 2),
- SMEP is associated to EBX, bit 7 (was incorrectly 6),
- BMI2 is associated to EBX, bit 8 (was incorrectly 7),
- ERMS is associated to EBX, bit 9 (was incorrectly 8),

1: https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

Fixes: af75078 ("first public release")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
david-marchand authored and steevenlee committed Nov 8, 2021
1 parent cc7ded5 commit c41706b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/librte_eal/x86/rte_cpuflags.c
Expand Up @@ -100,12 +100,12 @@ const struct feature_entry rte_cpu_feature_table[] = {
FEAT_DEF(ENERGY_EFF, 0x00000006, 0, RTE_REG_ECX, 3)

FEAT_DEF(FSGSBASE, 0x00000007, 0, RTE_REG_EBX, 0)
FEAT_DEF(BMI1, 0x00000007, 0, RTE_REG_EBX, 2)
FEAT_DEF(BMI1, 0x00000007, 0, RTE_REG_EBX, 3)
FEAT_DEF(HLE, 0x00000007, 0, RTE_REG_EBX, 4)
FEAT_DEF(AVX2, 0x00000007, 0, RTE_REG_EBX, 5)
FEAT_DEF(SMEP, 0x00000007, 0, RTE_REG_EBX, 6)
FEAT_DEF(BMI2, 0x00000007, 0, RTE_REG_EBX, 7)
FEAT_DEF(ERMS, 0x00000007, 0, RTE_REG_EBX, 8)
FEAT_DEF(SMEP, 0x00000007, 0, RTE_REG_EBX, 7)
FEAT_DEF(BMI2, 0x00000007, 0, RTE_REG_EBX, 8)
FEAT_DEF(ERMS, 0x00000007, 0, RTE_REG_EBX, 9)
FEAT_DEF(INVPCID, 0x00000007, 0, RTE_REG_EBX, 10)
FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11)
FEAT_DEF(AVX512F, 0x00000007, 0, RTE_REG_EBX, 16)
Expand Down

0 comments on commit c41706b

Please sign in to comment.