提交 e6852445 编写于 作者: T Thomas Gleixner 提交者: Borislav Petkov

x86/fpu: Move inlines where they belong

They are only used in fpstate_init() and there is no point to have them in
a header just to make reading the code harder.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Reviewed-by: NBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121452.023118522@linutronix.de
上级 4098b3ee
...@@ -86,20 +86,6 @@ extern void fpstate_init_soft(struct swregs_state *soft); ...@@ -86,20 +86,6 @@ extern void fpstate_init_soft(struct swregs_state *soft);
static inline void fpstate_init_soft(struct swregs_state *soft) {} static inline void fpstate_init_soft(struct swregs_state *soft) {}
#endif #endif
static inline void fpstate_init_xstate(struct xregs_state *xsave)
{
/*
* XRSTORS requires these bits set in xcomp_bv, or it will
* trigger #GP:
*/
xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xfeatures_mask_all;
}
static inline void fpstate_init_fxstate(struct fxregs_state *fx)
{
fx->cwd = 0x37f;
fx->mxcsr = MXCSR_DEFAULT;
}
extern void fpstate_sanitize_xstate(struct fpu *fpu); extern void fpstate_sanitize_xstate(struct fpu *fpu);
#define user_insn(insn, output, input...) \ #define user_insn(insn, output, input...) \
......
...@@ -181,6 +181,21 @@ void fpu__save(struct fpu *fpu) ...@@ -181,6 +181,21 @@ void fpu__save(struct fpu *fpu)
fpregs_unlock(); fpregs_unlock();
} }
static inline void fpstate_init_xstate(struct xregs_state *xsave)
{
/*
* XRSTORS requires these bits set in xcomp_bv, or it will
* trigger #GP:
*/
xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xfeatures_mask_all;
}
static inline void fpstate_init_fxstate(struct fxregs_state *fx)
{
fx->cwd = 0x37f;
fx->mxcsr = MXCSR_DEFAULT;
}
/* /*
* Legacy x87 fpstate state init: * Legacy x87 fpstate state init:
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册