[dpdk-dev] RTM instruction compile failure for XABORT when AVX is active

Message ID C0759555-9A77-4AE2-B00F-79C123C0606C@mhcomputing.net (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Matthew Hall July 1, 2015, 5:17 a.m. UTC
  To be a bit more specific, this is what I had to do to fix it for clang 3.6 SVN snapshot release.

I am not sure if there is a better way of handling this situation. I'd love to know where I could improve it.

Matthew.
  

Comments

Matthew Hall July 1, 2015, 5:49 a.m. UTC | #1
With those two items commented out, and these CFLAGS:

"-g -O0 -fPIC -msse4.2"

it looks like I can reproduce the issue in clang 2.6 series:

/vagrant/external/dpdk/build/include/rte_rtm.h:56:15: error: invalid operand for inline asm constraint 'i'
        asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");

So there are definitely some corner cases that seem to be able to trigger it.

On Jun 30, 2015, at 10:17 PM, Matthew Hall <mhall@mhcomputing.net> wrote:

> To be a bit more specific, this is what I had to do to fix it for clang 3.6 SVN snapshot release.
> 
> I am not sure if there is a better way of handling this situation. I'd love to know where I could improve it.
> 
> Matthew.
> 
> diff --git a/mk/rte.cpuflags.mk b/mk/rte.cpuflags.mk
> index f595cd0..8c883ee 100644
> --- a/mk/rte.cpuflags.mk
> +++ b/mk/rte.cpuflags.mk
> @@ -77,13 +77,13 @@ ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
> CPUFLAGS += RDRAND
> endif
> 
> -ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
> -CPUFLAGS += FSGSBASE
> -endif
> +#ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
> +#CPUFLAGS += FSGSBASE
> +#endif
> 
> -ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
> -CPUFLAGS += F16C
> -endif
> +#ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
> +#CPUFLAGS += F16C
> +#endif
> 
> ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
> CPUFLAGS += AVX2
  
Bruce Richardson July 1, 2015, 11:10 a.m. UTC | #2
On Tue, Jun 30, 2015 at 10:49:26PM -0700, Matthew Hall wrote:
> With those two items commented out, and these CFLAGS:
> 
> "-g -O0 -fPIC -msse4.2"
> 

The recommended way of specifying a particular instruction set is via the
RTE_MACHINE setting in your build time config. Can you perhaps reproduce the
issue using a setting there?

/Bruce

> it looks like I can reproduce the issue in clang 2.6 series:
> 
> /vagrant/external/dpdk/build/include/rte_rtm.h:56:15: error: invalid operand for inline asm constraint 'i'
>         asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
> 
> So there are definitely some corner cases that seem to be able to trigger it.
> 
> On Jun 30, 2015, at 10:17 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
> 
> > To be a bit more specific, this is what I had to do to fix it for clang 3.6 SVN snapshot release.
> > 
> > I am not sure if there is a better way of handling this situation. I'd love to know where I could improve it.
> > 
> > Matthew.
> > 
> > diff --git a/mk/rte.cpuflags.mk b/mk/rte.cpuflags.mk
> > index f595cd0..8c883ee 100644
> > --- a/mk/rte.cpuflags.mk
> > +++ b/mk/rte.cpuflags.mk
> > @@ -77,13 +77,13 @@ ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
> > CPUFLAGS += RDRAND
> > endif
> > 
> > -ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
> > -CPUFLAGS += FSGSBASE
> > -endif
> > +#ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
> > +#CPUFLAGS += FSGSBASE
> > +#endif
> > 
> > -ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
> > -CPUFLAGS += F16C
> > -endif
> > +#ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
> > +#CPUFLAGS += F16C
> > +#endif
> > 
> > ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
> > CPUFLAGS += AVX2
>
  
Matthew Hall July 1, 2015, 3:53 p.m. UTC | #3
Previously, with the -msse4.2 flag removed, the build failed for a different reason.

I can retry without it and see if it's the case in the new DPDK.

On Jul 1, 2015, at 4:10 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Tue, Jun 30, 2015 at 10:49:26PM -0700, Matthew Hall wrote:
>> With those two items commented out, and these CFLAGS:
>> 
>> "-g -O0 -fPIC -msse4.2"
>> 
> 
> The recommended way of specifying a particular instruction set is via the
> RTE_MACHINE setting in your build time config. Can you perhaps reproduce the
> issue using a setting there?
> 
> /Bruce
  

Patch

diff --git a/mk/rte.cpuflags.mk b/mk/rte.cpuflags.mk
index f595cd0..8c883ee 100644
--- a/mk/rte.cpuflags.mk
+++ b/mk/rte.cpuflags.mk
@@ -77,13 +77,13 @@  ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
 CPUFLAGS += RDRAND
 endif

-ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
-CPUFLAGS += FSGSBASE
-endif
+#ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
+#CPUFLAGS += FSGSBASE
+#endif

-ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
-CPUFLAGS += F16C
-endif
+#ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
+#CPUFLAGS += F16C
+#endif

 ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
 CPUFLAGS += AVX2