Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4082041ybi; Mon, 29 Jul 2019 18:52:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyI8P+dM3kwRn0AAWFt6C6Y+rYLTQjJMnYXgeJQo8SNGyV2ejOEy3JqSOfNc2ryeycfEfLt X-Received: by 2002:a63:eb56:: with SMTP id b22mr108296525pgk.355.1564451534674; Mon, 29 Jul 2019 18:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451534; cv=none; d=google.com; s=arc-20160816; b=Oj1IUQeWetfoxC1omE8lG4K3FyiqUioo2wtApdUKxaYLdISKn1TjEkFqjjQuFeJ3G3 NwE5rVh6z2oLUC3cY2fN77ot8oDLdwRs6o5l8t+7dL8OxM9gGGkQcVBn1kTwU4/ANnr7 spc3ZWtO3EE0XgoxixBMbUWJ5Q500aNB4IgcqJ68RggoOJ93pQ1hE+SgFDYCZCbkzsum IfPzvMqXI8HtOryCp/7CEFpG7BAX1+CIQWUcnT+NpJe1eGkeBxFy526eA90GOhDihofU krQKus8w9ooh5l1hZrDpfBm7G1AdjG5eQwRgJ28WslTw23/rnBXg4eXqrdAAeyZgibj9 7RqA== 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=vSdNoIP5a1s5u1ghrEaNH7g6RlffS2PKCMEL+ZEYyzCK09t5jHhU2lLsUZTN/iey7r WX84ui33/mxJP/sSUeM46hg4O85C7PJLxyXFXRFdoAWum+g8PXDf0HovRz1QlHSw/rwH dNRp58GuC2+R12PTFuzS/HOXOAWb5yaFK2YwLvLcGzYyPmkeqmV4SCOyHhlWz2BuHj9C iYYGWgnjKVQ3k/B86rgfzEom5q11CLldhCF8cJI80N3YEdCy9SU8T8kiLQ3jjAkeEdng SUHUAiE6x9yCUmbx8qbJqIY8vuHlCj+L7+UVkUPx7ZKjdlBkTrxQaLuDShABZ0YmaHVS FUqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uOikIoM5; 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 x3si7852773plb.164.2019.07.29.18.51.59; Mon, 29 Jul 2019 18:52:14 -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=uOikIoM5; 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 S2389780AbfG2ToU (ORCPT + 99 others); Mon, 29 Jul 2019 15:44:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:32804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389687AbfG2ToP (ORCPT ); Mon, 29 Jul 2019 15:44:15 -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 2C8A5217D7; Mon, 29 Jul 2019 19:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429454; bh=TFqTnxju/RcqurZHbARZd4YhaMMzHJ+XMmRzD+1Pn2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOikIoM5tlDe1fmOGUl8wTL5gFBeSVFxIu8nNxsTl1STYgn6sqWeaaKKQdtcKZt5+ Fbz2CyhMU87iJXcMcw4NAlS+1wH3IcA7hnF596gmB71t8Jnou11defTXWHYsbvGzun YtdawqrH+/wrTMwwVieD/Zp6T9M+yU7AkeBWnk6E= 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.19 102/113] x86/speculation/mds: Apply more accurate check on hypervisor platform Date: Mon, 29 Jul 2019 21:23:09 +0200 Message-Id: <20190729190719.902947322@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@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]); }