Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp855975oof; Tue, 25 Sep 2018 05:41:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63khEGR8bfQUFy5cn5eBLjZraMsyr2f5rwTECaokHZ8Id11qkyKtSGlzrIsqFCPE8aJ/pr/ X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr912581pgj.356.1537879277528; Tue, 25 Sep 2018 05:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537879277; cv=none; d=google.com; s=arc-20160816; b=CHl8ubM8JUNKfyNmkxvNc6x5LR+t2hwNLCW+LRhbiU0RrVXBvVD4LM4hLnsSQC/Wv+ u3+KMHEpNDriv+8Oa7caVJzD6rO03s5DObGtClwN1cktX4d7uXK21KQfiUUzxj4E8Fo+ N7YRhko6UHFZnegjqByzJYccotOkhiV2nWFQv2FTzgMWetkPfQW7/jjD5WQJNH7rTXdm ri1EJ9VvBAgbYNKAR1rwM8tRvL00Cq8RUqyWiRfAigf0NzH5pdD1rdw5fZebAqcuX/cc xPPaRlK+JTSnXOzRhXdClkGuBWUlPosAPKHQsfbdruOD0TI6TU7dZwVCzLfIDDZF9LHQ 6u+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=iz7u+6afxoqqGW8LCnveVZBqJuJ4SIEKSBPulpczXzk=; b=CjFcfOYn0IqBETIb/nYRlJ9zN/iuxMixvM1gBmYJoBPD69DS0rSKR3ccP0/RsN8qni FkGBXyer3qoOMjYQ0sVMYTalaJGDHXyq3DDE0SiTEKx6o2x7f8MW29iWD+1QfK51B0Go g3QQU3iXwX/ovR3KIGJbbXuzVz97Pm4JXaCSQQrzkHDdySvoe5xfNolag/x6S4V8FfoJ jv/p+xJBYDU1xK7oocL97X0kAQud8fZwilB/k4J+dLfvxPBIC6jxTPshr1qRljGU8KMb rFOGnuZALPkHxWRja7JiFm7O6sDOXBP2mOBFimw4qwdV4GrEell3WWO6bYjwTS6k1879 K2bA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14-v6si2055373pfo.361.2018.09.25.05.41.00; Tue, 25 Sep 2018 05:41:17 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729104AbeIYSqx (ORCPT + 99 others); Tue, 25 Sep 2018 14:46:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:34740 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728781AbeIYSqx (ORCPT ); Tue, 25 Sep 2018 14:46:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 503C5AEA3; Tue, 25 Sep 2018 12:39:29 +0000 (UTC) Date: Tue, 25 Sep 2018 14:39:28 +0200 (CEST) From: Jiri Kosina To: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Josh Poimboeuf , Andrea Arcangeli , "Woodhouse, David" , Andi Kleen , Tim Chen , "Schaufler, Casey" cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [PATCH v7 3/3] x86/speculation: Propagate information about RSB filling mitigation to sysfs In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Kosina If spectrev2 mitigation has been enabled, we're filling RSB on context switch in order to protect from various classess of spectrev2 attacks. If this mitigation is enabled, say so in sysfs for spectrev2. Signed-off-by: Jiri Kosina --- arch/x86/kernel/cpu/bugs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 53eb14a65610..fe32103fcdc7 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -874,10 +874,11 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr return sprintf(buf, "Mitigation: __user pointer sanitization\n"); case X86_BUG_SPECTRE_V2: - ret = sprintf(buf, "%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled], + ret = sprintf(buf, "%s%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled], boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "", boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "", (x86_spec_ctrl_base & SPEC_CTRL_STIBP) ? ", STIBP" : "", + boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? ", RSB filling" : "", spectre_v2_module_string()); return ret; -- 2.12.3 -- Jiri Kosina SUSE Labs