x86/fpu: Rename xsave.header::xstate_bv to 'xfeatures'
authorIngo Molnar <mingo@kernel.org>
Fri, 24 Apr 2015 08:19:47 +0000 (10:19 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:35 +0000 (15:47 +0200)
'xsave.header::xstate_bv' is a misnomer - what does 'bv' stand for?

It probably comes from the 'XGETBV' instruction name, but I could
not find in the Intel documentation where that abbreviation comes
from. It could mean 'bit vector' - or something else?

But how about - instead of guessing about a weird name - we named
the field in an obvious and descriptive way that tells us exactly
what it does?

So rename it to 'xfeatures', which is a bitmask of the
xfeatures that are fpstate_active in that context structure.

Eyesore like:

           fpu->state->xsave.xsave_hdr.xstate_bv |= XSTATE_FP;

is now much more readable:

           fpu->state->xsave.header.xfeatures |= XSTATE_FP;

Which form is not just infinitely more readable, but is also
shorter as well.

Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/fpu/internal.h
arch/x86/include/asm/fpu/types.h
arch/x86/include/asm/user.h
arch/x86/include/uapi/asm/sigcontext.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/xsave.c
arch/x86/kvm/x86.c

index 3007df9..07c6adc 100644 (file)
@@ -261,7 +261,7 @@ static inline int fpu_save_init(struct fpu *fpu)
                /*
                 * xsave header may indicate the init state of the FP.
                 */
-               if (!(fpu->state->xsave.header.xstate_bv & XSTATE_FP))
+               if (!(fpu->state->xsave.header.xfeatures & XSTATE_FP))
                        return 1;
        } else if (use_fxsr()) {
                fpu_fxsave(fpu);
index 33c0c7b..9bd2cd1 100644 (file)
@@ -100,7 +100,7 @@ struct bndcsr {
 } __packed;
 
 struct xstate_header {
-       u64                             xstate_bv;
+       u64                             xfeatures;
        u64                             xcomp_bv;
        u64                             reserved[6];
 } __attribute__((packed));
Simple merge
Simple merge
Simple merge
Simple merge