lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.18 22/54] x86/bugs: Do IBPB fallback check only once
    Date
    From: Josh Poimboeuf <jpoimboe@kernel.org>

    [ Upstream commit 0fe4aeea9c01baabecc8c3afc7889c809d939bc2 ]

    When booting with retbleed=auto, if the kernel wasn't built with
    CONFIG_CC_HAS_RETURN_THUNK, the mitigation falls back to IBPB. Make
    sure a warning is printed in that case. The IBPB fallback check is done
    twice, but it really only needs to be done once.

    Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/x86/kernel/cpu/bugs.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
    index ca5f90375a7d..99c45cf27ae6 100644
    --- a/arch/x86/kernel/cpu/bugs.c
    +++ b/arch/x86/kernel/cpu/bugs.c
    @@ -871,8 +871,9 @@ static void __init retbleed_select_mitigation(void)
    retbleed_mitigation = RETBLEED_MITIGATION_UNRET;

    /*
    - * The Intel mitigation (IBRS) was already selected in
    - * spectre_v2_select_mitigation().
    + * The Intel mitigation (IBRS or eIBRS) was already selected in
    + * spectre_v2_select_mitigation(). 'retbleed_mitigation' will
    + * be set accordingly below.
    */

    break;
    --
    2.35.1
    \
     
     \ /
      Last update: 2022-07-20 03:13    [W:4.122 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site