Skip to contentSkip to conversation

xen/x86: Always print processor information at boot

PATCH In review Andrew Cooper 2 participants 2 messages Jun 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/x86: Always print processor information at boot

It is generally useful information, which isn't directly available in the hypervisor console log.

To get an appropriate string in this_cpu->c_vendor, drop the notion of gcv_host_late. All relevent information is available even during early detection, and even Linux (as the ancestor of this code) as dropped the distinction.

A sample log now looks like:

(XEN) Domain heap initialised
(XEN) CPU Vendor: Intel, Family 6, Model 71, Stepping 1 (raw 00040671) (XEN) found SMP MP-table at 000fd6c0

---
CC: Jan Beulich <[email protected]>

---
 xen/arch/x86/cpu/common.c       | 11 +++++++----
 xen/include/asm-x86/processor.h |  5 ++---
 2 files changed, 9 insertions(+), 7 deletions(-)
xen/arch/x86/cpu/common.c +7 -4
index 760543b..2c47589 100644
@@ -166,8 +166,7 @@ int get_cpu_vendor(const char v[], enum get_cpu_vendor mode)
 			if (!strcmp(v,cpu_devs[i]->c_ident[0]) ||
 			    (cpu_devs[i]->c_ident[1] && 
 			     !strcmp(v,cpu_devs[i]->c_ident[1]))) {
-				if (mode == gcv_host_late)
-					this_cpu = cpu_devs[i];
+				this_cpu = cpu_devs[i];
 				return i;
 			}
 		}
@@ -220,7 +219,7 @@ static void __init early_cpu_detect(void)
 	      (int *)&c->x86_vendor_id[8],
 	      (int *)&c->x86_vendor_id[4]);
 
-	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_early);
+	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host);
 
 	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
 	c->x86 = (eax >> 8) & 15;
@@ -238,6 +237,10 @@ static void __init early_cpu_detect(void)
 	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
 	c->x86_capability[cpufeat_word(X86_FEATURE_SSE3)] = ecx;
 
+	printk(XENLOG_INFO
+	       "CPU Vendor: %s, Family %u, Model %u, Stepping %u (raw %08x)\n",
+	       this_cpu->c_vendor, c->x86, c->x86_model, c->x86_mask, eax);
+
 	eax = cpuid_eax(0x80000000);
 	if ((eax >> 16) == 0x8000 && eax >= 0x80000008) {
 		eax = cpuid_eax(0x80000008);
@@ -263,7 +266,7 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	      (int *)&c->x86_vendor_id[8],
 	      (int *)&c->x86_vendor_id[4]);
 
-	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_late);
+	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host);
 	/* Initialize the standard set of capabilities */
 	/* Note that the vendor-specific code below might override */
 
xen/include/asm-x86/processor.h +2 -3
index ddaaf2de..318c92c 100644
@@ -618,9 +618,8 @@ int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(unsigned int cpu);
 
 enum get_cpu_vendor {
-   gcv_host_early,
-   gcv_host_late,
-   gcv_guest
+    gcv_host,
+    gcv_guest,
 };
 
 int get_cpu_vendor(const char vendor_id[], enum get_cpu_vendor);
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 10.06.16 at 16:49, <[email protected]> wrote:

It is generally useful information, which isn't directly available in the hypervisor console log.

To get an appropriate string in this_cpu->c_vendor, drop the notion of gcv_host_late. All relevent information is available even during early detection, and even Linux (as the ancestor of this code) as dropped the distinction.

Quoted 7 lines

A sample log now looks like:

(XEN) Domain heap initialised
(XEN) CPU Vendor: Intel, Family 6, Model 71, Stepping 1 (raw 00040671) (XEN) found SMP MP-table at 000fd6c0

Indeed I've been missing this information a number of times.

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