Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10935290pxu; Wed, 30 Dec 2020 16:35:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2672u9wLe6n0Q7PzMCigkJClqa700PNim9ydH5s8EdfWHh+mZaIM8qePCSpqTAOC6Kn6L X-Received: by 2002:a05:6402:3048:: with SMTP id bu8mr52816415edb.49.1609374914837; Wed, 30 Dec 2020 16:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609374914; cv=none; d=google.com; s=arc-20160816; b=bNRGaEqccEj/+6QXDx1GxVRKuNpmOtNlUCWommJhr8MGsFuGGfFixUbL2kTSJmSgfT 15vy/GqmNCWLwZqRI956Qfinyh2qNmB8vSx6+Jp3fpt5KkiPFpAd7P4g796Tsx9s77g9 1VB2FDVqUDheHEhSjZNBvLCgTgugwH6hCQCHJASlXRp/018H0AAUszU5cBgkVQrC1E7T oRTYYqwGI5C7lW5ncIWBVrEqKFBiJPbATD6u1XnqNDr4uAecXv7DahWJEhjcmxRfOwks 2BPs/GyEMwt00MD4dCd77Qz8NG4W6yqUsc3Y+amV/2nfG8r5k7RGJAKXCr0cjav03EFC 8iCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nfyo0tLIWLPjPOvffLyAF7WIC2nKWvnqvYeUJW9VGNs=; b=TBLA1zveaL+ApGcOuko/WoWjjeZiIqWqOkse4h57EPj3uhX1q1qNBptS+9R1hS3uM/ Jotna36OHxnD9MSklA9kW1pOrPWk8XC9oZhBhmoEJvj6ss0+itnuZ3Q0zBfutxu7XPDz k8QGN+j/PEfynN1wHN8vvC6emapIcShWaxAwOJEQ7CWCXP/OHo/BAHz2nXGBUDUsbBgG tEV4wsxVj/LO/uHnBdUeaktLpomlD83qUhfBSpfm5yERQmQUDEURP5EW57yCfITe5svZ Bvv2P3PDoYrXRwIJg/HT4KUokf2yz8d/LhZGK6L7jKz5Ddfs8g7X/YaPI8o8AVEjVAmI FnZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=omcCgltD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x27si22546931ejb.485.2020.12.30.16.34.51; Wed, 30 Dec 2020 16:35:14 -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=pass header.i=@kernel.org header.s=k20201202 header.b=omcCgltD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbgLaAeK (ORCPT + 99 others); Wed, 30 Dec 2020 19:34:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:57034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbgLaAeI (ORCPT ); Wed, 30 Dec 2020 19:34:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0BE522227; Thu, 31 Dec 2020 00:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609374807; bh=YvoZijVIuexSHAs+IQ8IRrUPZpDueM3kvQ5ZKWpPiJI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=omcCgltDx5ErCq/0sQtz1GNADqmso4RNI28oKTSL1Hoki4/hEa5JWncgLvHtTtepx UfBtRZL/hIADf1E787YyT2rgpQpKxB0ei2Mei7ETkAI4ZEmIf2NEEda7PMzmpZguzc rP8cYaFlLq7ONbO+tjalbao4ZEZl6L7yXP1eFE/O34HxzBaWive0/I5iSI5iNRvsGp melPelPzHpQE9iBqUBmVlVfXPRoPRnIQbYuoD35NDdfpVHdpbZPPJWWfyRe4TAc2lm lVm+y44IG9+rxLZcvr9CP6Hxs+TXvx6a3+fpKqFjumlQ39Z8PBI1IBWzZ+IEOjqBOb 0I5DvRETGGfaw== Received: by mail-io1-f53.google.com with SMTP id 81so15996545ioc.13; Wed, 30 Dec 2020 16:33:27 -0800 (PST) X-Gm-Message-State: AOAM531QvtZwCTrUzRymWTTfG1kYYt7Z2O7+hXoGFcWIhsY53uBeYdEc RqbDI3a/oX0qcQGBxLhlW43D/uIuuhDN1KgFCzY= X-Received: by 2002:a02:c9cf:: with SMTP id c15mr47817173jap.57.1609374807095; Wed, 30 Dec 2020 16:33:27 -0800 (PST) MIME-Version: 1.0 References: <20201230032314.10042-1-jiaxun.yang@flygoat.com> <20201230032314.10042-3-jiaxun.yang@flygoat.com> In-Reply-To: <20201230032314.10042-3-jiaxun.yang@flygoat.com> From: Huacai Chen Date: Thu, 31 Dec 2020 08:33:15 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] MIPS: cpu-probe: Vulnerabilities for Loongson cores To: Jiaxun Yang Cc: "open list:MIPS" , Thomas Bogendoerfer , WANG Xuerui , Alexey Malahov , Serge Semin , =?UTF-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , Paul Cercueil , Tiezhu Yang , YunQiang Su , Liangliang Huang , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jiaxun, On Wed, Dec 30, 2020 at 11:26 AM Jiaxun Yang wrote: > > Loongson64C is known to be vulnerable to meltdown according to > PoC from Rui Wang . How about Loongson-3A1000/3B1500, and Loongson-2E/2F? Huacai > > 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!"); > -- > 2.30.0 >