Skip to content

Commit

Permalink
x86/fpu: Move asm/xcr.h to asm/fpu/internal.h
Browse files Browse the repository at this point in the history
Now that all FPU internals using drivers are converted to public APIs,
move xcr.h's definitions into fpu/internal.h and remove xcr.h.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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>
  • Loading branch information
Ingo Molnar committed May 19, 2015
1 parent 57dd083 commit befc61a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 52 deletions.
25 changes: 25 additions & 0 deletions arch/x86/include/asm/fpu/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,31 @@ static inline void fpu_reset_state(struct fpu *fpu)
restore_init_xstate();
}

/*
* Definitions for the eXtended Control Register instructions
*/

#define XCR_XFEATURE_ENABLED_MASK 0x00000000

static inline u64 xgetbv(u32 index)
{
u32 eax, edx;

asm volatile(".byte 0x0f,0x01,0xd0" /* xgetbv */
: "=a" (eax), "=d" (edx)
: "c" (index));
return eax + ((u64)edx << 32);
}

static inline void xsetbv(u32 index, u64 value)
{
u32 eax = value;
u32 edx = value >> 32;

asm volatile(".byte 0x0f,0x01,0xd1" /* xsetbv */
: : "a" (eax), "d" (edx), "c" (index));
}

/*
* FPU state switching for scheduling.
*
Expand Down
49 changes: 0 additions & 49 deletions arch/x86/include/asm/xcr.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/x86/kernel/fpu/xstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <asm/fpu/internal.h>
#include <asm/sigframe.h>
#include <asm/tlbflush.h>
#include <asm/xcr.h>

static const char *xfeature_names[] =
{
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <asm/virtext.h>
#include <asm/mce.h>
#include <asm/fpu/internal.h>
#include <asm/xcr.h>
#include <asm/perf_event.h>
#include <asm/debugreg.h>
#include <asm/kexec.h>
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#include <asm/mce.h>
#include <linux/kernel_stat.h>
#include <asm/fpu/internal.h> /* Ugh! */
#include <asm/xcr.h>
#include <asm/pvclock.h>
#include <asm/div64.h>

Expand Down

0 comments on commit befc61a

Please sign in to comment.