Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3802648ybi; Mon, 29 Jul 2019 12:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn5fzf5SztAUIburu5EtRObZons+Nwv4QrYwBZ6W6Cmmfh27kGdJtpfCdaLwKT9fasnlPu X-Received: by 2002:a63:ff20:: with SMTP id k32mr106061000pgi.445.1564430186254; Mon, 29 Jul 2019 12:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430186; cv=none; d=google.com; s=arc-20160816; b=Z5oAPu4eMZvFttSAEm/VfQhNqLlaGUerLu/WkqKL/leQ+C6HuJFrT/t4YUie0ofu1x LrWL7nsWfjbj/5yINJY9dEHjiHlc5hRNCs7qj7TYpu9U7SkR/hdsij1sL0tsRHclMiZq WVMyN93BXAU6wlo0SZwydZcZypwOcdy55ea0BZuGXn0athklniCaY9tDA7Wz6DEyHVOX Kw+fywH8iSknZgIYVsDkK6SC/IB6zfEpSl4yCiM4IBjHSkNkZRb+M+cUs7d5w3UB5Jj4 onIWy0panr1ju5UrzineGGRlATqNkX6NBkMRVDhp6fBrna2nJailDNSFP9V7DYCtxRGN iGCA== 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=ecGmg6OX82RibZrd9tQUhNsg7+HtvggoyQHHH7Tm1ZU=; b=oNTjfkZGk32KIpgH2gOhQI/LAMjmZ6y6S9cjIdkDPPbKEo3dUeAFj8Mi8GAOWbS2o2 oyGJv/yKezR3QmY48TgePVwigfP+DVmDNDPML5DyGynvKx/G01ZKMHsh3ByxVyEJTpRe 8XdU6KxH0NhupR7o9pX4f+snYdZ0xFpea4ibTVa3yWbtQTzFIeSWH03TdjSDJJiOoW1E mCGw5Zb+EklW0cAExL8YqXSZfk+X2SiVdDM3KSvYAM41SQVNbe4tjY+MqZFQRxDy9stX vklv5BFFfZy7KzAhi3j11gWrKNRDvymrbgRy9ZdGeqlV6L7XYa8Vrv+MhPnARPYgmqiW l0vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QdMPKt+s; 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 b7si28980288pfp.4.2019.07.29.12.56.10; Mon, 29 Jul 2019 12:56:26 -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=QdMPKt+s; 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 S2404049AbfG2Ty3 (ORCPT + 99 others); Mon, 29 Jul 2019 15:54:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:46908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403892AbfG2TyR (ORCPT ); Mon, 29 Jul 2019 15:54:17 -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 20F0A2054F; Mon, 29 Jul 2019 19:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564430056; bh=X18Vc15Nh0Gjp2oGGzefjyJtWpx+PSRKX+ddbBSp7Bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdMPKt+sa7bdO7nrZ3/WrtYR9nzMSQ0OVFEOtEeKwwcR04LI4ShFTT/KpQE8nmVj/ G6UEGsOzhK/4YFQ92vqkA85bLLw6cKZznnahLzWjTLrZfcQ4SmcdHo2dIhcDFxhih7 7knGEQL6Ft4LQvoth2ogdqQ2yxnRIcTp+C8cdAoM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhenzhong Duan , Thomas Gleixner Subject: [PATCH 5.2 182/215] x86/speculation/mds: Apply more accurate check on hypervisor platform Date: Mon, 29 Jul 2019 21:22:58 +0200 Message-Id: <20190729190811.703371775@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@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 @@ -1226,7 +1226,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]); }