From patchwork Wed Dec 30 03:23:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 11992915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87F15C433DB for ; Wed, 30 Dec 2020 03:25:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D57120782 for ; Wed, 30 Dec 2020 03:25:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726300AbgL3DZb (ORCPT ); Tue, 29 Dec 2020 22:25:31 -0500 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:41083 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgL3DZb (ORCPT ); Tue, 29 Dec 2020 22:25:31 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id BBC4C9FE; Tue, 29 Dec 2020 22:24:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 29 Dec 2020 22:24:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=4MYdTmaPFbfIp 2JehjVAudmUNN+0za867mNhsvApiQo=; b=w0m+HLjDLPTjyhXGsS7hqGaucbE1s qQZw61LaFryTPgXU7puFZTrW/FkQUUxO6zHErQEHSDaMW/ETQzuePdI4idJ6Voje pLDIDTu2aWThVfqwwf0eheBurVklUJhVin+0ju6uNWAs7Vb8AJaHIXbDrYYDsuv4 Ys7G91saQDfTDQgoemzAFjRjhuQDhlPOLlh0qye2yBQvpVISn1KqruapYuOsLcaS DKXAFV0ESk/vY7hIwUzwz5W73rBvXfEHwDUzNmReske5PXbySyf5At9+p3qfSGRf CKgGzcf7PjOV3NggZQy9AWDgeq+KUuWIVwXfkWEu5X6Hej24cHMyerq4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=4MYdTmaPFbfIp2JehjVAudmUNN+0za867mNhsvApiQo=; b=iwsh/Tpg /SuEtceUNp2bcq4TNUILvg5J69abZ+iTwRUCe0qmwsdQI3AfYXbItxmuwxBgQPdU RPuC301cva2beqTEuBybTHzKuCszknI0rDYsIGk+mX/m7ExV3QxhA5+i4kk0HvV5 4hkuaRNCchTRL0F3kdL9fxs3m6Miuu/yVmUV+obeI214+vydxVF+NuC2Nvn75PLF km10szXIbujhH65oxjuDp/cEmrK6jSPcBbxbIQajevt5f+FuSWe2vgppyxQoYojG 3CvANJeYVs/LFwDKrxqqdlzN+9zG8ax/h9noUIRgQacVsdYvGZIn+lKP96AxXGbn 2In3wuHOrqEy2w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvvddgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeflihgrgihu nhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqnecugg ftrfgrthhtvghrnhepjeeihffgteelkeelffdukedtheevudejvdegkeekjeefhffhhfet udetgfdtffeunecukfhppeeitddrudejjedrudekledrudejudenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhm X-ME-Proxy: Received: from strike.202.net.flygoat.com (unknown [60.177.189.171]) by mail.messagingengine.com (Postfix) with ESMTPA id B50581080057; Tue, 29 Dec 2020 22:24:18 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , WANG Xuerui , Alexey Malahov , Serge Semin , =?utf-8?b?5ZGo55Cw5p2wICha?= =?utf-8?b?aG91IFlhbmppZSk=?= , Paul Cercueil , Tiezhu Yang , Huacai Chen , YunQiang Su , Liangliang Huang , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] MIPS: cpu-probe: Vulnerabilities for Loongson cores Date: Wed, 30 Dec 2020 11:23:09 +0800 Message-Id: <20201230032314.10042-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20201230032314.10042-1-jiaxun.yang@flygoat.com> References: <20201230032314.10042-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Loongson64C is known to be vulnerable to meltdown according to PoC from Rui Wang . Loongson64G defended these side-channel attack by silicon. 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; break; default: panic("Unknown Loongson Processor ID!");