From patchwork Sun Oct 27 21:00:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 177855 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2532725ill; Sun, 27 Oct 2019 14:10:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyA5IymMd0f60b+4FPX8YOoGpMzan0ydE3vGp4ql3OkIGhzG6YKS7tvfQUBt4G1uq47oUR/ X-Received: by 2002:a50:ee95:: with SMTP id f21mr15131609edr.18.1572210641256; Sun, 27 Oct 2019 14:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572210641; cv=none; d=google.com; s=arc-20160816; b=lByQwQVGPk1PGL/qPyXMLXWTtnsy3tbzAeRwWY18v0aZvxlwyuVlVKrUwH4MSab/rA FOEv0aTfu3nxu17oX7zDhq/TNXcQj+s7DKLMpIg7U0i5/82IyxxOEKY1IrW2Fo24S7DM RYZy1ME1IPlc0Aia+ZZWidKwNLFX13rtvntC5wqJFxbPMfsG4ThF3bBBn9Wm5KGt2RSx rVTfxrTlUFPZcsZMfm9AEbOKVMsCe76qiMljO57VMPOfNF1/denkxDuO/lvuyAg5WP6/ EqAHl9G5MloYnLLF5C1wjr6VUkHsG8JAaU/TVhlORZc5GoYf8k66dTZZ4Fvyf73z/G1g HAMQ== 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=of0xuoW+Ka7ppmPgzGveoLRFfuRtce0SIeLHcUU7QRI=; b=XPvtw+dAf1ZYSRJUDCCgxcaIxk3YxDKqITfZcgdKUdNjVx1uwevdVhmr1tV5wacHSS nn/Jqs2vwxoq3Bdt5lJnxaS7cpoasdNnJsiaUKQ9wD4gSSLZ6pMBQjqxsGX8peDaQnfN wW77W5SZrB6/ypwyM+BoqdOzwPaOgGJGR5EoAaj+RGMnOs9q9VIZUbgl+kvO8dbvz/ao kPkdI3c7LAV6ozG67iKq3cMlvmlO8kovj3qyKnVf8Yri9tftFxPb9V3aPOR5fjxSWX3W +t4WgXU2RBg0BokQnX4DYJofLV3MeA8sUQda8GdIoMy46YkEoqNw/yWUKNuY+qCezg8s ML/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rk0iv7B5; 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 c29si299346ede.50.2019.10.27.14.10.40; Sun, 27 Oct 2019 14:10:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rk0iv7B5; 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 S1729729AbfJ0VKh (ORCPT + 26 others); Sun, 27 Oct 2019 17:10:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:56960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728709AbfJ0VKb (ORCPT ); Sun, 27 Oct 2019 17:10:31 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (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 900442064A; Sun, 27 Oct 2019 21:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572210631; bh=ew1OM2lWtU0jh8CRwqRLdZAY2iaRlj+H0EYC7ErADg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rk0iv7B5oJIYndKDeZQ4SUXQDWcvCQkf59iWrV7uxeQjXD2g6/tzA2TganCacpIAK 5oHanakzaGt4+tFd4At6v8YDv/uW/vEWI6p7vXYqUxcmgZbdEZJlJbSOIK9vZy1rmL 67xkat06Pcc4gytzCqM/C+beG0yhSI2O3Rx8L7fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Will Deacon , Ard Biesheuvel Subject: [PATCH 4.14 081/119] arm64: ssbs: Dont treat CPUs with SSBS as unaffected by SSB Date: Sun, 27 Oct 2019 22:00:58 +0100 Message-Id: <20191027203345.482722429@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203259.948006506@linuxfoundation.org> References: <20191027203259.948006506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit eb337cdfcd5dd3b10522c2f34140a73a4c285c30 ] SSBS provides a relatively cheap mitigation for SSB, but it is still a mitigation and its presence does not indicate that the CPU is unaffected by the vulnerability. Tweak the mitigation logic so that we report the correct string in sysfs. Signed-off-by: Will Deacon Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpu_errata.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -333,15 +333,17 @@ static bool has_ssbd_mitigation(const st WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible()); + /* delay setting __ssb_safe until we get a firmware response */ + if (is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list)) + this_cpu_safe = true; + if (this_cpu_has_cap(ARM64_SSBS)) { + if (!this_cpu_safe) + __ssb_safe = false; required = false; goto out_printmsg; } - /* delay setting __ssb_safe until we get a firmware response */ - if (is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list)) - this_cpu_safe = true; - if (psci_ops.smccc_version == SMCCC_VERSION_1_0) { ssbd_state = ARM64_SSBD_UNKNOWN; if (!this_cpu_safe)