Skip to contentSkip to conversation

AMD extended migration CPU masks: why only on CPU 0?

DISCUSSION Tim Deegan 2 participants 3 messages Feb 16, 2010 – Feb 22, 2010

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

Hi Travis,

In c/s 18402, the CPUID masks are only set once, on CPU 0. Can you explain why this doesn't have to happen on every core, or at least every socket? The white paper doesn't discuss it.

Cheers,

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)
#1 lore raw

Tim,

The (extended) CPUID mask MSRs are associated with each core. They need to be updated on each core if migration happens across CPUs. Changset 18402 does update the MSRs for each core. But printk() only happens on core 0. If you move printk() statements below wrmsr(), you will see it been called on each core.

It is hard to justify which way is better. I attach the patch anyway, in case Keir or you want it for xen-unstable.

Best,
-Wei

Quoted 11 lines · Tim Deegan

Hi Travis,

In c/s 18402, the CPUID masks are only set once, on CPU 0. Can you explain why this doesn't have to happen on every core, or at least every socket? The white paper doesn't discuss it.

Cheers,

Tim.

xen/arch/x86/cpu/amd.c +4 -4
diff -r 83a6621b91bf xen/arch/x86/cpu/amd.c
@@ -131,10 +131,6 @@
 	}
 
 	status = set_mask;
-	printk("Writing CPUID feature mask ECX:EDX -> %08Xh:%08Xh\n", 
-	       feat_ecx, feat_edx);
-	printk("Writing CPUID extended feature mask ECX:EDX -> %08Xh:%08Xh\n", 
-	       extfeat_ecx, extfeat_edx);
 
  setmask:
 	/* FIXME check if processor supports CPUID masking */
@@ -146,6 +142,10 @@
 		wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
 		wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
 	}
+        printk("Writing CPUID feature mask ECX:EDX -> %08Xh:%08Xh\n", 
+               feat_ecx, feat_edx);
+        printk("Writing CPUID extended feature mask ECX:EDX -> %08Xh:%08Xh\n", 
+               extfeat_ecx, extfeat_edx);
 }
 
 /*

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#2 lore raw

Hi,

Quoted 3 lines · Wei Huang

The (extended) CPUID mask MSRs are associated with each core. They need to be updated on each core if migration happens across CPUs. Changset 18402 does update the MSRs for each core.

Oh, so it does. :) My mistake; sorry for the noise.

Cheers,

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)