提交 5a2451f1 编写于 作者: Z Zheng Zengkai 提交者: Aichun Shi

x86/fpu: Avoid kabi change caused by struct fpu

category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5RQLJ
CVE: NA

Intel-SIG: x86/fpu: Avoid kabi change caused by struct fpu.

--------------------------------

Assuming that struct fpu won't be accessed directly by drivers,
Using KABI_EXTEND and KABI_DEPRECATE macros to avoid kabi change caused by following
commits:
87d0e5be ("x86/fpu: Provide struct fpstate")
2f27b503 ("x86/fpu: Remove fpu::state")
75c52dad ("x86/fpu: Prepare for sanitizing KVM FPU code")
6f6a7c09 ("x86/fpu: Add members to struct fpu to cache permission
information")
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: NLin Wang <lin.x.wang@intel.com>
Signed-off-by: NAichun Shi <aichun.shi@intel.com>
上级 ad307c6f
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef _ASM_X86_FPU_H #ifndef _ASM_X86_FPU_H
#define _ASM_X86_FPU_H #define _ASM_X86_FPU_H
#include <linux/kabi.h>
/* /*
* The legacy x87 FPU state format, as saved by FSAVE and * The legacy x87 FPU state format, as saved by FSAVE and
* restored by the FRSTOR instructions: * restored by the FRSTOR instructions:
...@@ -459,7 +461,7 @@ struct fpu { ...@@ -459,7 +461,7 @@ struct fpu {
* Pointer to the active struct fpstate. Initialized to * Pointer to the active struct fpstate. Initialized to
* point at @__fpstate below. * point at @__fpstate below.
*/ */
struct fpstate *fpstate; KABI_EXTEND(struct fpstate *fpstate)
/* /*
* @__task_fpstate: * @__task_fpstate:
...@@ -467,14 +469,14 @@ struct fpu { ...@@ -467,14 +469,14 @@ struct fpu {
* Pointer to an inactive struct fpstate. Initialized to NULL. Is * Pointer to an inactive struct fpstate. Initialized to NULL. Is
* used only for KVM support to swap out the regular task fpstate. * used only for KVM support to swap out the regular task fpstate.
*/ */
struct fpstate *__task_fpstate; KABI_EXTEND(struct fpstate *__task_fpstate)
/* /*
* @perm: * @perm:
* *
* Permission related information * Permission related information
*/ */
struct fpu_state_perm perm; KABI_EXTEND(struct fpu_state_perm perm)
/* /*
* @__fpstate: * @__fpstate:
...@@ -484,7 +486,8 @@ struct fpu { ...@@ -484,7 +486,8 @@ struct fpu {
* are restored from this storage on return to user space if they * are restored from this storage on return to user space if they
* are not longer containing the tasks FPU register state. * are not longer containing the tasks FPU register state.
*/ */
struct fpstate __fpstate; KABI_DEPRECATE(union fpregs_state, state)
KABI_EXTEND(struct fpstate __fpstate)
/* /*
* WARNING: '__fpstate' is dynamically-sized. Do not put * WARNING: '__fpstate' is dynamically-sized. Do not put
* anything after it here. * anything after it here.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册