Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11382917pxu; Thu, 31 Dec 2020 07:56:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw82/K8mSerZqrqJRJ4PW/lxtK++J4DEa67IuN7hy4fDjfllwAwRHjJe7HBT39nS1zQHy48 X-Received: by 2002:a50:9f4e:: with SMTP id b72mr56050616edf.200.1609430172163; Thu, 31 Dec 2020 07:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609430172; cv=none; d=google.com; s=arc-20160816; b=m+4PksetoV9/8IiwGxu3K1D+1R7jUd/iH/My5zRyf8+5hFderqpEk3El5hbN20lc4P ZWS69uHaZ1u1xSJOmuO/qordQ/rppFmQHWf/goqD6R1G1EbItNRegWyb/HKus0Hatp2Q +mIf8Z8D03LYPstdR0CARwItH2a7yvvmVsLXHyf5CogRczEsBuE2L2O1zWVKSZP6Wbsy p3hd2Vl5mS8lIpwRWcNnb+1TnWlmltNSGDr1XhQX9yDemdz5mSfdxxQuymGaMhGFGP8H 5js5aALZkEvq7KzqSDo7IFTx0NYV+jBH6dAvimKu1M770f/Nxf9C7PKA3LxhV80e6OEd Gpfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8V0295OSpOCkDe8FjBWOrtJO1w/sWalYtBsA3euSp50=; b=o+iIIEmki449SzNcoF9yNUaJy6SucYb789aVKAdgcomTZVEQKR2D8js8rbYg5R//eN WKz0l9gv1FT2sO9FIcPhKJ8HU5AvPm4m8ZQqM3I6VqY1B5+NV1Bl52mnoDCTN7BOq+F4 cDbnjg2KsNslddMnT0bK+ZkBFmeTul9rL9uXUJBOaih7fCo3qbQ8+8q0r/d+gzwKe8D4 xa70xqJoes0OQfjBsG1Kjv1zjEaZVi3DKPRUuVYPAAqAtJoftJp4/5vUe72aLwG1SqMq m5rHrOqwYmr+tFr1OKRe9rFf4M00FmWKLlwYyfJJIzo0sQVBkC2CarIQH1FKHJXLevNq cnkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@xen0n.name header.s=mail header.b=O6kiwj0u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si25897108ejd.135.2020.12.31.07.55.49; Thu, 31 Dec 2020 07:56:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@xen0n.name header.s=mail header.b=O6kiwj0u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbgLaPwF (ORCPT + 99 others); Thu, 31 Dec 2020 10:52:05 -0500 Received: from [115.28.160.31] ([115.28.160.31]:35126 "EHLO mailbox.box.xen0n.name" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726949AbgLaPwE (ORCPT ); Thu, 31 Dec 2020 10:52:04 -0500 X-Greylist: delayed 458 seconds by postgrey-1.27 at vger.kernel.org; Thu, 31 Dec 2020 10:52:04 EST Received: from [192.168.9.172] (unknown [101.224.80.228]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 9D7D46055B; Thu, 31 Dec 2020 23:43:52 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=xen0n.name; s=mail; t=1609429432; bh=B3l951PoCELSmDmy9JRHTJi8RD9bCtC5i1o2HvaeKf0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=O6kiwj0u2KBO6lq530bnd+F5T+DzWbY1FEeyneBxcDXv/rQJ/IXT+3IGkLKrVoY87 6AqONuZW3WkS/qBK9zwhw8xvIt+sO8mYv6WLJSniWB7IGeUFVPtD4aQc2tNSS8NoVT rw6LEdAZu9oPloQ4xkVT/dhQ1ITB7lbH5VoEHuVc= Message-ID: Date: Thu, 31 Dec 2020 23:43:51 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0a1 Subject: Re: [PATCH 3/3] MIPS: cpu-probe: Vulnerabilities for Loongson cores Content-Language: en-US To: Jiaxun Yang , linux-mips@vger.kernel.org Cc: Thomas Bogendoerfer , Alexey Malahov , Serge Semin , =?UTF-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , Paul Cercueil , Tiezhu Yang , Huacai Chen , YunQiang Su , Liangliang Huang , linux-kernel@vger.kernel.org References: <20201230032314.10042-1-jiaxun.yang@flygoat.com> <20201230032314.10042-3-jiaxun.yang@flygoat.com> From: WANG Xuerui In-Reply-To: <20201230032314.10042-3-jiaxun.yang@flygoat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiaxun, On 12/30/20 11:23 AM, Jiaxun Yang wrote: > Loongson64C is known to be vulnerable to meltdown according to > PoC from Rui Wang . > > Loongson64G defended these side-channel attack by silicon. "Loongson64G mitigated it in hardware"? > > Signed-off-by: Jiaxun Yang > --- > arch/mips/kernel/cpu-probe.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c > index 2460783dbdb1..24b21f51353c 100644 > --- a/arch/mips/kernel/cpu-probe.c > +++ b/arch/mips/kernel/cpu-probe.c > @@ -2092,6 +2092,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) > c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM | > MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2); > c->ases &= ~MIPS_ASE_VZ; /* VZ of Loongson-3A2000/3000 is incomplete */ > + c->vulnerabilities |= MIPS_VULNBL_MELTDOWN; > + c->vulnerable |= MIPS_VULNBL_MELTDOWN; > break; > case PRID_IMP_LOONGSON_64G: > c->cputype = CPU_LOONGSON64; > @@ -2100,6 +2102,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) > set_isa(c, MIPS_CPU_ISA_M64R2); > decode_cpucfg(c); > c->writecombine = _CACHE_UNCACHED_ACCELERATED; > + c->vulnerabilities |= MIPS_VULNBL_MELTDOWN | > + MIPS_VULNBL_SPECTRE_V1 | MIPS_VULNBL_SPECTRE_V2; Of course you forgot to set the "mitigated" mask... Oh wait. It seems the "mitigated" mask in the 1st patch is never used, so either code there or here must be amended. > break; > default: > panic("Unknown Loongson Processor ID!");