2022-03-25 18:39:56

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 2/7] x86/fpu: Remove unused supervisor only offsets

No users.

Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/x86/kernel/fpu/xstate.c | 30 ------------------------------
1 file changed, 30 deletions(-)

--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -83,8 +83,6 @@ static unsigned int xstate_sizes[XFEATUR
{ [ 0 ... XFEATURE_MAX - 1] = -1};
static unsigned int xstate_comp_offsets[XFEATURE_MAX] __ro_after_init =
{ [ 0 ... XFEATURE_MAX - 1] = -1};
-static unsigned int xstate_supervisor_only_offsets[XFEATURE_MAX] __ro_after_init =
- { [ 0 ... XFEATURE_MAX - 1] = -1};

/*
* Return whether the system supports a given xfeature.
@@ -325,33 +323,6 @@ static void __init setup_xstate_comp_off
}

/*
- * Setup offsets of a supervisor-state-only XSAVES buffer:
- *
- * The offsets stored in xstate_comp_offsets[] only work for one specific
- * value of the Requested Feature BitMap (RFBM). In cases where a different
- * RFBM value is used, a different set of offsets is required. This set of
- * offsets is for when RFBM=xfeatures_mask_supervisor().
- */
-static void __init setup_supervisor_only_offsets(void)
-{
- unsigned int next_offset;
- int i;
-
- next_offset = FXSAVE_SIZE + XSAVE_HDR_SIZE;
-
- for_each_extended_xfeature(i, fpu_kernel_cfg.max_features) {
- if (!xfeature_is_supervisor(i))
- continue;
-
- if (xfeature_is_aligned(i))
- next_offset = ALIGN(next_offset, 64);
-
- xstate_supervisor_only_offsets[i] = next_offset;
- next_offset += xstate_sizes[i];
- }
-}
-
-/*
* Print out xstate component offsets and sizes
*/
static void __init print_xstate_offset_size(void)
@@ -951,7 +922,6 @@ void __init fpu__init_system_xstate(unsi

setup_init_fpu_buf();
setup_xstate_comp_offsets();
- setup_supervisor_only_offsets();

/*
* Paranoia check whether something in the setup modified the


Subject: [tip: x86/urgent] x86/fpu: Remove unused supervisor only offsets

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: d47f71f6de7970d504748d1a60a11c51af5bce47
Gitweb: https://git.kernel.org/tip/d47f71f6de7970d504748d1a60a11c51af5bce47
Author: Thomas Gleixner <[email protected]>
AuthorDate: Thu, 24 Mar 2022 14:47:09 +01:00
Committer: Borislav Petkov <[email protected]>
CommitterDate: Wed, 30 Mar 2022 10:44:51 +02:00

x86/fpu: Remove unused supervisor only offsets

No users.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/kernel/fpu/xstate.c | 30 ------------------------------
1 file changed, 30 deletions(-)

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index dc6d5e9..dc33556 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -83,8 +83,6 @@ static unsigned int xstate_sizes[XFEATURE_MAX] __ro_after_init =
{ [ 0 ... XFEATURE_MAX - 1] = -1};
static unsigned int xstate_comp_offsets[XFEATURE_MAX] __ro_after_init =
{ [ 0 ... XFEATURE_MAX - 1] = -1};
-static unsigned int xstate_supervisor_only_offsets[XFEATURE_MAX] __ro_after_init =
- { [ 0 ... XFEATURE_MAX - 1] = -1};

/*
* Return whether the system supports a given xfeature.
@@ -325,33 +323,6 @@ static void __init setup_xstate_comp_offsets(void)
}

/*
- * Setup offsets of a supervisor-state-only XSAVES buffer:
- *
- * The offsets stored in xstate_comp_offsets[] only work for one specific
- * value of the Requested Feature BitMap (RFBM). In cases where a different
- * RFBM value is used, a different set of offsets is required. This set of
- * offsets is for when RFBM=xfeatures_mask_supervisor().
- */
-static void __init setup_supervisor_only_offsets(void)
-{
- unsigned int next_offset;
- int i;
-
- next_offset = FXSAVE_SIZE + XSAVE_HDR_SIZE;
-
- for_each_extended_xfeature(i, fpu_kernel_cfg.max_features) {
- if (!xfeature_is_supervisor(i))
- continue;
-
- if (xfeature_is_aligned(i))
- next_offset = ALIGN(next_offset, 64);
-
- xstate_supervisor_only_offsets[i] = next_offset;
- next_offset += xstate_sizes[i];
- }
-}
-
-/*
* Print out xstate component offsets and sizes
*/
static void __init print_xstate_offset_size(void)
@@ -951,7 +922,6 @@ void __init fpu__init_system_xstate(unsigned int legacy_size)

setup_init_fpu_buf();
setup_xstate_comp_offsets();
- setup_supervisor_only_offsets();

/*
* Paranoia check whether something in the setup modified the