All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v2] x86/AMD: unbreak CPU hotplug on AMD systems without RstrFpErrPtrs
@ 2019-12-03 23:56 Igor Druzhinin
  2019-12-04  9:13 ` Jan Beulich
  2019-12-10 10:10 ` Jan Beulich
  0 siblings, 2 replies; 7+ messages in thread
From: Igor Druzhinin @ 2019-12-03 23:56 UTC (permalink / raw)
  To: xen-devel; +Cc: jgross, Igor Druzhinin, wl, andrew.cooper3, jbeulich, roger.pau

If the feature is not present Xen will try to force X86_BUG_FPU_PTRS
feature at CPU identification time. This is especially noticeable in
PV-shim that usually hotplugs its vCPUs. We either need to restrict this
action for boot CPU only or allow secondary CPUs to modify
forced CPU capabilities at runtime. Choose the former since modifying
forced capabilities out of boot path leaves the system in potentially
inconsistent state.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
Changes in v2:
- pick the former approach instead of the latter
---
 xen/arch/x86/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fec2830..8b5f0f2 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -583,7 +583,7 @@ static void init_amd(struct cpuinfo_x86 *c)
 	 * Older AMD CPUs don't save/load FOP/FIP/FDP unless an FPU exception
 	 * is pending.  Xen works around this at (F)XRSTOR time.
 	 */
-	if (!cpu_has(c, X86_FEATURE_RSTR_FP_ERR_PTRS))
+	if (c == &boot_cpu_data && !cpu_has(c, X86_FEATURE_RSTR_FP_ERR_PTRS))
 		setup_force_cpu_cap(X86_BUG_FPU_PTRS);
 
 	/*
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-12-10 14:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 23:56 [Xen-devel] [PATCH v2] x86/AMD: unbreak CPU hotplug on AMD systems without RstrFpErrPtrs Igor Druzhinin
2019-12-04  9:13 ` Jan Beulich
2019-12-10 10:10 ` Jan Beulich
2019-12-10 10:26   ` Jürgen Groß
2019-12-10 12:37     ` Andrew Cooper
2019-12-10 13:58       ` Jan Beulich
2019-12-10 14:07         ` Igor Druzhinin

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.