[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-4.21] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 24 Sep 2025 13:00:51 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+bJS5bgeabBkmkOmKmzz/bgIFX1Wj9kkd8dwy01iarU=; b=SxEYAduI49iv0IrlA3Wgp8O0EV/vds8TIsXg7aNOffdX8BtbEqFHdTAaaAt7pZ/7MjYIAcUOD7Xwh/xCsHVo0JnrGNjHmwOQcMtP9WWY8mWEzMdj49VnAU8MGcEo/+sSoS26WZIco51ItrX8fYGY4S6poC/3M53ACHJYQwMB+zz3c9OvJIYu/mWxPtLgoHP/Py5cCoYX7rodi7ITmrjBYkGNnXwogp2n0jTo/UX7LPpDy0OL7WiU/Mo/H4UQXmxhZgNMVA0Q13yrHnBGmd0+d+o+/xkG4zF/jmobwGmo6Pghx65ezk+XQA6mMW5//3eETzAswn7CBlI0vuz4Eb0EIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O1bt6fDV12qlGhftPfp74ZjENhnLbRO2GgOzDND3c6ZiLfvSKjT0Bgp/hFsv7tvKHM8nRG8HbyfiXPqWU6c0ivFWetuM2Aa/vLV5V/9TQ6p23/Mp2q3LzSroHOKI05Q1dcmUaFZBLVm5Iu+rs0+5PC7XoLoHxdhdJ8KjWECpSG9lohNPIbIyOMUgg7LM6nu/JWwtoSX/e4QbKJB277sOYIHIerf688GBqWQ0of8sOX2CMGl0KwOPGtHNUk5RR9o7HCumPjgTBHuKS9L82Uksyer1iZ0KnPuj5nLgHH+fWr4ERe1+e861xFhHsaVZzMfomig85z9sXyz1JsAuYT3eTw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: oleksii.kurochko@xxxxxxxxx, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 24 Sep 2025 11:01:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Otherwise the check for the SS feature in
check_memory_type_self_snoop_errata() fails unconditionally, which leads to
X86_FEATURE_XEN_SELFSNOOP never being set.

We could also avoid this by not doing the reset_cpuinfo() for the BSP in
identify_cpu(), because SS detection uses boot_cpu_data.  However that
creates an imbalance on the state of the BSP versus the APs in the
identify_cpu() code.

I've opted for the less controversial solution of populating FEATURESET_1d
in generic_identify(), as the value is already there.  The same is done for
the AMD faulting probe code.

Fixes: f2663ca2e520 ("x86/cpu/intel: Clear cache self-snoop capability in CPUs 
with known errata")
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/cpu/common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 530b9eb39abc..35dcdf0c8801 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -490,6 +490,9 @@ static void generic_identify(struct cpuinfo_x86 *c)
        c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
        c->phys_proc_id = c->apicid;
 
+       /* Early init of Self Snoop support requires 0x1.edx. */
+       c->x86_capability[FEATURESET_1d] = edx;
+
        eax = cpuid_eax(0x80000000);
        if ((eax >> 16) == 0x8000)
                c->extended_cpuid_level = eax;
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.