dpdk2.0-rc1 build error fix
cover dpdk2.0-rc1 build error fix
This patch set is to fix dpdk2.0-rc1 compile error.
Michael Qiu (3):
librte_hash: Fix unsupported instruction `crc32' in i686 platform app/test: Fix size_t printf formart issue librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
app/test/test_hash.c | 2 +- .../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- lib/librte_hash/rte_hash_crc.h | 4 + 3 files changed, 110 insertions(+), 106 deletions(-)
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425561339-13300-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
PATCH 1/3 librte_hash: Fix unsupported instruction `crc32' in i686 platform
CC rte_hash.o
Error: unsupported instruction `crc32'
The root cause is that i686 platform does not support 'crc32q' Need make it only available in x86_64 platform
--- lib/librte_hash/rte_hash_crc.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/librte_hash/rte_hash_crc.h +4 -0
@@ -374,6 +374,7 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val)return init_val; } +#ifdef RTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64 (uint64_t data,uint64_t init_val) {
@@ -383,6 +384,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) : [data] "rm" (data)); return init_val; } +#endif static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val)
@@ -476,8 +478,10 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425561339-13300-2-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Re: [PATCH 1/3] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Hi Michael,
Thanks for this patch, in fact I didn't try to compile it on i686 when developing original software fallback for CRC32.
I think if we want to make code compilable as wide as possible, we should compile out all SSE4.2 instructions. As to the patch, we may compile out 'crc32l' instruction emitting code if the arch is not x86. This concerns two functions: crc32c_sse42_u32() and crc32c_sse42_u64_mimic().
The compile check might be something like this:
#if defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_64) #endif
Otherwise, the patch looks good.
05.03.2015 19:15, Michael Qiu пишет:
Quoted 42 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>--- lib/librte_hash/rte_hash_crc.h | 4 ++++ 1 file changed, 4 insertions(+)lib/librte_hash/rte_hash_crc.h +4
-0@@ -374,6 +374,7 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val)return init_val; } +#ifdef RTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64 (uint64_t data,uint64_t init_val) {@@ -383,6 +384,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) : [data] "rm" (data)); return init_val; } +#endif static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val)@@ -476,8 +478,10 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);
Signature · 5 lines
Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ
Re: [PATCH 1/3] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Quoted 10 lines · Yerden Zhumabekov
Hi Michael,
Thanks for this patch, in fact I didn't try to compile it on i686 when developing original software fallback for CRC32.
I think if we want to make code compilable as wide as possible, we should compile out all SSE4.2 instructions. As to the patch, we may compile out 'crc32l' instruction emitting code if the arch is not x86. This concerns two functions:
crc32c_sse42_u32()andcrc32c_sse42_u64_mimic().
OK, I will add the check for crc32l, make it only works for x86
Thanks,
Michael
Quoted 50 lines
The compile check might be something like this:
#if
defined(RTE_ARCH_I686)||defined(RTE_ARCH_X86_64)#endifOtherwise, the patch looks good.
05.03.2015 19:15, Michael Qiu пишет:
Quoted 42 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>--- lib/librte_hash/rte_hash_crc.h | 4 ++++ 1 file changed, 4 insertions(+)lib/librte_hash/rte_hash_crc.h +4
-0@@ -374,6 +374,7 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val)return init_val; } +#ifdef RTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64 (uint64_t data,uint64_t init_val) {@@ -383,6 +384,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) : [data] "rm" (data)); return init_val; } +#endif static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val)@@ -476,8 +478,10 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);
PATCH v2 1/3 librte_hash: Fix unsupported instruction `crc32' in i686 platform
In reply to a message not in the archiveCC rte_hash.o
Error: unsupported instruction `crc32'
The root cause is that i686 platform does not support 'crc32q' Need make it only available in x86_64 platform
---
v2 --> v1:
Make crc32 instruction only works in X86 platform
lib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
lib/librte_hash/rte_hash_crc.h +12 -0
@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {
@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data));return init_val; } +#endif +#ifdef RTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64 (uint64_t data,uint64_t init_val) {
@@ -383,7 +386,9 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) : [data] "rm" (data));return init_val; } +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val) {
@@ -397,6 +402,7 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) init_val =crc32c_sse42_u32 (d.u32[1 ], init_val); return init_val; } +#endif #define CRC32_SW (1U << 0)#define CRC32_SSE42 (1U << 1)
@@ -455,8 +461,10 @@ rte_hash_crc_init_alg(void)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val); +#endif return crc32c_1word (data, init_val); }
@@ -476,11 +484,15 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val); +#endif return crc32c_2words (data, init_val); }
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425574530-16019-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Yerden Zhumabekov
Acked-byRe: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
05.03.2015 22:55, Michael Qiu пишет:
Quoted 80 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +12
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data));return init_val; } +#endif +#ifdef RTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64 (uint64_t data,uint64_t init_val) {@@ -383,7 +386,9 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) : [data] "rm" (data));return init_val; } +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val) {@@ -397,6 +402,7 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) init_val =crc32c_sse42_u32 (d.u32[1 ], init_val); return init_val; } +#endif #define CRC32_SW (1U << 0)#define CRC32_SSE42 (1U << 1)@@ -455,8 +461,10 @@ rte_hash_crc_init_alg(void)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val); +#endif return crc32c_1word (data, init_val); }@@ -476,11 +484,15 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val); +#endif return crc32c_2words (data, init_val); }
Signature · 5 lines
Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
In reply to a message not in the archive2015-03-06 00:55, Michael Qiu:
Quoted 26 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +1
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 4 lines
lib/librte_hash/rte_hash_crc.h +1
-0@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif
Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
[...]
Quoted 28 lines
lib/librte_hash/rte_hash_crc.h +6
-0@@ -455,8 +461,10 @@ rte_hash_crc_init_alg(void)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val); +#endif return crc32c_1word (data, init_val); }@@ -476,11 +484,15 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val); +#endif return crc32c_2words (data, init_val); }
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Quoted 22 lines · Thomas Monjalon
2015-03-06 00:55, Michael Qiu:
Quoted 21 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +0
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; }
Quoted 12 lines
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 9 lines
lib/librte_hash/rte_hash_crc.h +2
-0+#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
It may be not a good idea, see rte_hash_crc_8byte(), if no crc32 support, it will use crc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.
Thanks,
Michael
Quoted 31 lines
[...]
Quoted 28 lines
lib/librte_hash/rte_hash_crc.h +6
-0@@ -455,8 +461,10 @@ rte_hash_crc_init_alg(void)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val); +#endif return crc32c_1word (data, init_val); }@@ -476,11 +484,15 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { +#ifdef RTE_ARCH_X86_64 if (likely (crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val); +#endif +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 if (likely (crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val); +#endif return crc32c_2words (data, init_val); }
A message that is not in the archive (sent off-list or not yet received): 533710CFB86FA344BFBF2D6802E60286CEF549-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
2015-03-06 01:39, Qiu, Michael:
Quoted 37 lines · Thomas Monjalon
Quoted 22 lines
2015-03-06 00:55, Michael Qiu:
Quoted 21 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +0
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; }Quoted 13 lines
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 9 lines
lib/librte_hash/rte_hash_crc.h +2
-0+#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
Quoted 4 lines
It may be not a good idea, see
rte_hash_crc_8byte(), if no crc32 support, it will usecrc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.
I don't think so.
The stub won't never been called because they are protected by the cpuflag condition.
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Quoted 36 lines · Thomas Monjalon
2015-03-06 01:39, Qiu, Michael:
Quoted 35 lines · Thomas Monjalon
Quoted 34 lines
2015-03-06 00:55, Michael Qiu:
Quoted 26 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +1
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 4 lines
lib/librte_hash/rte_hash_crc.h +1
-0@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
Quoted 7 lines
Quoted 4 lines
It may be not a good idea, see
rte_hash_crc_8byte(), if no crc32 support, it will usecrc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.I don't think so.
The stub won't never been called because they are protected by the cpuflag condition.
Hi, Thomas
You are right, I will send out v3 patch to fix this
Thanks,
Michael
Quoted 1 line
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
In reply to Thomas Monjalon08.03.2015 0:39, Thomas Monjalon пишет:
Quoted 17 lines
2015-03-06 01:39, Qiu, Michael:
Quoted 16 lines · Thomas Monjalon
Quoted 15 lines
2015-03-06 00:55, Michael Qiu:
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 11 lines
... skipped ...
lib/librte_hash/rte_hash_crc.h +2
-0+#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
Quoted 7 lines
Quoted 4 lines
It may be not a good idea, see
rte_hash_crc_8byte(), if no crc32 support, it will usecrc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.I don't think so.
The stub won't never been called because they are protected by the cpuflag condition.
That would be a bad surprise if one tries to launch that pre-built binary on SSE4.2-capable arch :) It's fine though, if binary portability is out of scope here.
Signature · 5 lines
Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
In reply to Thomas MonjalonQuoted 36 lines · Thomas Monjalon
2015-03-06 01:39, Qiu, Michael:
Quoted 35 lines · Thomas Monjalon
Quoted 34 lines
2015-03-06 00:55, Michael Qiu:
Quoted 26 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +1
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 4 lines
lib/librte_hash/rte_hash_crc.h +1
-0@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.
Quoted 7 lines
Quoted 4 lines
It may be not a good idea, see
rte_hash_crc_8byte(), if no crc32 support, it will usecrc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.I don't think so.
The stub won't never been called because they are protected by the cpuflag condition.
Hi, Thomas
Indeed what I concerned occurs, when compile target i686 in X86_64 platform, it will call the stub function
Then, should I make a patch to fix, change the code as this one(V2)
Another choice is you could revert V3 and merge V2.
Or if have other solution?
Thanks,
Michael
Quoted 1 line
A message that is not in the archive (sent off-list or not yet received): 533710CFB86FA344BFBF2D6802E60286D1603B-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org
Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform
2015-03-19 02:00, Qiu, Michael:
Quoted 41 lines · Thomas Monjalon
Quoted 40 lines
2015-03-06 01:39, Qiu, Michael:
Quoted 39 lines · Thomas Monjalon
Quoted 22 lines
2015-03-06 00:55, Michael Qiu:
Quoted 21 lines
CC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)lib/librte_hash/rte_hash_crc.h +0
-0@@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; }Quoted 12 lines
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u32(uint32_t data, uint32_t init_val) · line 377
Quoted 9 lines
lib/librte_hash/rte_hash_crc.h +2
-0+#if definedRTE_ARCH_I686 || definedRTE_ARCH_X86_64 static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) : [data] "rm" (data)); return init_val; } +#endif Wouldn't it be more elegant to define a stub which returns 0 in #else in order to remove #ifdef below?
Not sure, matter of taste.It may be not a good idea, see
rte_hash_crc_8byte(), if no crc32 support, it will usecrc32c_2words(), if we define a stub which returns 0 in #else, then we need always check the return value whether it is none-zero otherwise need fallback.
Quoted 8 lines
Quoted 3 lines
I don't think so.
The stub won't never been called because they are protected by the cpuflag condition.Hi, Thomas
Indeed what I concerned occurs, when compile target i686 in
X86_64platform, it will call the stub function
Oh, you mean compiling for i686 and run it in x86_64 target, so the stub for crc32c_sse42_u64 is called?
Quoted 3 lines
Then, should I make a patch to fix, change the code as this one(V2) Another choice is you could revert V3 and merge V2.
Or if have other solution?
It's probably saner to submit a fix you have tested with ifdef like in v2. Thanks
PATCH v3 1/3 librte_hash: Fix unsupported instruction `crc32' in i686 platform
In reply to a message not in the archiveCC rte_hash.o
Error: unsupported instruction `crc32'
The root cause is that i686 platform does not support 'crc32q' Need make it only available in x86_64 platform
---
v3 --> v2:
Add sub function for #else which returns 0
v2 --> v1:
Make crc32 instruction only works in X86 platform
lib/librte_hash/rte_hash_crc.h | 46 +++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-)
lib/librte_hash/rte_hash_crc.h +36 -10
@@ -47,6 +47,7 @@ extern "C" {#include <stdint.h> #include <rte_cpuflags.h> #include <rte_branch_prediction.h> +#include <rte_common.h> /* Lookup tables for software implementation of CRC32C */ static const uint32_t crc32c_tables[8 ][256 ] = {{
@@ -364,6 +365,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if defined(RTE_ARCH_I686 ) || defined(RTE_ARCH_X86_64 )static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {
@@ -375,16 +377,6 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) }static inline uint32_t -crc32c_sse42_u64 (uint64_t data,uint64_t init_val) -{ - __asm__volatile ( -"crc32q %[data], %[init_val];" - : [init_val]"+r" (init_val) - : [data]"rm" (data)); -return init_val; -} - -static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val) {union {
@@ -397,6 +389,40 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) init_val =crc32c_sse42_u32 (d.u32[1 ], init_val);return init_val; } +#else +static inline uint32_t +crc32c_sse42_u32(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) +{ +return 0 ; +} + +static inline uint32_t +crc32c_sse42_u64_mimic(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) +{ +return 0 ; +} +#endif + +#ifdef RTE_ARCH_X86_64 +static inline uint32_t +crc32c_sse42_u64 (uint64_t data,uint64_t init_val) +{ + __asm__volatile ( +"crc32q %[data], %[init_val];" + : [init_val]"+r" (init_val) + : [data]"rm" (data)); +return init_val; +} +#else +static inline uint32_t +crc32c_sse42_u64(__rte_unused uint64_t data, + __rte_unused uint64_t init_val) +{ +return 0 ; +} +#endif #define CRC32_SW (1U << 0)#define CRC32_SSE42 (1U << 1)
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425880685-27424-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Re: [PATCH 1/3 v3] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Michael & Thomas,
Should we use software crc function replace of hardware crc function in 'crc32c_sse42_u64' when arch is i686? Thus application still can use CRC32_SSE42_x64 algorithm for crc calculation when build with i686 configuration. This may helpful for simplify application code.
Quoted 90 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Qiu
Sent: Monday, March 09, 2015 1:58 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 1/3 v3]librte_hash: Fix unsupported instruction `crc32' in i686 platformCC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v3 --> v2:
Add sub function for #else which returns 0
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 46 +++++++++++++++++++++++++++++++++---- ----- 1 file changed, 36 insertions(+), 10 deletions(-)lib/librte_hash/rte_hash_crc.h +23
-10@@ -47,6 +47,7 @@ extern "C" {#include <stdint.h> #include <rte_cpuflags.h> #include <rte_branch_prediction.h> +#include <rte_common.h> /* Lookup tables for software implementation of CRC32C */ static const uint32_t crc32c_tables[8 ][256 ] = {{@@ -364,6 +365,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)return crc; } +#if defined(RTE_ARCH_I686 ) || defined(RTE_ARCH_X86_64 )static inline uint32_t crc32c_sse42_u32 (uint32_t data,uint32_t init_val) {@@ -375,16 +377,6 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) }static inline uint32_t -crc32c_sse42_u64 (uint64_t data,uint64_t init_val) -{ - __asm__volatile ( -"crc32q %[data], %[init_val];" - : [init_val]"+r" (init_val) - : [data]"rm" (data)); -return init_val; -} - -static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val) {union {@@ -397,6 +389,40 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) init_val =crc32c_sse42_u32 (d.u32[1 ], init_val);return init_val; } +#else +static inline uint32_t +crc32c_sse42_u32(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) +{ +return 0 ; +} + +static inline uint32_t +crc32c_sse42_u64_mimic(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) +{ +return 0 ; +} +#endif + +#ifdef RTE_ARCH_X86_64 +static inline uint32_t +crc32c_sse42_u64 (uint64_t data,uint64_t init_val) +{ + __asm__ volatile(
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u64_mimic(uint64_t data, uint64_t · line 423
Quoted 10 lines
lib/librte_hash/rte_hash_crc.h +10
-0+"crc32q %[data], %[init_val];" + : [init_val] "+r" (init_val) + : [data] "rm" (data)); +return init_val; +} +#else +static inline uint32_t +crc32c_sse42_u64(__rte_unused uint64_t data, + __rte_unused uint64_t init_val) +{
return crc32c_2words(data, init_val);
Quoted 8 lines
lib/librte_hash/rte_hash_crc.h +3
-0+ return 0; +} +#endif #define CRC32_SW (1U << 0)#define
CRC32_SSE42(1U << 1)
--
1.9.3
A message that is not in the archive (sent off-list or not yet received): 86228AFD5BCD8E4EBFD2B90117B5E81E10DA603B-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org
Re: [PATCH 1/3 v3] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Hi, Yong
If the platform is i686, dpdk will use software crc function.
Thanks,
Michael
-----Original Message-----
From: Liu, Yong
Sent: Wednesday, March 18, 2015 9:21 PM
To: Qiu, Michael; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [dpdk-dev] [PATCH 1/3 v3] librte_hash: Fix unsupported instruction `crc32' in i686 platform
Michael & Thomas,
Should we use software crc function replace of hardware crc function in 'crc32c_sse42_u64' when arch is i686? Thus application still can use CRC32_SSE42_x64 algorithm for crc calculation when build with i686 configuration. This may helpful for simplify application code.
Quoted 84 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Qiu
Sent: Monday, March 09, 2015 1:58 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 1/3 v3]librte_hash: Fix unsupported instruction `crc32' in i686 platformCC rte_hash.o
Error: unsupported instruction `crc32'The root cause is that i686 platform does not support 'crc32q' Need make it only available in
x86_64platformSigned-off-by Michael Qiu <[email protected]>---
v3 --> v2:
Add sub function for #else which returns 0
v2 --> v1:
Make crc32 instruction only works in X86 platformlib/librte_hash/rte_hash_crc.h | 46 +++++++++++++++++++++++++++++++++---- ----- 1 file changed, 36 insertions(+), 10 deletions(-)(quoted diff) +0
-0
b/lib/librte_hash/rte_hash_crc.hindex d28bb2a..f1dbded 100644lib/librte_hash/rte_hash_crc.h +1
-0@@ -47,6 +47,7 @@ extern "C" {#include <stdint.h> #include <rte_cpuflags.h> #include <rte_branch_prediction.h> +#include <rte_common.h> /* Lookup tables for software implementation of CRC32C */ staticconst
uint32_tcrc32c_tables[8][256] = {{ @@ -364,6 +365,7 @@crc32c_2words(uint64_t data, uint32_t init_val)lib/librte_hash/rte_hash_crc.h +21
-9return crc; } +#if defined(RTE_ARCH_I686 ) || defined(RTE_ARCH_X86_64 )static inline uint32_t crc32c_sse42_u32(uint32_t data, uint32_t init_val) { @@ -375,16 +377,6 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) }static inline uint32_t -crc32c_sse42_u64(uint64_t data, uint64_t init_val) -{ - __asm__volatile ( -"crc32q %[data], %[init_val];" - : [init_val]"+r" (init_val) - : [data]"rm" (data)); -return init_val; -} - -static inline uint32_t crc32c_sse42_u64_mimic (uint64_t data,uint64_t init_val) { union {@@ -397,6 +389,40 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) init_val =crc32c_sse42_u32 (d.u32[1 ], init_val);return init_val; } +#else +static inline uint32_t +crc32c_sse42_u32(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) +{ +return 0 ; +} + +static inline uint32_t +crc32c_sse42_u64_mimic(__rte_unused uint32_t data, + __rte_unused uint32_t init_val) { +return 0 ; +} +#endif + +#ifdef RTE_ARCH_X86_64 +static inline uint32_t +crc32c_sse42_u64 (uint64_t data,uint64_t init_val) { + __asm__ volatile(
lib/librte_hash/rte_hash_crc.h crc32c_sse42_u64_mimic(uint64_t data, uint64_t · line 421
Quoted 10 lines
lib/librte_hash/rte_hash_crc.h +10
-0+"crc32q %[data], %[init_val];" + : [init_val] "+r" (init_val) + : [data] "rm" (data)); +return init_val; +} +#else +static inline uint32_t +crc32c_sse42_u64(__rte_unused uint64_t data, + __rte_unused uint64_t init_val) +{
return crc32c_2words(data, init_val);
Quoted 8 lines
lib/librte_hash/rte_hash_crc.h +3
-1+ return 0; +} +#endif #define CRC32_SW (1U << 0)#define CRC32_SSE42 (1U << 1) --1.9.3
PATCH 2/3 app/test: Fix size_t printf formart issue
In reply to a message not in the archivetest_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]
According to C99, for size_t type should use formart "%zu"
--- app/test/test_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_hash.c +1 -1
@@ -226,7 +226,7 @@ test_crc32_hash_alg_equiv(void)if (i ==CRC32_ITERATIONS )return 0 ; -printf ("Failed test data (hex, %lu bytes total):\n" , data_len); +printf ("Failed test data (hex, %zu bytes total):\n" , data_len);for (j =0 ; j < data_len; j++)printf ("%02X%c" , ((uint8_t *)data64)[j], ((j+1 ) %16 ==0 || j == data_len -1 ) ?'\n' :' ' );
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425561339-13300-3-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Bruce Richardson
Acked-byRe: [PATCH 2/3] app/test: Fix size_t printf formart issue
Quoted 7 lines · Michael Qiu
test_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]According to C99, for
size_ttype should use formart "%zu"Signed-off-by Michael Qiu <[email protected]>
Typo in title. Otherwise
Quoted 20 lines
--- app/test/test_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test/test_hash.c +1
-1@@ -226,7 +226,7 @@ test_crc32_hash_alg_equiv(void)if (i ==CRC32_ITERATIONS )return 0 ; -printf ("Failed test data (hex, %lu bytes total):\n" , data_len); +printf ("Failed test data (hex, %zu bytes total):\n" , data_len);for (j =0 ; j < data_len; j++)printf ("%02X%c" , ((uint8_t *)data64)[j], ((j+1 ) %16 ==0 || j == data_len -1 ) ?'\n' :' ' );Signature · 1 line
1.9.3
PATCH v2 2/3 app/test: Fix size_t printf format issue
In reply to a message not in the archivetest_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]
According to C99, for size_t type should use format "%zu"
---
v2 --> v1:
typo fix of "format" in commit log and title
app/test/test_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_hash.c +1 -1
@@ -226,7 +226,7 @@ test_crc32_hash_alg_equiv(void)if (i ==CRC32_ITERATIONS )return 0 ; -printf ("Failed test data (hex, %lu bytes total):\n" , data_len); +printf ("Failed test data (hex, %zu bytes total):\n" , data_len);for (j =0 ; j < data_len; j++)printf ("%02X%c" , ((uint8_t *)data64)[j], ((j+1 ) %16 ==0 || j == data_len -1 ) ?'\n' :' ' );
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425564054-13883-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Re: [PATCH 2/3 v2] app/test: Fix size_t printf format issue
2015-03-05 22:00, Michael Qiu:
Quoted 7 lines
test_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]According to C99, for
size_ttype should use format "%zu"Signed-off-by Michael Qiu <[email protected]>
You forgot to add the previous acknowledgement from Bruce.
Re: [PATCH 2/3 v2] app/test: Fix size_t printf format issue
Quoted 11 lines · Thomas Monjalon
2015-03-05 22:00, Michael Qiu:
Quoted 7 lines
test_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]According to C99, for
size_ttype should use format "%zu"Signed-off-by Michael Qiu <[email protected]>You forgot to add the previous acknowledgement from Bruce.
OK, I will send out v3 to add previous acknowledgement from Bruce.
Thanks,
Michael
PATCH v3 2/3 app/test: Fix size_t printf format issue
In reply to a message not in the archivetest_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Werror=format]
According to C99, for size_t type should use format "%zu"
---
v3 --> v2:
add acked-by field
v2 --> v1:
typo fix of "format" in commit log and title
app/test/test_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_hash.c +1 -1
@@ -226,7 +226,7 @@ test_crc32_hash_alg_equiv(void)if (i ==CRC32_ITERATIONS )return 0 ; -printf ("Failed test data (hex, %lu bytes total):\n" , data_len); +printf ("Failed test data (hex, %zu bytes total):\n" , data_len);for (j =0 ; j < data_len; j++)printf ("%02X%c" , ((uint8_t *)data64)[j], ((j+1 ) %16 ==0 || j == data_len -1 ) ?'\n' :' ' );
Signature · 1 line
1.9.3
PATCH 3/3 librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
In reply to a message not in the archiveinclude/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from /usr/include/signal.h:358:0,
from /usr/include/sys/wait.h:30,
from /root/dpdk/app/test/test_mp_secondary.c:50:/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
In i686, from REG_EAX to REG_EDX are all defined in
/usr/include/sys/ucontext.h
Rename to CPU_REG_EAX to avoid this issue.
--- .../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105 -105
@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +CPU_REG_EAX =0 , +CPU_REG_EBX , +CPU_REG_ECX , +CPU_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, CPU_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, CPU_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, CPU_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, CPU_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, CPU_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, CPU_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, CPU_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, CPU_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, CPU_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, CPU_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, CPU_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, CPU_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, CPU_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, CPU_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, CPU_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, CPU_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, CPU_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, CPU_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, CPU_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, CPU_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, CPU_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, CPU_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, CPU_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, CPU_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, CPU_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, CPU_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, CPU_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, CPU_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, CPU_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, CPU_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, CPU_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, CPU_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, CPU_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, CPU_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, CPU_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, CPU_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, CPU_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, CPU_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, CPU_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, CPU_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, CPU_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, CPU_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, CPU_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, CPU_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, CPU_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, CPU_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, CPU_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, CPU_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, CPU_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, CPU_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, CPU_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, CPU_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, CPU_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, CPU_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, CPU_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, CPU_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, CPU_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, CPU_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, CPU_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, CPU_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, CPU_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, CPU_REG_ECX, 1) + FEAT_DEF(ENERGY_EFF, 0x00000006, 0, CPU_REG_ECX, 3) + + FEAT_DEF(FSGSBASE, 0x00000007, 0, CPU_REG_EBX, 0) + FEAT_DEF(BMI1, 0x00000007, 0, CPU_REG_EBX, 2) + FEAT_DEF(HLE, 0x00000007, 0, CPU_REG_EBX, 4) + FEAT_DEF(AVX2, 0x00000007, 0, CPU_REG_EBX, 5) + FEAT_DEF(SMEP, 0x00000007, 0, CPU_REG_EBX, 6) + FEAT_DEF(BMI2, 0x00000007, 0, CPU_REG_EBX, 7) + FEAT_DEF(ERMS, 0x00000007, 0, CPU_REG_EBX, 8) + FEAT_DEF(INVPCID, 0x00000007, 0, CPU_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, CPU_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, CPU_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, CPU_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, CPU_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,CPU_REG_EDX ,8 ) }; static inline void
@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[CPU_REG_EBX ]), +"=a" (out[CPU_REG_EAX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[CPU_REG_EAX ]), +"=b" (out[CPU_REG_EBX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif
@@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[CPU_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[CPU_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425561339-13300-4-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Re: [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 10 lines · Michael Qiu
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hRename to
CPU_REG_EAXto avoid this issue.
RTE_ prefix for consistency with other public DPDK symbols perhaps?
/Bruce
Quoted 251 lines
Signed-off-by Michael Qou <[email protected]>--- .../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105
-105@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +CPU_REG_EAX =0 , +CPU_REG_EBX , +CPU_REG_ECX , +CPU_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, CPU_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, CPU_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, CPU_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, CPU_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, CPU_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, CPU_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, CPU_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, CPU_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, CPU_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, CPU_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, CPU_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, CPU_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, CPU_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, CPU_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, CPU_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, CPU_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, CPU_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, CPU_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, CPU_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, CPU_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, CPU_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, CPU_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, CPU_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, CPU_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, CPU_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, CPU_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, CPU_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, CPU_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, CPU_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, CPU_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, CPU_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, CPU_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, CPU_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, CPU_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, CPU_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, CPU_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, CPU_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, CPU_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, CPU_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, CPU_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, CPU_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, CPU_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, CPU_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, CPU_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, CPU_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, CPU_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, CPU_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, CPU_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, CPU_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, CPU_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, CPU_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, CPU_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, CPU_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, CPU_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, CPU_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, CPU_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, CPU_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, CPU_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, CPU_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, CPU_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, CPU_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, CPU_REG_ECX, 1) + FEAT_DEF(ENERGY_EFF, 0x00000006, 0, CPU_REG_ECX, 3) + + FEAT_DEF(FSGSBASE, 0x00000007, 0, CPU_REG_EBX, 0) + FEAT_DEF(BMI1, 0x00000007, 0, CPU_REG_EBX, 2) + FEAT_DEF(HLE, 0x00000007, 0, CPU_REG_EBX, 4) + FEAT_DEF(AVX2, 0x00000007, 0, CPU_REG_EBX, 5) + FEAT_DEF(SMEP, 0x00000007, 0, CPU_REG_EBX, 6) + FEAT_DEF(BMI2, 0x00000007, 0, CPU_REG_EBX, 7) + FEAT_DEF(ERMS, 0x00000007, 0, CPU_REG_EBX, 8) + FEAT_DEF(INVPCID, 0x00000007, 0, CPU_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, CPU_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, CPU_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, CPU_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, CPU_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,CPU_REG_EDX ,8 ) }; static inline void@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[CPU_REG_EBX ]), +"=a" (out[CPU_REG_EAX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[CPU_REG_EAX ]), +"=b" (out[CPU_REG_EBX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif @@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[CPU_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[CPU_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */ Signature · 1 line
1.9.3
Re: [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
On Thu, Mar 5, 2015 at 2:23 PM, Bruce Richardson <[email protected]
Quoted 14 lines
wrote:
Quoted 1 line · Michael Qiu
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator‘REG_EAX’
Quoted 4 lines
In file included from
/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of‘REG_EAX’ was here
Quoted 3 lines
In i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.h
Well, this is the same for x86_64.
$ grep -rl '\<REG_EAX\>' /usr/include/ /usr/include/x86_64-linux-gnu/sys/ucontext.h
$ ls -l /usr/include/sys/ucontext.h lrwxrwxrwx 1 root root 34 Feb 22 12:45 /usr/include/sys/ucontext.h -> ../x86_64-linux-gnu/sys/ucontext.h
So I am not sure I understand why we redefine stuff already available from the toolchain.
Rather than prefixing, I think we should get rid of this and include the right header.
Signature · 1 line
David Marchand
Re: [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 12 lines · David Marchand
On Thu, Mar 5, 2015 at 2:23 PM, Bruce Richardson
<[email protected] <mailto:[email protected]>> wrote:On Thu, Mar 05, 2015 at 09:15:39PM +0800, Michael Qiu wrote:
>include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’
> In file included from/usr/include/signal.h:358:0,
> from/usr/include/sys/wait.h:30,
> from/root/dpdk/app/test/test_mp_secondary.c:50:
>/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
>
Quoted 5 lines
> In i686, from
REG_EAXtoREG_EDXare all defined in
>/usr/include/sys/ucontext.hWell, this is the same for
x86_64.
Yes, but for some reason, it was not include, see /usr/include/signal.h:358
# include <bits/sigstack.h> # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include <sys/ucontext.h> # endif
So only if __USE_XOPEN or __USE_XOPEN2K8 been defined will include <sys/ucontext.h>
Thanks,
Michael
Quoted 16 lines
$ grep -rl '\<REG_EAX\>' /usr/include/ /usr/include/x86_64-linux-gnu/sys/ucontext.h$ ls -l /usr/include/sys/ucontext.h lrwxrwxrwx 1 root root 34 Feb 22 12:45 /usr/include/sys/ucontext.h -> ../x86_64-linux-gnu/sys/ucontext.hSo I am not sure I understand why we redefine stuff already available from the toolchain.
Rather than prefixing, I think we should get rid of this and include the right header.Signature · 1 line
David Marchand
Re: [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
In reply to Bruce RichardsonQuoted 7 lines · Bruce
Quoted 6 lines · Michael Qiu
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
Quoted 5 lines
Quoted 4 lines
In i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hRename to
CPU_REG_EAXto avoid this issue.
RTE_prefix for consistency with other public DPDK symbols perhaps?
Hi, Bruce
Yes, agree.
I will send out v2 now.
Thanks,
Michael
Quoted 252 lines
/Bruce
Quoted 250 lines
Signed-off-by Michael Qou <[email protected]>--- .../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105
-105@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +CPU_REG_EAX =0 , +CPU_REG_EBX , +CPU_REG_ECX , +CPU_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, CPU_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, CPU_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, CPU_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, CPU_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, CPU_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, CPU_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, CPU_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, CPU_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, CPU_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, CPU_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, CPU_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, CPU_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, CPU_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, CPU_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, CPU_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, CPU_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, CPU_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, CPU_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, CPU_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, CPU_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, CPU_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, CPU_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, CPU_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, CPU_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, CPU_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, CPU_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, CPU_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, CPU_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, CPU_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, CPU_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, CPU_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, CPU_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, CPU_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, CPU_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, CPU_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, CPU_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, CPU_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, CPU_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, CPU_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, CPU_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, CPU_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, CPU_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, CPU_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, CPU_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, CPU_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, CPU_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, CPU_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, CPU_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, CPU_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, CPU_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, CPU_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, CPU_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, CPU_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, CPU_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, CPU_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, CPU_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, CPU_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, CPU_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, CPU_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, CPU_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, CPU_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, CPU_REG_ECX, 1) + FEAT_DEF(ENERGY_EFF, 0x00000006, 0, CPU_REG_ECX, 3) + + FEAT_DEF(FSGSBASE, 0x00000007, 0, CPU_REG_EBX, 0) + FEAT_DEF(BMI1, 0x00000007, 0, CPU_REG_EBX, 2) + FEAT_DEF(HLE, 0x00000007, 0, CPU_REG_EBX, 4) + FEAT_DEF(AVX2, 0x00000007, 0, CPU_REG_EBX, 5) + FEAT_DEF(SMEP, 0x00000007, 0, CPU_REG_EBX, 6) + FEAT_DEF(BMI2, 0x00000007, 0, CPU_REG_EBX, 7) + FEAT_DEF(ERMS, 0x00000007, 0, CPU_REG_EBX, 8) + FEAT_DEF(INVPCID, 0x00000007, 0, CPU_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, CPU_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, CPU_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, CPU_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, CPU_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,CPU_REG_EDX ,8 ) }; static inline void@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[CPU_REG_EBX ]), +"=a" (out[CPU_REG_EAX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[CPU_REG_EAX ]), +"=b" (out[CPU_REG_EBX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif @@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[CPU_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[CPU_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */ Signature · 1 line
1.9.3
PATCH v2 3/3 =?UTF-8?q?librte=5Feal/common:=20Fix=20redeclaration=20of?= =?UTF-8?q?=20enumerator=20=E2=80=98REG=5FEAX=E2=80=99?=
In reply to a message not in the archiveinclude/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from /usr/include/signal.h:358:0,
from /usr/include/sys/wait.h:30,
from /root/dpdk/app/test/test_mp_secondary.c:50:/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
In i686, from REG_EAX to REG_EDX are all defined in
/usr/include/sys/ucontext.h
Rename to CPU_REG_EAX to avoid this issue.
---
v2 --> v1:
rename CPU_REG_EAX to RTE_REG_EAX
.../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105 -105
@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +RTE_REG_EAX =0 , +RTE_REG_EBX , +RTE_REG_ECX , +RTE_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, RTE_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, RTE_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, RTE_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, RTE_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, RTE_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, RTE_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, RTE_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, RTE_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, RTE_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, RTE_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, RTE_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, RTE_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, RTE_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, RTE_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, RTE_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, RTE_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, RTE_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, RTE_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, RTE_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, RTE_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, RTE_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, RTE_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, RTE_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, RTE_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, RTE_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, RTE_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, RTE_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, RTE_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, RTE_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, RTE_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, RTE_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, RTE_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, RTE_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, RTE_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, RTE_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, RTE_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, RTE_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, RTE_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, RTE_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, RTE_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, RTE_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, RTE_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, RTE_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, RTE_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, RTE_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, RTE_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, RTE_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, RTE_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, RTE_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, RTE_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, RTE_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, RTE_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, RTE_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, RTE_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, RTE_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, RTE_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, RTE_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, RTE_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, RTE_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, RTE_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, RTE_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, RTE_REG_ECX, 1) + 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(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(INVPCID, 0x00000007, 0, RTE_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, RTE_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,RTE_REG_EDX ,8 ) }; static inline void
@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[RTE_REG_EBX ]), +"=a" (out[RTE_REG_EAX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[RTE_REG_EAX ]), +"=b" (out[RTE_REG_EBX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif
@@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[RTE_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[RTE_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425563425-13647-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
David Marchand
NAKRe: [PATCH 3/3 v2] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 7 lines · Michael Qiu
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
Quoted 7 lines
In i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hRename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]>
NAK.
You did not answer my question.
This mail title is broken anyway.
Signature · 1 line
David Marchand
Re: [PATCH 3/3 v2] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 14 lines · David Marchand
On Thu, Mar 5, 2015 at 2:50 PM, Michael Qiu <[email protected] <mailto:[email protected]>> wrote:
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’
In file included from/usr/include/signal.h:358:0,
from/usr/include/sys/wait.h:30,
from/root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.h
Quoted 8 lines
Rename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]<mailto:[email protected]>>
NAK.
I have answered in you last thread, please check the mail.
Yes, but for some reason, it was not include, see /usr/include/signal.h:358
# include <bits/sigstack.h> # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include <sys/ucontext.h> # endif
So only if __USE_XOPEN or __USE_XOPEN2K8 been defined will include <sys/ucontext.h>
Why NAK?
Thanks,
Michael
Quoted 6 lines
You did not answer my question.
This mail title is broken anyway.Signature · 1 line
David Marchand
A message that is not in the archive (sent off-list or not yet received): 533710CFB86FA344BFBF2D6802E60286CEEF6B-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org
Re: [PATCH 3/3 v2] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
2015-03-05 14:03, Qiu, Michael:
Quoted 28 lines · David Marchand
Quoted 14 lines
On Thu, Mar 5, 2015 at 2:50 PM, Michael Qiu <[email protected] <mailto:[email protected]>> wrote:
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’
In file included from/usr/include/signal.h:358:0,
from/usr/include/sys/wait.h:30,
from/root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hQuoted 8 lines
Rename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]<mailto:[email protected]>>
NAK.
I have answered in you last thread, please check the mail.
Yes, but for some reason, it was not include, see
/usr/include/signal.h:358
Quoted 8 lines
# include <bits/sigstack.h> # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include <sys/ucontext.h> # endifSo only if
__USE_XOPENor__USE_XOPEN2K8been defined will include <sys/ucontext.h>
So try to define USE_XOPEN.
Quoted 1 line
Why NAK?
Because it seems you didn't really try to include system headers. We must avoid redefine existing symbols. That's why this bug happens. Michael, thanks for trying to fix this issue. It's appreciated even if the first solution is refused.
Re: [PATCH 3/3 v2] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 34 lines · Thomas Monjalon
2015-03-05 14:03, Qiu, Michael:
Quoted 33 lines · David Marchand
Quoted 14 lines
On Thu, Mar 5, 2015 at 2:50 PM, Michael Qiu <[email protected] <mailto:[email protected]>> wrote:
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’
In file included from/usr/include/signal.h:358:0,
from/usr/include/sys/wait.h:30,
from/root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hQuoted 8 lines
Rename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]<mailto:[email protected]>>
NAK.
I have answered in you last thread, please check the mail.
Yes, but for some reason, it was not include, see
/usr/include/signal.h:358# include <bits/sigstack.h> # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include <sys/ucontext.h> # endif
Quoted 6 lines
Quoted 2 lines
So only if
__USE_XOPENor__USE_XOPEN2K8been defined will include <sys/ucontext.h>So try to define
USE_XOPEN.Quoted 1 line
Why NAK?
Because it seems you didn't really try to include system headers.
See below(ucontext.h:25):
#ifdef __x86_64__
...
#ifdef __USE_GNU
enmu{
...
REG_RBX,
# define REG_RBX REG_RBX
REG_RDX,
# define REG_RDX REG_RDX
REG_RAX,
# define REG_RAX REG_RAX
REG_RCX,
# define REG_RCX REG_RCX
...
};
#endif
...
#else /* !__x86_64__ */
...
#ifdef __USE_GNU
enmu{
...
REG_EBX,
# define REG_EBX REG_EBX
REG_EDX,
# define REG_EDX REG_EDX
REG_ECX,
# define REG_ECX REG_ECX
REG_EAX,
# define REG_EAX REG_EAX
...
};
#endif
...
#endif /* !__x86_64__ */For none x86_64 platform will be defined as REG_E*X, but x86_64 will be REG_R*X.
This is why only happens in i686 platform.
Does this clear?
Thanks,
Michael
Quoted 5 lines
We must avoid redefine existing symbols. That's why this bug happens. Michael, thanks for trying to fix this issue. It's appreciated even if the first solution is refused.
A message that is not in the archive (sent off-list or not yet received): 533710CFB86FA344BFBF2D6802E60286CEF29E-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org
Re: [PATCH 3/3 v2] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
2015-03-05 16:31, Qiu, Michael:
Quoted 80 lines · Thomas Monjalon
Quoted 34 lines
2015-03-05 14:03, Qiu, Michael:
Quoted 33 lines · David Marchand
Quoted 14 lines
On Thu, Mar 5, 2015 at 2:50 PM, Michael Qiu <[email protected] <mailto:[email protected]>> wrote:
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’
In file included from/usr/include/signal.h:358:0,
from/usr/include/sys/wait.h:30,
from/root/dpdk/app/test/test_mp_secondary.c:50:
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hQuoted 8 lines
Rename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]<mailto:[email protected]>>
NAK.
I have answered in you last thread, please check the mail.
Yes, but for some reason, it was not include, see
/usr/include/signal.h:358# include <bits/sigstack.h> # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include <sys/ucontext.h> # endifQuoted 6 lines
Quoted 2 lines
So only if
__USE_XOPENor__USE_XOPEN2K8been defined will include <sys/ucontext.h>So try to define
USE_XOPEN.Quoted 1 line
Why NAK?
Because it seems you didn't really try to include system headers.
See below(ucontext.h:25):
#ifdef__x86_64__
...
#ifdef__USE_GNUenmu{ ... REG_RBX, # define REG_RBX REG_RBX REG_RDX, # define REG_RDX REG_RDX REG_RAX, # define REG_RAX REG_RAX REG_RCX, # define REG_RCX REG_RCX ... }; #endif ... #else /* !__x86_64__ */ ... #ifdef __USE_GNU enmu{ ... REG_EBX, # define REG_EBX REG_EBX REG_EDX, # define REG_EDX REG_EDX REG_ECX, # define REG_ECX REG_ECX REG_EAX, # define REG_EAX REG_EAX ... }; #endif ... #endif /* !__x86_64__ */
Quoted 6 lines
For none
x86_64platform will be defined as REG_E*X, butx86_64will be REG_R*X.This is why only happens in i686 platform.
Does this clear?
OK thanks.
So it is not possible to use this system header.
It seems your patch is a good approach.
PATCH v3 3/3 =?UTF-8?q?librte=5Feal/common:=20Fix=20redeclaration=20of?= =?UTF-8?q?=20enumerator=20=E2=80=98REG=5FEAX=E2=80=99?=
In reply to a message not in the archiveinclude/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from /usr/include/signal.h:358:0,
from /usr/include/sys/wait.h:30,
from /root/dpdk/app/test/test_mp_secondary.c:50:/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was here
In i686, from REG_EAX to REG_EDX are all defined in
/usr/include/sys/ucontext.h
Rename to CPU_REG_EAX to avoid this issue.
---
v3 --> v2:
Fix signed-off-by field
v2 --> v1:
rename CPU_REG_EAX to RTE_REG_EAX
.../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105 -105
@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +RTE_REG_EAX =0 , +RTE_REG_EBX , +RTE_REG_ECX , +RTE_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, RTE_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, RTE_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, RTE_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, RTE_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, RTE_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, RTE_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, RTE_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, RTE_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, RTE_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, RTE_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, RTE_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, RTE_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, RTE_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, RTE_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, RTE_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, RTE_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, RTE_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, RTE_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, RTE_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, RTE_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, RTE_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, RTE_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, RTE_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, RTE_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, RTE_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, RTE_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, RTE_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, RTE_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, RTE_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, RTE_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, RTE_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, RTE_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, RTE_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, RTE_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, RTE_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, RTE_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, RTE_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, RTE_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, RTE_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, RTE_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, RTE_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, RTE_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, RTE_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, RTE_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, RTE_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, RTE_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, RTE_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, RTE_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, RTE_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, RTE_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, RTE_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, RTE_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, RTE_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, RTE_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, RTE_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, RTE_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, RTE_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, RTE_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, RTE_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, RTE_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, RTE_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, RTE_REG_ECX, 1) + 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(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(INVPCID, 0x00000007, 0, RTE_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, RTE_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,RTE_REG_EDX ,8 ) }; static inline void
@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[RTE_REG_EBX ]), +"=a" (out[RTE_REG_EAX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[RTE_REG_EAX ]), +"=b" (out[RTE_REG_EBX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif
@@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[RTE_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[RTE_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1425563863-13712-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
David Marchand
Acked-byRe: [PATCH 3/3 v3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Quoted 4 lines · Michael Qiu
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
Quoted 8 lines
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hRename to
CPU_REG_EAXto avoid this issue.
Thomas,
- title must be fixed
- commit log must be fixed :CPU_REG_EAX -> RTE_REG_EAX
There is still some ambiguity in these macros names to me, but this is the quickest fix, so :
Signature · 1 line
David Marchand
Quoted 260 lines
Signed-off-by Michael Qiu <[email protected]>---
v3 --> v2:
Fix signed-off-by field
v2 --> v1:
renameCPU_REG_EAXtoRTE_REG_EAX.../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +103
-103@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +RTE_REG_EAX =0 , +RTE_REG_EBX , +RTE_REG_ECX , +RTE_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, RTE_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, RTE_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, RTE_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, RTE_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, RTE_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, RTE_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, RTE_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, RTE_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, RTE_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, RTE_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, RTE_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, RTE_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, RTE_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, RTE_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, RTE_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, RTE_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, RTE_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, RTE_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, RTE_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, RTE_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, RTE_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, RTE_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, RTE_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, RTE_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, RTE_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, RTE_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, RTE_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, RTE_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, RTE_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, RTE_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, RTE_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, RTE_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, RTE_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, RTE_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, RTE_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, RTE_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, RTE_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, RTE_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, RTE_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, RTE_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, RTE_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, RTE_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, RTE_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, RTE_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, RTE_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, RTE_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, RTE_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, RTE_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, RTE_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, RTE_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, RTE_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, RTE_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, RTE_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, RTE_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, RTE_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, RTE_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, RTE_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, RTE_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, RTE_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, RTE_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, RTE_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, RTE_REG_ECX, 1) + 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(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(INVPCID, 0x00000007, 0, RTE_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, RTE_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,RTE_REG_EDX ,8 ) }; static inline void@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[RTE_REG_EBX ]), +"=a" (out[RTE_REG_EAX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[RTE_REG_EAX ]), +"=b" (out[RTE_REG_EBX ]), +"=c" (out[RTE_REG_ECX ]), +"=d" (out[RTE_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2
-3@@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[RTE_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[RTE_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */ --1.9.3
Re: [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
In reply to Michael QiuQuoted 4 lines · Michael
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’ In file included from/usr/include/signal.h:358:0,from /usr/include/sys/wait.h:30, from /root/dpdk/app/test/test_mp_secondary.c:50:
Quoted 8 lines
/usr/include/sys/ucontext.h:180:3: note: previous definition of ‘REG_EAX’ was hereIn i686, from
REG_EAXtoREG_EDXare all defined in
/usr/include/sys/ucontext.hRename to
CPU_REG_EAXto avoid this issue.Signed-off-by Michael Qou <[email protected]>
Sorry, Michael Qou--> Michael Qiu
Thanks,
Michael
Quoted 246 lines
--- .../common/include/arch/x86/rte_cpuflags.h | 210 ++++++++++----------- 1 file changed, 105 insertions(+), 105 deletions(-)lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +105
-105@@ -151,104 +151,104 @@ enum rte_cpu_flag_t { };enum cpu_register_t { -REG_EAX =0 , -REG_EBX , -REG_ECX , -REG_EDX , +CPU_REG_EAX =0 , +CPU_REG_EBX , +CPU_REG_ECX , +CPU_REG_EDX , };static const struct feature_entry cpu_feature_table[] = { - FEAT_DEF(SSE3, 0x00000001, 0, REG_ECX, 0) - FEAT_DEF(PCLMULQDQ, 0x00000001, 0, REG_ECX, 1) - FEAT_DEF(DTES64, 0x00000001, 0, REG_ECX, 2) - FEAT_DEF(MONITOR, 0x00000001, 0, REG_ECX, 3) - FEAT_DEF(DS_CPL, 0x00000001, 0, REG_ECX, 4) - FEAT_DEF(VMX, 0x00000001, 0, REG_ECX, 5) - FEAT_DEF(SMX, 0x00000001, 0, REG_ECX, 6) - FEAT_DEF(EIST, 0x00000001, 0, REG_ECX, 7) - FEAT_DEF(TM2, 0x00000001, 0, REG_ECX, 8) - FEAT_DEF(SSSE3, 0x00000001, 0, REG_ECX, 9) - FEAT_DEF(CNXT_ID, 0x00000001, 0, REG_ECX, 10) - FEAT_DEF(FMA, 0x00000001, 0, REG_ECX, 12) - FEAT_DEF(CMPXCHG16B, 0x00000001, 0, REG_ECX, 13) - FEAT_DEF(XTPR, 0x00000001, 0, REG_ECX, 14) - FEAT_DEF(PDCM, 0x00000001, 0, REG_ECX, 15) - FEAT_DEF(PCID, 0x00000001, 0, REG_ECX, 17) - FEAT_DEF(DCA, 0x00000001, 0, REG_ECX, 18) - FEAT_DEF(SSE4_1, 0x00000001, 0, REG_ECX, 19) - FEAT_DEF(SSE4_2, 0x00000001, 0, REG_ECX, 20) - FEAT_DEF(X2APIC, 0x00000001, 0, REG_ECX, 21) - FEAT_DEF(MOVBE, 0x00000001, 0, REG_ECX, 22) - FEAT_DEF(POPCNT, 0x00000001, 0, REG_ECX, 23) - FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, REG_ECX, 24) - FEAT_DEF(AES, 0x00000001, 0, REG_ECX, 25) - FEAT_DEF(XSAVE, 0x00000001, 0, REG_ECX, 26) - FEAT_DEF(OSXSAVE, 0x00000001, 0, REG_ECX, 27) - FEAT_DEF(AVX, 0x00000001, 0, REG_ECX, 28) - FEAT_DEF(F16C, 0x00000001, 0, REG_ECX, 29) - FEAT_DEF(RDRAND, 0x00000001, 0, REG_ECX, 30) - - FEAT_DEF(FPU, 0x00000001, 0, REG_EDX, 0) - FEAT_DEF(VME, 0x00000001, 0, REG_EDX, 1) - FEAT_DEF(DE, 0x00000001, 0, REG_EDX, 2) - FEAT_DEF(PSE, 0x00000001, 0, REG_EDX, 3) - FEAT_DEF(TSC, 0x00000001, 0, REG_EDX, 4) - FEAT_DEF(MSR, 0x00000001, 0, REG_EDX, 5) - FEAT_DEF(PAE, 0x00000001, 0, REG_EDX, 6) - FEAT_DEF(MCE, 0x00000001, 0, REG_EDX, 7) - FEAT_DEF(CX8, 0x00000001, 0, REG_EDX, 8) - FEAT_DEF(APIC, 0x00000001, 0, REG_EDX, 9) - FEAT_DEF(SEP, 0x00000001, 0, REG_EDX, 11) - FEAT_DEF(MTRR, 0x00000001, 0, REG_EDX, 12) - FEAT_DEF(PGE, 0x00000001, 0, REG_EDX, 13) - FEAT_DEF(MCA, 0x00000001, 0, REG_EDX, 14) - FEAT_DEF(CMOV, 0x00000001, 0, REG_EDX, 15) - FEAT_DEF(PAT, 0x00000001, 0, REG_EDX, 16) - FEAT_DEF(PSE36, 0x00000001, 0, REG_EDX, 17) - FEAT_DEF(PSN, 0x00000001, 0, REG_EDX, 18) - FEAT_DEF(CLFSH, 0x00000001, 0, REG_EDX, 19) - FEAT_DEF(DS, 0x00000001, 0, REG_EDX, 21) - FEAT_DEF(ACPI, 0x00000001, 0, REG_EDX, 22) - FEAT_DEF(MMX, 0x00000001, 0, REG_EDX, 23) - FEAT_DEF(FXSR, 0x00000001, 0, REG_EDX, 24) - FEAT_DEF(SSE, 0x00000001, 0, REG_EDX, 25) - FEAT_DEF(SSE2, 0x00000001, 0, REG_EDX, 26) - FEAT_DEF(SS, 0x00000001, 0, REG_EDX, 27) - FEAT_DEF(HTT, 0x00000001, 0, REG_EDX, 28) - FEAT_DEF(TM, 0x00000001, 0, REG_EDX, 29) - FEAT_DEF(PBE, 0x00000001, 0, REG_EDX, 31) - - FEAT_DEF(DIGTEMP, 0x00000006, 0, REG_EAX, 0) - FEAT_DEF(TRBOBST, 0x00000006, 0, REG_EAX, 1) - FEAT_DEF(ARAT, 0x00000006, 0, REG_EAX, 2) - FEAT_DEF(PLN, 0x00000006, 0, REG_EAX, 4) - FEAT_DEF(ECMD, 0x00000006, 0, REG_EAX, 5) - FEAT_DEF(PTM, 0x00000006, 0, REG_EAX, 6) - - FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, REG_ECX, 0) - FEAT_DEF(ACNT2, 0x00000006, 0, REG_ECX, 1) - FEAT_DEF(ENERGY_EFF, 0x00000006, 0, REG_ECX, 3) - - FEAT_DEF(FSGSBASE, 0x00000007, 0, REG_EBX, 0) - FEAT_DEF(BMI1, 0x00000007, 0, REG_EBX, 2) - FEAT_DEF(HLE, 0x00000007, 0, REG_EBX, 4) - FEAT_DEF(AVX2, 0x00000007, 0, REG_EBX, 5) - FEAT_DEF(SMEP, 0x00000007, 0, REG_EBX, 6) - FEAT_DEF(BMI2, 0x00000007, 0, REG_EBX, 7) - FEAT_DEF(ERMS, 0x00000007, 0, REG_EBX, 8) - FEAT_DEF(INVPCID, 0x00000007, 0, REG_EBX, 10) - FEAT_DEF(RTM, 0x00000007, 0, REG_EBX, 11) - - FEAT_DEF(LAHF_SAHF, 0x80000001, 0, REG_ECX, 0) - FEAT_DEF(LZCNT, 0x80000001, 0, REG_ECX, 4) - - FEAT_DEF(SYSCALL, 0x80000001, 0, REG_EDX, 11) - FEAT_DEF(XD, 0x80000001, 0, REG_EDX, 20) - FEAT_DEF(1GB_PG, 0x80000001, 0, REG_EDX, 26) - FEAT_DEF(RDTSCP, 0x80000001, 0, REG_EDX, 27) - FEAT_DEF(EM64T, 0x80000001, 0, REG_EDX, 29) - -FEAT_DEF (INVTSC ,0x80000007 ,0 ,REG_EDX ,8 ) + FEAT_DEF(SSE3, 0x00000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, CPU_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, CPU_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, CPU_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, CPU_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, CPU_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, CPU_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, CPU_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, CPU_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, CPU_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, CPU_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, CPU_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, CPU_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, CPU_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, CPU_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, CPU_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, CPU_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, CPU_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, CPU_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, CPU_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, CPU_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, CPU_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, CPU_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, CPU_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, CPU_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, CPU_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, CPU_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, CPU_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, CPU_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, CPU_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, CPU_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, CPU_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, CPU_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, CPU_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, CPU_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, CPU_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, CPU_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, CPU_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, CPU_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, CPU_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, CPU_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, CPU_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, CPU_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, CPU_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, CPU_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, CPU_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, CPU_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, CPU_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, CPU_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, CPU_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, CPU_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, CPU_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, CPU_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, CPU_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, CPU_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, CPU_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, CPU_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, CPU_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, CPU_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, CPU_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, CPU_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, CPU_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, CPU_REG_ECX, 1) + FEAT_DEF(ENERGY_EFF, 0x00000006, 0, CPU_REG_ECX, 3) + + FEAT_DEF(FSGSBASE, 0x00000007, 0, CPU_REG_EBX, 0) + FEAT_DEF(BMI1, 0x00000007, 0, CPU_REG_EBX, 2) + FEAT_DEF(HLE, 0x00000007, 0, CPU_REG_EBX, 4) + FEAT_DEF(AVX2, 0x00000007, 0, CPU_REG_EBX, 5) + FEAT_DEF(SMEP, 0x00000007, 0, CPU_REG_EBX, 6) + FEAT_DEF(BMI2, 0x00000007, 0, CPU_REG_EBX, 7) + FEAT_DEF(ERMS, 0x00000007, 0, CPU_REG_EBX, 8) + FEAT_DEF(INVPCID, 0x00000007, 0, CPU_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, CPU_REG_EBX, 11) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, CPU_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, CPU_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, CPU_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, CPU_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, CPU_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, CPU_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, CPU_REG_EDX, 29) + +FEAT_DEF (INVTSC ,0x80000007 ,0 ,CPU_REG_EDX ,8 ) }; static inline void@@ -257,18 +257,18 @@ rte_cpu_get_features(uint32_t leaf, uint32_t subleaf, cpuid_registers_t out)#if defined(__i386__) && defined(__PIC__)/* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ asmvolatile ("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" - :"=r" (out[REG_EBX ]), -"=a" (out[REG_EAX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=r" (out[CPU_REG_EBX ]), +"=a" (out[CPU_REG_EAX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#else asmvolatile ("cpuid" - :"=a" (out[REG_EAX ]), -"=b" (out[REG_EBX ]), -"=c" (out[REG_ECX ]), -"=d" (out[REG_EDX ]) + :"=a" (out[CPU_REG_EAX ]), +"=b" (out[CPU_REG_EBX ]), +"=c" (out[CPU_REG_ECX ]), +"=d" (out[CPU_REG_EDX ]) :"a" (leaf),"c" (subleaf));#endif @@ -292,8 +292,8 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)return -EFAULT ;rte_cpu_get_features (feat->leaf &0xffff0000 ,0 , regs); -if (((regs[REG_EAX ] ^ feat->leaf) &0xffff0000 ) || - regs[REG_EAX ] < feat->leaf) +if (((regs[CPU_REG_EAX ] ^ feat->leaf) &0xffff0000 ) || + regs[CPU_REG_EAX ] < feat->leaf)return 0 ;/* get the cpuid leaf containing the desired feature */
2015-03-05 21:15, Michael Qiu:
Quoted 6 lines
This patch set is to fix dpdk2.0-rc1 compile error.
Michael Qiu (3):
librte_hash: Fix unsupported instruction `crc32' in i686 platform app/test: Fixsize_tprintf formart issue librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
v3 of each patch applied, thanks