Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3712477pxv; Mon, 26 Jul 2021 10:01:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo+pDJ9TkUOjQRZjJgqH6V+5nUwA2z5DoaaUCYlxHpKWVDZrDTCzMSKdq0HJYc/LZX4f9K X-Received: by 2002:a17:906:dc90:: with SMTP id cs16mr17124378ejc.368.1627318904268; Mon, 26 Jul 2021 10:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627318904; cv=none; d=google.com; s=arc-20160816; b=XdiU+oSGUuU1ld9S/qMFaY0ntp9GqzxTtI6nMqbVr47fW1rXIDdlOhzzl2w9SviXfD ZPEnDJfVe2L7BhpaXxN3KsDA4slOWyK0RgU8z6HoXA6jo1VGxQUbY5fkuePwQwKeZxTC hXu6hzd43vdhjjoj7Aj0QlaEmdqNdIVmNMOaSM+kU4hg7hIq/RE0sh8phAG4o/QDL2+F JLHLR2Lr+ck4RWqSAAdsvFIMbXBeWADVPcMco5u1OpcyFFUTzQAC9DtiNqFBv8CiI5Xx zey3ipty8zkKNKvcd/WHCKWwksrbo3rct2Juh9IftyVr1VSUT3nsc7V4e7EpX8eWB+7o Jnkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wlsoevb6YkqCBGuDPG7KSty25DhxBo6V4H/IUHwcTWM=; b=nSVI/yf0OeQqTc6G+jzpcAfJIvIJdFd+azhSwc+UEvVtGk2Xrq9rGf03xFWiTZE7hN afkUTF1zYzBiOLryx+O+Q42xNNaoKcAZeAWgEP21jGut6YWzuXYvsfP3wzt7vxMP3OQS MVpgLMRMcZX/S4yRiISj2pafaLLDauhTzZh0d9x/znvRRWsg7P3sz4564Kvnd4WanN+u hVZUozvwBrtRam+A55UlmKfiEKo5ejJ5RKKkvZRNIj54KrzGGU2uO3JI/MiEJ6Qt6Uqg C08S80bSICcv8shSIW/2gICI33E8hfpExswunYIoBgDUBauPrEBpwmYmamK3N5sqo6bt jt9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2DCILoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si404197ejj.438.2021.07.26.10.01.15; Mon, 26 Jul 2021 10:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2DCILoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234836AbhGZPhZ (ORCPT + 99 others); Mon, 26 Jul 2021 11:37:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237149AbhGZPV3 (ORCPT ); Mon, 26 Jul 2021 11:21:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5847A60240; Mon, 26 Jul 2021 16:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315317; bh=6A1Jy6mKXB8jp4mY76FDi8XWLRdUOVRpEFn976aENoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2DCILoJCwkAexFbXwvcMKTuwAc88Oq/IuMX1piC/xpftiP8dLUjCcDzAl+38khbM tVG45sEpeEuUlHr3kMLA3abIEOnv53xYpxWgsDw+b/Pj4j5SB/HWZLPWSIDJFqoo94 ioMtmYDba8xr+n2Iu8u9Np3gcy5dSTb6hrgeDAvA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Like Xu , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.10 032/167] KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM Date: Mon, 26 Jul 2021 17:37:45 +0200 Message-Id: <20210726153840.469133088@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153839.371771838@linuxfoundation.org> References: <20210726153839.371771838@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Like Xu [ Upstream commit 7234c362ccb3c2228f06f19f93b132de9cfa7ae4 ] The AMD platform does not support the functions Ah CPUID leaf. The returned results for this entry should all remain zero just like the native does: AMD host: 0x0000000a 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000 (uncanny) AMD guest: 0x0000000a 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00008000 Fixes: cadbaa039b99 ("perf/x86/intel: Make anythread filter support conditional") Signed-off-by: Like Xu Message-Id: <20210628074354.33848-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/cpuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 7a3fbf3b796e..41b0dc37720e 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -684,7 +684,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) edx.split.num_counters_fixed = min(cap.num_counters_fixed, MAX_FIXED_COUNTERS); edx.split.bit_width_fixed = cap.bit_width_fixed; - edx.split.anythread_deprecated = 1; + if (cap.version) + edx.split.anythread_deprecated = 1; edx.split.reserved1 = 0; edx.split.reserved2 = 0; -- 2.30.2