Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7036607ybl; Wed, 15 Jan 2020 14:26:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxQjGA2vWhjM//zSRTPInRoPkljlsujmImh3aNWDsQwu7tV+mBYoJ+sR9Lnz943hPrtPwTt X-Received: by 2002:a9d:6ac1:: with SMTP id m1mr4376957otq.101.1579127185766; Wed, 15 Jan 2020 14:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579127185; cv=none; d=google.com; s=arc-20160816; b=EzmQDbHwu0TNKEJc7AUIK5+IjbQqvBJ/zuGyebTePG31pq94ndQMqMATjt8cgT1YHM QctFeJYW8zevdHKOpMh+kGpn/083VW9eXzGeKcMpjRpxDpVaVaKv4IlgVUogGlx41jGL 3WVYSQ9lRZ8fZqBgvO4fMDgnu3khyjFpg7B45QRLitep0jcVLjN5rMHuiSFW2CKzUB7J eoGdIwU+CGjFB4jj4ulqMXSm7HWo2HauKLMkPbXCjqCZ5qBkszbJoK6n58mxmIsFufUs qkPyppahtsKX0EiL+ay3I4rJ/meshDoBn+usPKI2cnrBfn6NfATmvhQfLvTPObqoSrEx mHGQ== 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=4BhJ5C8RAPBXKkCMWTq+VKLAYGSrz2ezsgJwk06jt4o=; b=vu/bvq/tUXHlWYM7b2MnoYHRbPVeL3lAp8GvvAPQabURRbZTBdeRcVTCU5u3xD2cWT wVXAbt86JtkJkHYa/vqULxAYOw1avck9rs7PCVymOYkR4HDN1fwfvEZAB3Ag7Ekcwkfo Uwd7s5i3JydZZCEazQo7uwOHTflaQ/yX1yByTwxA66Hy914VzOlnjPJPl5zB6hp04E/b ezV4UYggYSRTHChMpYRzyf52GrKma7ggP9br+aeyGEcVnZX79hrJDgZFzJEZ2WCVFbMm yZjwh4gh+rEVGAVv2yzA7B8wAthqvNrxv/X1XJh7dDMaTjJw3NfBwKacR6mlnoduoUvz PKGw== 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 j24si12671737otk.76.2020.01.15.14.26.13; Wed, 15 Jan 2020 14:26:25 -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 S1730424AbgAOWTz (ORCPT + 99 others); Wed, 15 Jan 2020 17:19:55 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:49401 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728899AbgAOWTz (ORCPT ); Wed, 15 Jan 2020 17:19:55 -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 1irr0v-0002IC-V0; Wed, 15 Jan 2020 23:19:50 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 0D22D101228; Wed, 15 Jan 2020 23:19:49 +0100 (CET) From: Thomas Gleixner To: Tony W Wang-oc , mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Cc: DavidWang@zhaoxin.com, CooperYan@zhaoxin.com, QiyuanWang@zhaoxin.com, HerryYang@zhaoxin.com Subject: Re: [PATCH] x86/cpu: clear X86_BUG_SPECTRE_V2 on Zhaoxin family 7 CPUs In-Reply-To: <1579075500-7065-1-git-send-email-TonyWWang-oc@zhaoxin.com> References: <1579075500-7065-1-git-send-email-TonyWWang-oc@zhaoxin.com> Date: Wed, 15 Jan 2020 23:19:49 +0100 Message-ID: <87h80wxsze.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 W Wang-oc writes: > These CPUs are not affected by spectre_v2, so clear spectre_v2 bug flag > in their specific initialization code. > > if (cpu_has(c, X86_FEATURE_VMX)) > centaur_detect_vmx_virtcap(c); > + > + if (c->x86 == 7) { > + setup_clear_cpu_cap(X86_BUG_SPECTRE_V2); > + clear_bit(X86_BUG_SPECTRE_V2, (unsigned long *)cpu_caps_set); No. Please use cpu_vuln_whitelist. It exists for exactly this purpose. You just need to extend it with a NO_SPECTRE_V2 bit. Thanks, tglx