Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8111644ybl; Thu, 16 Jan 2020 10:50:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxzXCfiPqsM14uVlLeSfVRJXRfQ/Kwmf7qzl48YOvq+Vdl26VdvTe+xXPB4YuNbrsTQSht/ X-Received: by 2002:aca:4782:: with SMTP id u124mr364266oia.93.1579200600662; Thu, 16 Jan 2020 10:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579200600; cv=none; d=google.com; s=arc-20160816; b=LBK7KWTIXf/34kQgPyOyUnLdila2S0k6UXFe7DaRTcybQ/KKGSjqgMqkT2jrlp0CvC FaUELdb8pw+i2Xqvt7z8TphOkGDmkB1TBI6pCR67yOPQbd69sHPMA4LMvjbJOWDyfOVA fvi5TyW4UVFS6G2Ar2Vnpi8cmaFHY19E8Ww/jURJqErIJ3Pr73/U22vAfnIFuCyRJh78 maOgEQaMmukdFfznKaHE4EJ9SQ9HG7GeFCQzAgxBPGRd+0GXUkEGilxGYyvEI19bC0ob 9MwdYeZMmGqAbG7j8YeLxkJgAH3VcJpE1wUVmPAyesgxuHiSJOeDo7FuNS0VD4/Q7XB5 QZBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=/6BwDsiUe187CSSqa0gJk7SMvHp5dDt+A535pkRclvU=; b=WRPRUryYpxBLTphqwxXLhvIjPYMtBgeTb0D9y3cbWxC1olAq+SgmFVN+IaBawmfQQw 8a4O8tZOY5VQzes5oSCnQh/HcPXpnwgIyGL0gOj+je3wiU6H99Jhvn1agmVaOqJE9rH2 ZcFFftJOVYuITbREVu5FZfHazAdfmZCtVZa0J2X1EgvdJQsppRuqh69mm4/3SzUlRz3D 1oRqdcWgX9VYSWgOCFMdMuySQCjSmmkmcROQel+/ClUO68QZowaJVm9pj7q+gVS+Lz3W ZAga/JnVuWAc5f0Njyjc0lDIsxVPGhX9zm09qi51yGiZkCXnTP1pRSXyaFL/TdlllWwH 01nw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si11441781oig.71.2020.01.16.10.49.49; Thu, 16 Jan 2020 10:50:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436737AbgAPSsd (ORCPT + 99 others); Thu, 16 Jan 2020 13:48:33 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52606 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389726AbgAPRJp (ORCPT ); Thu, 16 Jan 2020 12:09:45 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1is8e8-0006kl-62; Thu, 16 Jan 2020 18:09:28 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 9EA5C101226; Thu, 16 Jan 2020 18:09:27 +0100 (CET) From: Thomas Gleixner To: Tony W Wang-oc , mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, luto@kernel.org, pawan.kumar.gupta@linux.intel.com, peterz@infradead.org, fenghua.yu@intel.com, vineela.tummalapalli@intel.com, linux-kernel@vger.kernel.org Cc: DavidWang@zhaoxin.com, CooperYan@zhaoxin.com, QiyuanWang@zhaoxin.com, HerryYang@zhaoxin.com Subject: Re: [PATCH] x86/speculation/spectre_v2: Exclude Zhaoxin CPUs from SPECTRE_V2 In-Reply-To: <1579146434-2668-1-git-send-email-TonyWWang-oc@zhaoxin.com> References: <1579146434-2668-1-git-send-email-TonyWWang-oc@zhaoxin.com> Date: Thu, 16 Jan 2020 18:09:27 +0100 Message-ID: <87r1zzuy48.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tony, Tony W Wang-oc writes: > @@ -1023,6 +1023,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) > #define MSBDS_ONLY BIT(5) > #define NO_SWAPGS BIT(6) > #define NO_ITLB_MULTIHIT BIT(7) > +#define NO_SPECTRE_V2 BIT(8) > > #define VULNWL(_vendor, _family, _model, _whitelist) \ > { X86_VENDOR_##_vendor, _family, _model, X86_FEATURE_ANY, _whitelist } > @@ -1084,6 +1085,10 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = { > /* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */ > VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT), > VULNWL_HYGON(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT), > + > + /* Zhaoxin Family 7 */ > + VULNWL(CENTAUR, 7, X86_MODEL_ANY, NO_SPECTRE_V2), > + VULNWL(ZHAOXIN, 7, X86_MODEL_ANY, NO_SPECTRE_V2), > {} > }; > > @@ -1116,7 +1121,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) > return; > > setup_force_cpu_bug(X86_BUG_SPECTRE_V1); > - setup_force_cpu_bug(X86_BUG_SPECTRE_V2); > + > + if (!cpu_matches(NO_SPECTRE_V2)) > + setup_force_cpu_bug(X86_BUG_SPECTRE_V2); That's way better. But as you might have noticed yourself this conflicts with the other patch which excludes these machines from the SWAPGS bug. Granted it's a trivial conflict, but maintainers are not there to mop up the mess others create. So the right thing here is to resend both patches as a patch series with the conflict properly resolved. Thanks, tglx