Commit d9d005f3 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Borislav Petkov

x86/fpu: Move mxcsr related code to core

No need to expose that to code which only needs the XCR0 accessors.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211015011539.740012411@linutronix.de
parent 9848fb96
...@@ -2,17 +2,6 @@ ...@@ -2,17 +2,6 @@
#ifndef _ASM_X86_FPU_XCR_H #ifndef _ASM_X86_FPU_XCR_H
#define _ASM_X86_FPU_XCR_H #define _ASM_X86_FPU_XCR_H
/*
* MXCSR and XCR definitions:
*/
static inline void ldmxcsr(u32 mxcsr)
{
asm volatile("ldmxcsr %0" :: "m" (mxcsr));
}
extern unsigned int mxcsr_feature_mask;
#define XCR_XFEATURE_ENABLED_MASK 0x00000000 #define XCR_XFEATURE_ENABLED_MASK 0x00000000
static inline u64 xgetbv(u32 index) static inline u64 xgetbv(u32 index)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include "internal.h" #include "internal.h"
#include "legacy.h"
/* /*
* Initialize the registers found in all CPUs, CR0 and CR4: * Initialize the registers found in all CPUs, CR0 and CR4:
......
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
#include <asm/fpu/types.h> #include <asm/fpu/types.h>
extern unsigned int mxcsr_feature_mask;
static inline void ldmxcsr(u32 mxcsr)
{
asm volatile("ldmxcsr %0" :: "m" (mxcsr));
}
/* /*
* Returns 0 on success or the trap number when the operation raises an * Returns 0 on success or the trap number when the operation raises an
* exception. * exception.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "context.h" #include "context.h"
#include "internal.h" #include "internal.h"
#include "legacy.h"
/* /*
* The xstateregs_active() routine is the same as the regset_fpregs_active() routine, * The xstateregs_active() routine is the same as the regset_fpregs_active() routine,
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
#include <asm/fpu/api.h> #include <asm/fpu/api.h>
#include <asm/fpu/internal.h> #include <asm/fpu/internal.h>
#include <asm/fpu/signal.h>
#include <asm/fpu/regset.h> #include <asm/fpu/regset.h>
#include <asm/fpu/signal.h>
#include <asm/fpu/xcr.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
#include <linux/misc_cgroup.h> #include <linux/misc_cgroup.h>
#include <linux/processor.h> #include <linux/processor.h>
#include <linux/trace_events.h> #include <linux/trace_events.h>
#include <asm/fpu/internal.h>
#include <asm/pkru.h> #include <asm/pkru.h>
#include <asm/trapnr.h> #include <asm/trapnr.h>
#include <asm/fpu/xcr.h>
#include "x86.h" #include "x86.h"
#include "svm.h" #include "svm.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment