Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8351731ybl; Thu, 16 Jan 2020 15:10:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwY+W6shStPFWusbKYDBbZy0AZqyaTBcNGlTecgNPJJHGwQVH/lBWQ27R5zANTuBw1AOHLQ X-Received: by 2002:a05:6830:149a:: with SMTP id s26mr4165239otq.55.1579216213426; Thu, 16 Jan 2020 15:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579216213; cv=none; d=google.com; s=arc-20160816; b=GBXOIqMYAAYZlTWnkYdz4LeQQp1ZjBoYBPuDfk3gKGllEOrER3uzJeT/HY+iW0DP1q 2W+04QygfLhYhpLsaSRLjpXqmneKKH+1vzG+0f21aicyWnWsu6mLcLzKwb4dZvsSRQt5 WHCN/O1LUP0i1XMVBlcsbBTgUdUDohCGYicVJM28po9IxZNWJ1tErQ5MS/AigGSIhmUc Xuls0OpI3eQz9kh39sz5hlCur74us1vOjuT4b9dM4K7ZB6OtdreJsZXLNJBW1ieatDss gTKJZv2/I5RtvCWY2SiNxOzrJmJXGi2INQMi1gm0fUt4ZT/SIJtmF61y6aClWcBx5NGz jAcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H391y0ck5CVd0d7dRhP0dA7WSXHcjG7Yrbtk7ejo9UA=; b=iYHggB4mXGgiT8ib2Ml94TcUvPNNNwNeYJQEyiYoEJb0jVa1ohRvKtcFVkwJuapp6v kk/DSp+uIMarvXC55jN5zVej5JD8znkk+3x4tQIXsWjPK3bGhzIQ4a8bVmmzgyhF4nhu TUpFLaHjJfZuNqLA5cjcaMyNuDwG9wT+ZavP4qMQF1rvKDgIY1yGX4FzqFi6HmhrJWdK enT7W9cpKLemMiomxW0BBMM1Hk4DXNf4nBQY4ir6ZIw+9tpRIjr/IEXMPkjeOf29a8VF eUeb1qCYUdFcsFlaHFjEmxZm80C3jxuJSGJst2sxSDnvd2406toCFU1j9YyHc+Ca9B/w 0wkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uxCDOQuk; 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=pass (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 n63si12467362oib.210.2020.01.16.15.10.00; Thu, 16 Jan 2020 15:10:13 -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=uxCDOQuk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392002AbgAPSbe (ORCPT + 99 others); Thu, 16 Jan 2020 13:31:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:38014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436645AbgAPSb2 (ORCPT ); Thu, 16 Jan 2020 13:31:28 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 2D86C206D7; Thu, 16 Jan 2020 18:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579199487; bh=n9w+eEwrwKaNFIfJ2uLhExYF95MkN3KncmP+Uf276UI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uxCDOQukU1DhBrpSDVnWCsaQAvjOUjLxlFvtr/Si8XX4qjWwO5+kvOjQYJvYJbUZy wyVyxAbmtbScN9ahtoFyN+Nk/a1IMI8TtLXR2Z6Bq9+SbJFFdjoYIMTVp0RdowTi59 bz0/1+mmMQgW+RhvSzbjNRfefuFbK2bFDC9upZ8s= Date: Thu, 16 Jan 2020 18:31:22 +0000 From: Will Deacon To: Doug Anderson Cc: Sai Prakash Ranjan , Jeffrey Hugo , Catalin Marinas , Marc Zyngier , Andre Przywara , Mark Rutland , LKML , linux-arm-msm , Linux ARM , Stephen Boyd , Bjorn Andersson , Matthias Kaehlcke , James Morse Subject: Re: [PATCH] arm64: Add KRYO{3,4}XX CPU cores to spectre-v2 safe list Message-ID: <20200116183121.GE22420@willie-the-truck> References: <20200116141912.15465-1-saiprakash.ranjan@codeaurora.org> <20200116153235.GA18909@willie-the-truck> <1a3f9557fa52ce2528630434e9a49d98@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 10:27:08AM -0800, Doug Anderson wrote: > On Thu, Jan 16, 2020 at 8:11 AM Sai Prakash Ranjan > wrote: > > On 2020-01-16 21:02, Will Deacon wrote: > > > On Thu, Jan 16, 2020 at 07:49:12PM +0530, Sai Prakash Ranjan wrote: > > >> KRYO3XX silver CPU cores and KRYO4XX silver, gold CPU cores > > >> are not affected by Spectre variant 2. Add them to spectre_v2 > > >> safe list to correct ARM_SMCCC_ARCH_WORKAROUND_1 warning and > > >> vulnerability sysfs value. > > >> > > >> Signed-off-by: Sai Prakash Ranjan > > >> --- > > >> arch/arm64/include/asm/cputype.h | 6 ++++++ > > >> arch/arm64/kernel/cpu_errata.c | 3 +++ > > >> 2 files changed, 9 insertions(+) > > >> > > >> diff --git a/arch/arm64/include/asm/cputype.h > > >> b/arch/arm64/include/asm/cputype.h > > >> index aca07c2f6e6e..7219cddeba66 100644 > > >> --- a/arch/arm64/include/asm/cputype.h > > >> +++ b/arch/arm64/include/asm/cputype.h > > >> @@ -85,6 +85,9 @@ > > >> #define QCOM_CPU_PART_FALKOR_V1 0x800 > > >> #define QCOM_CPU_PART_FALKOR 0xC00 > > >> #define QCOM_CPU_PART_KRYO 0x200 > > >> +#define QCOM_CPU_PART_KRYO_3XX_SILVER 0x803 > > >> +#define QCOM_CPU_PART_KRYO_4XX_GOLD 0x804 > > >> +#define QCOM_CPU_PART_KRYO_4XX_SILVER 0x805 > > > > > > Jeffrey is the only person I know who understands the CPU naming here, > > > so > > > I've added him in case this needs either renaming or extending to cover > > > other CPUs. I wouldn't be at all surprised if we need a function call > > > rather than a bunch of table entries... > > > > > > That said, the internet claims that KRYO4XX gold is based on > > > Cortex-A76, > > > and so CSV2 should be set... > > > > > > > Yes the internet claims are true and CSV2 is set. SANITY check logs in > > here show ID_PFR0_EL1 - https://lore.kernel.org/patchwork/patch/1138457/ > > I'm probably just being a noob here and am confused, but if CSV2 is > set then why do you need your patch at all? The code I see says that > if CSV2 is set then we don't even check the spectre_v2_safe_list(). You're not being a noob at all -- you're making the same point that I was trying to make :) So I think we can take this patch with the KRYO_4XX_GOLD part dropped. Will