lkml.org 
[lkml]   [2022]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 11/32] x86/fred: if CONFIG_X86_FRED is disabled, disable FRED support
    Date
    From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

    Add CONFIG_X86_FRED to <asm/disabled-features.h> to make
    cpu_feature_enabled() work correctly with FRED.

    Originally-by: Megha Dey <megha.dey@intel.com>
    Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
    Signed-off-by: Xin Li <xin3.li@intel.com>
    ---
    arch/x86/include/asm/disabled-features.h | 8 +++++++-
    tools/arch/x86/include/asm/disabled-features.h | 8 +++++++-
    2 files changed, 14 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h
    index 33d2cd04d254..3a2d0ad63332 100644
    --- a/arch/x86/include/asm/disabled-features.h
    +++ b/arch/x86/include/asm/disabled-features.h
    @@ -87,6 +87,12 @@
    # define DISABLE_TDX_GUEST (1 << (X86_FEATURE_TDX_GUEST & 31))
    #endif

    +#ifdef CONFIG_X86_FRED
    +# define DISABLE_FRED 0
    +#else
    +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31))
    +#endif
    +
    /*
    * Make sure to add features to the correct mask
    */
    @@ -102,7 +108,7 @@
    #define DISABLED_MASK9 (DISABLE_SGX)
    #define DISABLED_MASK10 0
    #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET)
    -#define DISABLED_MASK12 0
    +#define DISABLED_MASK12 (DISABLE_FRED)
    #define DISABLED_MASK13 0
    #define DISABLED_MASK14 0
    #define DISABLED_MASK15 0
    diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h
    index 33d2cd04d254..3a2d0ad63332 100644
    --- a/tools/arch/x86/include/asm/disabled-features.h
    +++ b/tools/arch/x86/include/asm/disabled-features.h
    @@ -87,6 +87,12 @@
    # define DISABLE_TDX_GUEST (1 << (X86_FEATURE_TDX_GUEST & 31))
    #endif

    +#ifdef CONFIG_X86_FRED
    +# define DISABLE_FRED 0
    +#else
    +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31))
    +#endif
    +
    /*
    * Make sure to add features to the correct mask
    */
    @@ -102,7 +108,7 @@
    #define DISABLED_MASK9 (DISABLE_SGX)
    #define DISABLED_MASK10 0
    #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET)
    -#define DISABLED_MASK12 0
    +#define DISABLED_MASK12 (DISABLE_FRED)
    #define DISABLED_MASK13 0
    #define DISABLED_MASK14 0
    #define DISABLED_MASK15 0
    --
    2.34.1
    \
     
     \ /
      Last update: 2023-03-26 23:15    [W:3.401 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site