Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5997847ybc; Wed, 27 Nov 2019 13:08:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzgmlmTLMfiE972muh2ilj2PJues8+dpKC4LqzVPFa8N/qzIp+3TMNkl53mbgRvj9WtM51V X-Received: by 2002:aa7:d64e:: with SMTP id v14mr34645039edr.88.1574888903764; Wed, 27 Nov 2019 13:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888903; cv=none; d=google.com; s=arc-20160816; b=X7WFgF0RCMJz/aNLMRBKQ+bXKN6xzbsWxg0sVO9tdk7zgMlOK8ZY9ttPwftwfK+JG9 VSA7M34CkP0I60G/LBE4ubZWbcG6JgTG9Hi4KV4RXR9UWc1lM4kVlxq5RtKKu2fuMJPZ SWMN6m56Euof2TSswa7KFpKFNStmFEaqTblqCm1hAKA5Z4mKB5ku+Q+bfZvckJ5Lc5F/ AH/b/T/nANw6yPM5zlWBF3CMHPc5r4b96ulTif2u/D4328NeZowYBL6M5CL0qGBz+43k dZQkKzO/r+88c3gJs9YuQehcT9hRD1X/mj0Wj1cSb9oUmGuXaeeRcNzLTNyWWzjhza5s eB1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Tz29bu84mM30ZRXaTzdKPapbENn84hfBCC8C9ULcEg=; b=HAQjdjLtJ0rmv6IXibhPiFjzNlwcv6ApJzxwDX3bOUydszO8eoQDbmzs/CkU9JQt2d Jwhh3tkV2Y6dacWp0R6sNpe6G10dllyVZpPJlaakSqHnU3QvJ/lTlyDFFIWNI+wFiCAb 9r/fymMZNMuZXpiwrNtVJ7vtYR5ehIdeR4r60xmhosdG/nEXyrixXRh7qA4rZbUoSwQd Ksv7Lb61DVVmFTW5mp/nhOi7KbHcj4kYxM/pDS92VkyCyUdnbjzFt4z+4QTJa7FblpEo eyGavRjOIPL6Iwhqj2TQfW08nqxsfCuJohNRilG+6yBc4KDvS7Fnmwdg7EpuZAf7Y/WL IvTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wG0CTEwo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si10388321ejs.161.2019.11.27.13.08.00; Wed, 27 Nov 2019 13:08:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wG0CTEwo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732450AbfK0VGg (ORCPT + 99 others); Wed, 27 Nov 2019 16:06:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:60600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732039AbfK0VGa (ORCPT ); Wed, 27 Nov 2019 16:06:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D136217D6; Wed, 27 Nov 2019 21:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888789; bh=85fGGUmNc6aJLbEGpfmynlbgA0s6PvO/ENe7anqmj50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wG0CTEwo8QX6NfkmXjz5nhc136bbmQzL/87o4obd36l116UBb+qGzEuR+0QUxbhTu +Ju+J+SGZHXIdupyIURDWCayP40v5ZS7gX26N15xBH4sFFNS9+MpEi3PwTcShk/mvM GXbZczaJ5ot49g9n9GypfHThBSYwnwuCDAB4qSFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pawan Gupta , Waiman Long , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Josh Poimboeuf , Mark Gross , Peter Zijlstra , Thomas Gleixner , Tim Chen , Tony Luck , Tyler Hicks , x86-ml Subject: [PATCH 4.19 269/306] x86/speculation: Fix redundant MDS mitigation message Date: Wed, 27 Nov 2019 21:31:59 +0100 Message-Id: <20191127203134.482789940@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Waiman Long commit cd5a2aa89e847bdda7b62029d94e95488d73f6b2 upstream. Since MDS and TAA mitigations are inter-related for processors that are affected by both vulnerabilities, the followiing confusing messages can be printed in the kernel log: MDS: Vulnerable MDS: Mitigation: Clear CPU buffers To avoid the first incorrect message, defer the printing of MDS mitigation after the TAA mitigation selection has been done. However, that has the side effect of printing TAA mitigation first before MDS mitigation. [ bp: Check box is affected/mitigations are disabled first before printing and massage. ] Suggested-by: Pawan Gupta Signed-off-by: Waiman Long Signed-off-by: Borislav Petkov Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Josh Poimboeuf Cc: Mark Gross Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tim Chen Cc: Tony Luck Cc: Tyler Hicks Cc: x86-ml Link: https://lkml.kernel.org/r/20191115161445.30809-3-longman@redhat.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -39,6 +39,7 @@ static void __init spectre_v2_select_mit static void __init ssb_select_mitigation(void); static void __init l1tf_select_mitigation(void); static void __init mds_select_mitigation(void); +static void __init mds_print_mitigation(void); static void __init taa_select_mitigation(void); /* The base value of the SPEC_CTRL MSR that always has to be preserved. */ @@ -108,6 +109,12 @@ void __init check_bugs(void) mds_select_mitigation(); taa_select_mitigation(); + /* + * As MDS and TAA mitigations are inter-related, print MDS + * mitigation until after TAA mitigation selection is done. + */ + mds_print_mitigation(); + arch_smt_update(); #ifdef CONFIG_X86_32 @@ -245,6 +252,12 @@ static void __init mds_select_mitigation (mds_nosmt || cpu_mitigations_auto_nosmt())) cpu_smt_disable(false); } +} + +static void __init mds_print_mitigation(void) +{ + if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off()) + return; pr_info("%s\n", mds_strings[mds_mitigation]); }