[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] fma4/avx under xen



>>> On 02.05.12 at 20:54, Jim Westfall <jwestfall@xxxxxxxxxxxxxxxx> wrote:
> The summary is that when gcc compiles something with -mfma4 it also 
> enables the use of the avx instruction set.  Since by default xen 
> disables avx it leads to invalid opcodes.

Not that I know of, at least not anymore in current -unstable.

> This ends up being kinda nasty with the multiarch glibc since its doing 
> stuff like
> 
> (HAS_FMA4 ? run_fma4_func() : (HAS_AVX ? run_avx_func() : run_func()))

The question is what (runtime) tests HAS_FMA includes. I know that
some glibc versions had a broken AVX check (which only checked for
the AVX feature flag, while the specification explicitly states that
a prerequisite check of the OSXSAVE feature flag is also necessary).

> run_fma4_func() can end up bombing out from the invalid opcode when run 
> under xen.
> 
> Its not clear to me if xen should be filtering fma4 as part of its avx 
> filter or if gcc should not assume avx support when compiling with 
> -mfma4.

-mfma4 implying AVX and OSXSAVE is quite okay afaict, so long as
the runtime checks are done correctly. Though (didn't check) from
my experience with other instruction set related -m options I would
really expect this to result in code using FMA4 instructions without
any runtime check. But perhaps your explanation above was just
a simplified version of what's really being done...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.