From patchwork Thu Oct 10 08:36:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175725 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1983744ill; Thu, 10 Oct 2019 01:48:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbScvvT+Jj42Fsq5b8xHPYPWc8LRvhTIQIUaS4oBV/dShIbpyJqLV7pap4NmilW7Ae14f8 X-Received: by 2002:a17:906:3ec8:: with SMTP id d8mr7005579ejj.57.1570697331733; Thu, 10 Oct 2019 01:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697331; cv=none; d=google.com; s=arc-20160816; b=qAPFQVAikFeTTSYdJsnAr0/8qfSd+FcwNNmmsdfzfAeftDYS9YNkE865ulsiLdGuJA oC3ZB8z77YbHGFibX63WyfL+4BLiYsh9zp//GuP2d0VL0XFfp6TCer1q2JxNgc8fsfVB J8ejVNb+7GK7ilorDvrniE02eUyeFptJOyK0B/FvHVEUDhdZnTn+KUVIjz1y+oAg5iN+ w+FxlKZRrUA8vjSaJGYLeK2zWjiRu8BJmCBx33PvPifVos3H900f3E63YSD1lVee+NSH AWuzgh3jg6kXsZ9KeHl7GqCoKOJuAmIgHVwXIldfgtENDGqvZEACnoB9e9QseO98p/0F qDyg== 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=HC0e8NdoCB7tWyVa03bexezNwrfYw924soWcdMFMpw8=; b=nAB4EycO1JUR+lBZnVF3zGZtJt1CYjxQBqNJOP12FFqo3uc89XeIqbGbuVXzwwad3W 7ttrZSuQvkE2P1oYd9S3o3ERhzsddFT8j9FqiI5AR/WRowpvFfsAUk4F8v0Py7mAnKTt E9tRmE5xzf0C9TnFOgcenf+S+j//6t6b9gILlG6owCatknzXUi/C2RDdahJyNlDetLun Kl43k++0YMQn3DE4CXvH9tO9yi89vdfiCjyj7FQp38C1RfyKYcuX1yNZ1PdvDH19u1ys j/ElQ1rfhVobfgJmohPuoPHUiZhZ3Jsw9oRLEqTPQVRYbvg/oNyUrNFTaDtbobONRU+5 DX8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DvVzJZlH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 x19si2831512eju.15.2019.10.10.01.48.51; Thu, 10 Oct 2019 01:48:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=DvVzJZlH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389157AbfJJIss (ORCPT + 13 others); Thu, 10 Oct 2019 04:48:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:55118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388745AbfJJIss (ORCPT ); Thu, 10 Oct 2019 04:48:48 -0400 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 2FF84218AC; Thu, 10 Oct 2019 08:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697326; bh=T4FbpQKPhy3l01rC+LQL19O6vxjqjUvvNx+JZt0oe/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DvVzJZlH6/y+iqSowPXJUyKW6711tKRPd8A/IO2hKjo9IljHTvX6ypUPBYo9+0QAU qNpJl0h3ijLl6zJxeIM1sDL0KR2AWYa06ykcGhDPS2rVWkgVzWc1aLLJjScRrXkO3o pmZPJzJKw49tyrdXgI/L2eGsE897D52X1KxCeAAE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Ard Biesheuvel Subject: [PATCH 4.19 102/114] arm64: ssbs: Dont treat CPUs with SSBS as unaffected by SSB Date: Thu, 10 Oct 2019 10:36:49 +0200 Message-Id: <20191010083613.611304454@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083544.711104709@linuxfoundation.org> References: <20191010083544.711104709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -341,15 +341,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)