Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3789873ybi; Mon, 29 Jul 2019 12:40:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8mJCCh+NS7aVzd2amLEzB7N8zGgKX9d5e0SYVIEoz4Wdf0++hnCtcMcI+VJnbnNerXUZ0 X-Received: by 2002:a17:902:a40c:: with SMTP id p12mr111599039plq.146.1564429202048; Mon, 29 Jul 2019 12:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429202; cv=none; d=google.com; s=arc-20160816; b=LEdsNSJw1NoEsdRSRygJrCNF73jtzZUDu84Osz4OZx6yj79584VBE8VIlQimbjklan bSPHuJL+bqAMe/woPEaMAyWunX7gR1i01ODTiKam3FkB+csM5t81tEQjaXxNU8rUZo6o FQRxYXU235uLUBk8sNsWgAwRc/BysM2PXnj5zRQEBeNka4fp2n7aSbwDXIALoXk+ODMf FO3t3eCznVU8o/r8sCDht/xBloXE/1eFFZrxEMZ0v4CE8ZTkHcTEjJb+SRoEBz6dv50Q 4ixT389cQM+PoAJ7DTmTsoi6tPbOEAWS5+a3e1JogKeNYL1gHgRLQJLTGKnQiAqcceXT dBVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/4eHxodR+eeAkyC5pntlBcCHKbFRcyVDldLQQhctiRw=; b=ZWDHLa/y3fXifH5sW0pfosc0hgGEAb1gJrjAUqg0EOnLCnJKTt5YLDbpCN4/QStsug WveHUZGR7DYY5spuJXQABSdO8axi+Nq3mOYsDnLNwv0ejwbJ62vaoCKjVZmOMMDSQLCn 8AHPItzDsLKwZvVII8gb0s4c8geGbR/fmmlBMu6W1DzxgUCZrfGcA01zP0fJWNRpIMf5 63qOyeXpgk9a0YvxrDB7Ui4Vr6LqhWy9tL7zKLmWOWE2WhYyrFifKpk1xhgNUBHMG1h+ ClyoQQab3/gkErdQeZOwRHP5lUo90uwQOKZICRoCgkkcVhALbTfyRXRRExSN9SS8OWTe I0VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N/xhQeuN"; 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 f1si27998695pgc.144.2019.07.29.12.39.47; Mon, 29 Jul 2019 12:40:02 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="N/xhQeuN"; 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 S2388861AbfG2Ti2 (ORCPT + 99 others); Mon, 29 Jul 2019 15:38:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:53298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388847AbfG2TiU (ORCPT ); Mon, 29 Jul 2019 15:38:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1505D206DD; Mon, 29 Jul 2019 19:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429099; bh=TFqTnxju/RcqurZHbARZd4YhaMMzHJ+XMmRzD+1Pn2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/xhQeuNyTDvFFvixkj6VWehR6Wd17zMrLUBBJ9HJ+o7YFb8iArc9zA+ymaYbVva3 MkFr+hzlA8VbYWrAOcmALBOuqYK2j83b5JjEUaA0jIfColMwwexeY6cpL/H4Hy1HDI 8v/8kYAQ22+nDn7ahclP0O318Q6GHUuS4TMt3HBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhenzhong Duan , Thomas Gleixner Subject: [PATCH 4.14 285/293] x86/speculation/mds: Apply more accurate check on hypervisor platform Date: Mon, 29 Jul 2019 21:22:56 +0200 Message-Id: <20190729190846.089202270@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhenzhong Duan commit 517c3ba00916383af6411aec99442c307c23f684 upstream. X86_HYPER_NATIVE isn't accurate for checking if running on native platform, e.g. CONFIG_HYPERVISOR_GUEST isn't set or "nopv" is enabled. Checking the CPU feature bit X86_FEATURE_HYPERVISOR to determine if it's running on native platform is more accurate. This still doesn't cover the platforms on which X86_FEATURE_HYPERVISOR is unsupported, e.g. VMware, but there is nothing which can be done about this scenario. Fixes: 8a4b06d391b0 ("x86/speculation/mds: Add sysfs reporting for MDS") Signed-off-by: Zhenzhong Duan Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1564022349-17338-1-git-send-email-zhenzhong.duan@oracle.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1196,7 +1196,7 @@ static ssize_t l1tf_show_state(char *buf static ssize_t mds_show_state(char *buf) { - if (!hypervisor_is_type(X86_HYPER_NATIVE)) { + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { return sprintf(buf, "%s; SMT Host state unknown\n", mds_strings[mds_mitigation]); }