Received: by 10.223.185.116 with SMTP id b49csp6090294wrg; Thu, 8 Mar 2018 01:26:19 -0800 (PST) X-Google-Smtp-Source: AG47ELvjF9KcITiD3GbbArQCOmbXIgSN8YNzy/wZ8Qgkw+fqSW8CQR9bYxCoXk14/eCUc4yqTNOl X-Received: by 2002:a17:902:8bc3:: with SMTP id r3-v6mr23267423plo.450.1520501179615; Thu, 08 Mar 2018 01:26:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520501179; cv=none; d=google.com; s=arc-20160816; b=J+2+Bg7FrsLzDrrDRg22oRksNQJR2BvZCl+r4nn8aa8dGXlB7b+o2fzOas30pYu2Na iZQk0bocdfjUwztfmJIynUKeRZzTO39zzTiFCzktK9nOEGGdpqYWzOBfZGvDfauRlOTL 0wO64inyUSlcq7epUkrd7IZLs8GwzvkJE711Y6dVEzOBnfklEcnoE7YUM27M/McQQGo2 zpauWGiCGy1JKZUbaE4c+mbl6DWSc1hMpkz5YDIy3eCNnCxI+MW4PvgCR+rXhu6wjsCH /tt1fijVd9h4CSE9JfLpkM9sHtp/jJA4kOQSGHqPEa2/toG7AwARQvF1rOrzSPPouYFD AOng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=fa/qoioIIQZp1CzF78ZELIIocCa5Qohbn6yEbWYJHVA=; b=lHt+V8YrMdgffHJnV0u65FVfbCpZavQcE2vyGv7NjwF6CEXAgsX+S1vU2pU33mY2L8 Qm/rLmlw6GjKaH02H0BMTi3YaqtbraYVkovgU8oYHnaZFMRnfA70NzvLG9F2/jQZ44Lj /F/bsI6da3pWk5keQ+/hn8Dt8hhwINzuaffnciCYYp5LTEikYz7GJfqcJxWRmOx7lkrO JROCIFpDf+CTMJ2bUbIqXJa2J1Q0whQHiX1AWtr8B/3cEr5VT7stoeWLDdgeZSzknsZD NX6FHTqC/WIUvwikjcgenGtgA+gJchYrSQ96OHGSV2iPJ6WTJflrNpRCc5B+QtTBtlWc ECPQ== 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 i131si12798949pgc.186.2018.03.08.01.26.04; Thu, 08 Mar 2018 01:26:19 -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 S1755448AbeCHJZL (ORCPT + 99 others); Thu, 8 Mar 2018 04:25:11 -0500 Received: from terminus.zytor.com ([198.137.202.136]:54201 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751374AbeCHJZH (ORCPT ); Thu, 8 Mar 2018 04:25:07 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w289Op0a027197; Thu, 8 Mar 2018 01:24:51 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w289OoaE027194; Thu, 8 Mar 2018 01:24:50 -0800 Date: Thu, 8 Mar 2018 01:24:50 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Konrad Rzeszutek Wilk Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, konrad.wilk@oracle.com, kernellwp@gmail.com, pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org Reply-To: konrad.wilk@oracle.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, bp@alien8.de, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, pbonzini@redhat.com, kernellwp@gmail.com In-Reply-To: <20180226213019.GE9497@char.us.oracle.com> References: <20180226213019.GE9497@char.us.oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/spectre_v2: Don't check microcode versions when running under hypervisors Git-Commit-ID: 36268223c1e9981d6cfc33aff8520b3bde4b8114 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 36268223c1e9981d6cfc33aff8520b3bde4b8114 Gitweb: https://git.kernel.org/tip/36268223c1e9981d6cfc33aff8520b3bde4b8114 Author: Konrad Rzeszutek Wilk AuthorDate: Mon, 26 Feb 2018 09:35:01 -0500 Committer: Thomas Gleixner CommitDate: Thu, 8 Mar 2018 10:13:02 +0100 x86/spectre_v2: Don't check microcode versions when running under hypervisors As: 1) It's known that hypervisors lie about the environment anyhow (host mismatch) 2) Even if the hypervisor (Xen, KVM, VMWare, etc) provided a valid "correct" value, it all gets to be very murky when migration happens (do you provide the "new" microcode of the machine?). And in reality the cloud vendors are the ones that should make sure that the microcode that is running is correct and we should just sing lalalala and trust them. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner Reviewed-by: Paolo Bonzini Cc: Wanpeng Li Cc: kvm Cc: Krčmář Cc: Borislav Petkov CC: "H. Peter Anvin" CC: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180226213019.GE9497@char.us.oracle.com --- arch/x86/kernel/cpu/intel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index d19e903214b4..4aa9fd379390 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -144,6 +144,13 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c) { int i; + /* + * We know that the hypervisor lie to us on the microcode version so + * we may as well hope that it is running the correct version. + */ + if (cpu_has(c, X86_FEATURE_HYPERVISOR)) + return false; + for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { if (c->x86_model == spectre_bad_microcodes[i].model && c->x86_stepping == spectre_bad_microcodes[i].stepping)