All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Baptiste Tredez <jean-baptiste.tredez@basystemes.fr>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] xsave/xrstor compilation error
Date: Fri, 25 Oct 2013 09:47:56 +0200	[thread overview]
Message-ID: <526A222C.7000804@basystemes.fr> (raw)
In-Reply-To: <5269583F.4080701@siemens.com>

On 24/10/2013 19:26, Jan Kiszka wrote :
> On 2013-10-24 17:40, Jan Kiszka wrote:
>> On 2013-10-24 16:48, Gilles Chanteperdrix wrote:
>>> On 10/24/2013 12:06 PM, Jan Kiszka wrote:
>>>> We
>>>> can, of course, replace the instructions with their obcodes (like the
>>>> kernel does), just makes the code more ugly.
>>> Jan, please do this, even if it makes the code more ugly, it makes sense
>>> for the 2.6.3 release to continue working with the tools it already
>>> supported. No question for -forge, but we try hard to keep ABI
>>> compatibility so that users can upgrade xenomai without even recompiling
>>> their application, it does not make sense to suddenly stop working with
>>> a toolchain which always worked before.
>> In fact, we already have legacy gas support: all these new instructions
>> are wrapped with CONFIG_AS_AVX, and only if that is set we use the new
>> assembler instructions. Given that this CONFIG has to be set based on
>> some test, something seems to go wrong in the kernel build over there.
>> But that's outside of the Xenomai scope. I'm currently trying to find
>> out if there was some related kernel issue back then.
> OK, something likely went wrong in my brain back then while I tried to
> make this build for all the combinations. I can't recall what those
> CONFIG_X86_64 tests were for. This should build and in theory also work:
>
> diff --git a/include/asm-x86/bits/pod.h b/include/asm-x86/bits/pod.h
> index a32575f..c6fbcee 100644
> --- a/include/asm-x86/bits/pod.h
> +++ b/include/asm-x86/bits/pod.h
> @@ -241,7 +241,7 @@ static inline void __save_i387(x86_fpustate *fpup)
>   {
>   #ifdef cpu_has_xsave
>   	if (cpu_has_xsave) {
> -#if defined(CONFIG_AS_AVX) || !defined CONFIG_X86_64
> +#if defined(CONFIG_AS_AVX)
>   		asm volatile("xsave" XSAVE_SUFFIX " %0"
>   			     : "=m" (fpup->xsave) : "a" (-1), "d" (-1)
>   			     : "memory");
> @@ -301,7 +301,7 @@ static inline void __restore_i387(x86_fpustate *fpup)
>   {
>   #ifdef cpu_has_xsave
>   	if (cpu_has_xsave) {
> -#if defined(CONFIG_AS_AVX) || !defined(CONFIG_X86_64)
> +#if defined(CONFIG_AS_AVX)
>   		asm volatile("xrstor" XSAVE_SUFFIX " %0"
>   			     : : "m" (fpup->xsave), "a" (-1), "d" (-1)
>   			     : "memory");
>
> Jean-Baptiste, do you happen to have an xsave-capable box at hand to
> test this (/proc/cpuinfo shows the available features)? Xenomai's
> switchtest will stress the code.
>
> Thanks,
> Jan
>

No, I do not have an xsave-capable box (no xsave or avx flag, only fxsr).
This patch works fine here.

Jean-Baptiste


      reply	other threads:[~2013-10-25  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  8:40 [Xenomai] xsave/xrstor compilation error Jean-Baptiste Tredez
2013-10-24 10:06 ` Jan Kiszka
2013-10-24 15:48   ` Gilles Chanteperdrix
2013-10-24 16:40     ` Jan Kiszka
2013-10-24 17:26       ` Jan Kiszka
2013-10-25  7:47         ` Jean-Baptiste Tredez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526A222C.7000804@basystemes.fr \
    --to=jean-baptiste.tredez@basystemes.fr \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.