All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: linux-tip-commits@vger.kernel.org, torvalds@linux-foundation.org,
	hpa@zytor.com, dave.hansen@linux.intel.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	peterz@infradead.org, fenghua.yu@intel.com, brgerst@gmail.com,
	dvlasenk@redhat.com, tglx@linutronix.de,
	tim.c.chen@linux.intel.com, luto@amacapital.net
Subject: Re: [tip:x86/fpu] x86/fpu: Rename XSAVE macros
Date: Wed, 23 Sep 2015 12:49:01 +0200	[thread overview]
Message-ID: <20150923104901.GA3538@pd.tnic> (raw)
In-Reply-To: <tip-d91cab78133d33b1dfd3d3fa7167fcbf74fb5f99@git.kernel.org>

On Mon, Sep 14, 2015 at 05:21:07AM -0700, tip-bot for Dave Hansen wrote:
> Commit-ID:  d91cab78133d33b1dfd3d3fa7167fcbf74fb5f99
> Gitweb:     http://git.kernel.org/tip/d91cab78133d33b1dfd3d3fa7167fcbf74fb5f99
> Author:     Dave Hansen <dave.hansen@linux.intel.com>
> AuthorDate: Wed, 2 Sep 2015 16:31:26 -0700
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Mon, 14 Sep 2015 12:21:46 +0200
> 
> x86/fpu: Rename XSAVE macros
> 
> There are two concepts that have some confusing naming:
>  1. Extended State Component numbers (currently called
>     XFEATURE_BIT_*)
>  2. Extended State Component masks (currently called XSTATE_*)
> 
> The numbers are (currently) from 0-9.  State component 3 is the
> bounds registers for MPX, for instance.
> 
> But when we want to enable "state component 3", we go set a bit
> in XCR0.  The bit we set is 1<<3.  We can check to see if a
> state component feature is enabled by looking at its bit.
> 
> The current 'xfeature_bit's are at best xfeature bit _numbers_.
> Calling them bits is at best inconsistent with ending the enum
> list with 'XFEATURES_NR_MAX'.
> 
> This patch renames the enum to be 'xfeature'.  These also
> happen to be what the Intel documentation calls a "state
> component".
> 
> We also want to differentiate these from the "XSTATE_*" macros.
> The "XSTATE_*" macros are a mask, and we rename them to match.
> 
> These macros are reasonably widely used so this patch is a
> wee bit big, but this really is just a rename.
> 
> The only non-mechanical part of this is the
> 
> 	s/XSTATE_EXTEND_MASK/XFEATURE_MASK_EXTEND/
> 
> We need a better name for it, but that's another patch.
> 
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Tim Chen <tim.c.chen@linux.intel.com>
> Cc: dave@sr71.net
> Cc: linux-kernel@vger.kernel.org
> Link: http://lkml.kernel.org/r/20150902233126.38653250@viggo.jf.intel.com
> [ Ported to v4.3-rc1. ]
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> ---

...

> @@ -558,7 +558,7 @@ static int __init twofish_init(void)
>  {
>  	const char *feature_name;
>  
> -	if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, &feature_name)) {
> +	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) {
>  		pr_info("CPU feature '%s' is not supported.\n", feature_name);
>  		return -ENODEV;
>  	}

---
From: Borislav Petkov <bp@suse.de>
Date: Wed, 23 Sep 2015 12:44:59 +0200
Subject: [PATCH] x86/crypto: Fixup uninitialized feature_name warning

Hand in &feature_name to cpu_has_xfeatures() as it is supposed to. Fixes
an uninitialized warning.

Fixes: d91cab78133d ("x86/fpu: Rename XSAVE macros")
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/crypto/twofish_avx_glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
index 6f3738ced95e..b7a3904b953c 100644
--- a/arch/x86/crypto/twofish_avx_glue.c
+++ b/arch/x86/crypto/twofish_avx_glue.c
@@ -558,7 +558,7 @@ static int __init twofish_init(void)
 {
 	const char *feature_name;
 
-	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) {
+	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, &feature_name)) {
 		pr_info("CPU feature '%s' is not supported.\n", feature_name);
 		return -ENODEV;
 	}
-- 
2.3.5

-- 
Regards/Gruss,
    Boris.

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

  reply	other threads:[~2015-09-23 10:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 23:31 [PATCH 00/15] [v4] x86, fpu: XSAVE cleanups and sanity checks Dave Hansen
2015-09-02 23:31 ` [PATCH 02/15] x86, fpu: move XSAVE-disabling code to a helper Dave Hansen
2015-09-14 12:19   ` [tip:x86/fpu] x86/fpu: Move " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 01/15] x86, fpu: print xfeature buffer size in decimal Dave Hansen
2015-09-14 12:19   ` [tip:x86/fpu] x86/fpu: Print " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 04/15] x86, fpu: kill LWP support Dave Hansen
2015-09-14 12:20   ` [tip:x86/fpu] x86/fpu: Remove partial LWP support definitions tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 03/15] x86, fpu: remove XSTATE_RESERVE Dave Hansen
2015-09-14 12:20   ` [tip:x86/fpu] x86/fpu: Remove XSTATE_RESERVE tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 05/15] x86, fpu: XSAVE macro renames Dave Hansen
2015-09-14 12:21   ` [tip:x86/fpu] x86/fpu: Rename XSAVE macros tip-bot for Dave Hansen
2015-09-23 10:49     ` Borislav Petkov [this message]
2015-09-24  7:24       ` [tip:x86/fpu] x86/fpu: Fixup uninitialized feature_name warning tip-bot for Borislav Petkov
2015-09-02 23:31 ` [PATCH 06/15] x86, fpu: rename XFEATURES_NR_MAX Dave Hansen
2015-09-14 12:21   ` [tip:x86/fpu] x86/fpu: Rename XFEATURES_NR_MAX tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 07/15] x86, fpu: rework XSTATE_* macros to remove magic '2' Dave Hansen
2015-09-14 12:21   ` [tip:x86/fpu] x86/fpu: Rework " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 08/15] x86, fpu: remove xfeature_nr Dave Hansen
2015-09-14 12:22   ` [tip:x86/fpu] x86/fpu: Remove 'xfeature_nr' tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 11/15] x86, fpu: rework YMM definition Dave Hansen
2015-09-14 12:23   ` [tip:x86/fpu] x86/fpu: Rework " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 09/15] x86, fpu: add helper xfeature_enabled() instead of test_bit() Dave Hansen
2015-09-14 12:22   ` [tip:x86/fpu] x86/fpu: Add xfeature_enabled() helper " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 10/15] x86, fpu: rework MPX 'xstate' types Dave Hansen
2015-09-14 12:22   ` [tip:x86/fpu] x86/fpu/mpx: Rework " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 12/15] x86, fpu: add C structures for AVX-512 state components Dave Hansen
2015-09-14 12:23   ` [tip:x86/fpu] x86/fpu: Add " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 13/15] x86, fpu: correct and check XSAVE xstate size calculations Dave Hansen
2015-09-14 12:23   ` [tip:x86/fpu] x86/fpu: Correct " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 14/15] x86, fpu: check to ensure increasing-offset xstate offsets Dave Hansen
2015-09-14 12:24   ` [tip:x86/fpu] x86/fpu: Check " tip-bot for Dave Hansen
2015-09-02 23:31 ` [PATCH 15/15] x86, fpu: check CPU-provided sizes against struct declarations Dave Hansen
2015-09-14 12:24   ` [tip:x86/fpu] x86/fpu: Check " tip-bot for Dave Hansen
2015-09-14 10:07 ` [PATCH 00/15] [v4] x86, fpu: XSAVE cleanups and sanity checks Ingo Molnar

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=20150923104901.GA3538@pd.tnic \
    --to=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvlasenk@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.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.