All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.21] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
@ 2025-09-24 11:00 Roger Pau Monne
  2025-09-24 11:50 ` Andrew Cooper
       [not found] ` <2d17d2d502df489f97b51e43a2d86535@DM6PR03MB5227.namprd03.prod.outlook.com>
  0 siblings, 2 replies; 10+ messages in thread
From: Roger Pau Monne @ 2025-09-24 11:00 UTC (permalink / raw)
  To: xen-devel; +Cc: oleksii.kurochko, Roger Pau Monne, Jan Beulich, Andrew Cooper

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@citrix.com>
---
 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



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-25 20:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 11:00 [PATCH for-4.21] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection Roger Pau Monne
2025-09-24 11:50 ` Andrew Cooper
     [not found] ` <2d17d2d502df489f97b51e43a2d86535@DM6PR03MB5227.namprd03.prod.outlook.com>
2025-09-24 13:40   ` Roger Pau Monné
2025-09-25  7:03     ` Jan Beulich
2025-09-25  7:34       ` Roger Pau Monné
2025-09-25  7:37         ` Jan Beulich
2025-09-25  7:40           ` Roger Pau Monné
2025-09-25  7:41             ` Jan Beulich
2025-09-25  8:11               ` Roger Pau Monné
2025-09-25 20:43                 ` Oleksii Kurochko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.