public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Dave Hansen <dave@sr71.net>
Cc: linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com,
	x86@kernel.org, fenghua.yu@intel.com, oleg@redhat.com,
	luto@amacapital.net
Subject: Re: [PATCH] x86, fpu: rename XCR0 access macro
Date: Sat, 25 Apr 2015 10:24:13 +0200	[thread overview]
Message-ID: <20150425082413.GC32099@pd.tnic> (raw)
In-Reply-To: <20150424230035.F66CA4BB@viggo.jf.intel.com>

On Fri, Apr 24, 2015 at 04:00:35PM -0700, Dave Hansen wrote:
> 
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> The SDM says that the xgetbv instruction:
> 
> 	Reads the contents of the extended control register (XCR)
> 	specified in the ECX register into registers EDX:EAX.
> 
> In other words, xgetbv(0) gets the thing that the SDM calls XCR0.
> We have a macro for that "0" and we call it
> XCR_XFEATURE_ENABLED_MASK.  That's a bit unfortunate because it
> is not a mask nor does the "0" have much to do with the features
> we have enabled.  It's an index if anything.
> 
> Rename the macro to what it means: "XCR0".
> 
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: x86@kernel.org
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> 
> ---
> 
>  b/arch/x86/crypto/camellia_aesni_avx2_glue.c |    2 +-
>  b/arch/x86/crypto/camellia_aesni_avx_glue.c  |    2 +-
>  b/arch/x86/crypto/cast5_avx_glue.c           |    2 +-
>  b/arch/x86/crypto/cast6_avx_glue.c           |    2 +-
>  b/arch/x86/crypto/serpent_avx2_glue.c        |    2 +-
>  b/arch/x86/crypto/serpent_avx_glue.c         |    2 +-
>  b/arch/x86/crypto/sha1_ssse3_glue.c          |    2 +-
>  b/arch/x86/crypto/sha256_ssse3_glue.c        |    2 +-
>  b/arch/x86/crypto/sha512_ssse3_glue.c        |    2 +-
>  b/arch/x86/crypto/twofish_avx_glue.c         |    2 +-
>  b/arch/x86/include/asm/xcr.h                 |    6 +++++-
>  b/arch/x86/kernel/xsave.c                    |    2 +-
>  b/arch/x86/kvm/x86.c                         |   16 ++++++++--------
>  b/arch/x86/power/cpu.c                       |    2 +-
>  14 files changed, 25 insertions(+), 21 deletions(-)

Applied, but...

> diff -puN arch/x86/include/asm/xcr.h~x86-fpu-rename-xcr0-macro arch/x86/include/asm/xcr.h
> --- a/arch/x86/include/asm/xcr.h~x86-fpu-rename-xcr0-macro	2015-04-24 15:55:10.456089437 -0700
> +++ b/arch/x86/include/asm/xcr.h	2015-04-24 15:55:10.483090655 -0700
> @@ -17,13 +17,17 @@
>  #ifndef _ASM_X86_XCR_H
>  #define _ASM_X86_XCR_H
>  
> -#define XCR_XFEATURE_ENABLED_MASK	0x00000000
> +#define XCR0	0x00000000

... changed that to a simple "0".

Btw, I can imagine this becoming a macro, i.e. XCR(num) later. I see
there already is the %ecx==1 call option of XGETBV which gives you the
optimization used by XSAVEOPT/XSAVES so it is all a matter of time. :)

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

      reply	other threads:[~2015-04-25  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 23:00 [PATCH] x86, fpu: rename XCR0 access macro Dave Hansen
2015-04-25  8:24 ` Borislav Petkov [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=20150425082413.GC32099@pd.tnic \
    --to=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave@sr71.net \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=oleg@redhat.com \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox