All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: suppress bogus log message
@ 2015-11-26 13:27 Jan Beulich
  2015-11-26 13:42 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-11-26 13:27 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 3937 bytes --]

The way we populate mpc_cpufeature is not compatible with modern CPUs,
and hence the message printed using that information is useless/bogus.
It's of interest only anyway when not using ACPI, so move it into MPS
parsing code. This at once significantly reduces boot time logging on
huge systems.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course it is questionable whether retaining MPS support is actually
useful, but ripping that out is a somewhat bigger task.

--- a/xen/include/asm-x86/mach-generic/mach_apic.h
+++ b/xen/include/asm-x86/mach-generic/mach_apic.h
@@ -28,16 +28,6 @@ static inline void enable_apic_mode(void
 
 extern u32 bios_cpu_apicid[];
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid)
-{
-	printk("Processor #%d %d:%d APIC version %d\n",
-			apicid,
-			(m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
-			(m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
-			m->mpc_apicver);
-	return apicid;
-}
-
 static inline int multi_timer_check(int apic, int irq)
 {
 	return 0;
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -125,9 +125,9 @@ static int __init mpf_checksum(unsigned
 
 /* Return xen's logical cpu_id of the new added cpu or <0 if error */
 static int __devinit MP_processor_info_x(struct mpc_config_processor *m,
-					 u32 apicidx, bool_t hotplug)
+					 u32 apicid, bool_t hotplug)
 {
- 	int ver, apicid, cpu = 0;
+ 	int ver, cpu = 0;
  	
 	if (!(m->mpc_cpuflag & CPU_ENABLED)) {
 		if (!hotplug)
@@ -135,8 +135,6 @@ static int __devinit MP_processor_info_x
 		return -EINVAL;
 	}
 
-	apicid = mpc_apic_id(m, apicidx);
-
 	if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
 		Dprintk("    Bootup CPU\n");
 		boot_cpu_physical_apicid = apicid;
@@ -340,11 +338,24 @@ static int __init smp_read_mpc(struct mp
 			{
 				struct mpc_config_processor *m=
 					(struct mpc_config_processor *)mpt;
-				/* ACPI may have already provided this data */
-				if (!acpi_lapic)
-					MP_processor_info(m);
+
 				mpt += sizeof(*m);
 				count += sizeof(*m);
+
+				/* ACPI may have already provided this data. */
+				if (acpi_lapic)
+					break;
+
+				printk("Processor #%02x %u:%u APIC version %u%s\n",
+				       m->mpc_apicid,
+				       MASK_EXTR(m->mpc_cpufeature,
+						 CPU_FAMILY_MASK),
+				       MASK_EXTR(m->mpc_cpufeature,
+						 CPU_MODEL_MASK),
+				       m->mpc_apicver,
+				       m->mpc_cpuflag & CPU_ENABLED
+				       ? "" : " [disabled]");
+				MP_processor_info(m);
 				break;
 			}
 			case MP_BUS:
@@ -781,8 +792,15 @@ int __devinit mp_register_lapic (
 	bool_t			enabled,
 	bool_t			hotplug)
 {
-	struct mpc_config_processor processor;
-	int			boot_cpu = 0;
+	struct mpc_config_processor processor = {
+		.mpc_type = MP_PROCESSOR,
+		/* Note: We don't fill in fields not consumed anywhere. */
+		.mpc_apicid = id,
+		.mpc_apicver = GET_APIC_VERSION(apic_read(APIC_LVR)),
+		.mpc_cpuflag = (enabled ? CPU_ENABLED : 0) |
+			       (id == boot_cpu_physical_apicid ?
+				CPU_BOOTPROCESSOR : 0),
+	};
 	
 	if (MAX_APICS <= id) {
 		printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
@@ -790,21 +808,6 @@ int __devinit mp_register_lapic (
 		return -EINVAL;
 	}
 
-	if (id == boot_cpu_physical_apicid)
-		boot_cpu = 1;
-
-	processor.mpc_type = MP_PROCESSOR;
-	processor.mpc_apicid = id;
-	processor.mpc_apicver = GET_APIC_VERSION(apic_read(APIC_LVR));
-	processor.mpc_cpuflag = (enabled ? CPU_ENABLED : 0);
-	processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0);
-	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 
-		(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
-	processor.mpc_featureflag
-            = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
-	processor.mpc_reserved[0] = 0;
-	processor.mpc_reserved[1] = 0;
-
 	return MP_processor_info_x(&processor, id, hotplug);
 }
 




[-- Attachment #2: x86-hide-bogus-CPU-message.patch --]
[-- Type: text/plain, Size: 3966 bytes --]

x86: suppress bogus log message

The way we populate mpc_cpufeature is not compatible with modern CPUs,
and hence the message printed using that information is useless/bogus.
It's of interest only anyway when not using ACPI, so move it into MPS
parsing code. This at once significantly reduces boot time logging on
huge systems.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course it is questionable whether retaining MPS support is actually
useful, but ripping that out is a somewhat bigger task.

--- a/xen/include/asm-x86/mach-generic/mach_apic.h
+++ b/xen/include/asm-x86/mach-generic/mach_apic.h
@@ -28,16 +28,6 @@ static inline void enable_apic_mode(void
 
 extern u32 bios_cpu_apicid[];
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid)
-{
-	printk("Processor #%d %d:%d APIC version %d\n",
-			apicid,
-			(m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
-			(m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
-			m->mpc_apicver);
-	return apicid;
-}
-
 static inline int multi_timer_check(int apic, int irq)
 {
 	return 0;
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -125,9 +125,9 @@ static int __init mpf_checksum(unsigned
 
 /* Return xen's logical cpu_id of the new added cpu or <0 if error */
 static int __devinit MP_processor_info_x(struct mpc_config_processor *m,
-					 u32 apicidx, bool_t hotplug)
+					 u32 apicid, bool_t hotplug)
 {
- 	int ver, apicid, cpu = 0;
+ 	int ver, cpu = 0;
  	
 	if (!(m->mpc_cpuflag & CPU_ENABLED)) {
 		if (!hotplug)
@@ -135,8 +135,6 @@ static int __devinit MP_processor_info_x
 		return -EINVAL;
 	}
 
-	apicid = mpc_apic_id(m, apicidx);
-
 	if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
 		Dprintk("    Bootup CPU\n");
 		boot_cpu_physical_apicid = apicid;
@@ -340,11 +338,24 @@ static int __init smp_read_mpc(struct mp
 			{
 				struct mpc_config_processor *m=
 					(struct mpc_config_processor *)mpt;
-				/* ACPI may have already provided this data */
-				if (!acpi_lapic)
-					MP_processor_info(m);
+
 				mpt += sizeof(*m);
 				count += sizeof(*m);
+
+				/* ACPI may have already provided this data. */
+				if (acpi_lapic)
+					break;
+
+				printk("Processor #%02x %u:%u APIC version %u%s\n",
+				       m->mpc_apicid,
+				       MASK_EXTR(m->mpc_cpufeature,
+						 CPU_FAMILY_MASK),
+				       MASK_EXTR(m->mpc_cpufeature,
+						 CPU_MODEL_MASK),
+				       m->mpc_apicver,
+				       m->mpc_cpuflag & CPU_ENABLED
+				       ? "" : " [disabled]");
+				MP_processor_info(m);
 				break;
 			}
 			case MP_BUS:
@@ -781,8 +792,15 @@ int __devinit mp_register_lapic (
 	bool_t			enabled,
 	bool_t			hotplug)
 {
-	struct mpc_config_processor processor;
-	int			boot_cpu = 0;
+	struct mpc_config_processor processor = {
+		.mpc_type = MP_PROCESSOR,
+		/* Note: We don't fill in fields not consumed anywhere. */
+		.mpc_apicid = id,
+		.mpc_apicver = GET_APIC_VERSION(apic_read(APIC_LVR)),
+		.mpc_cpuflag = (enabled ? CPU_ENABLED : 0) |
+			       (id == boot_cpu_physical_apicid ?
+				CPU_BOOTPROCESSOR : 0),
+	};
 	
 	if (MAX_APICS <= id) {
 		printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
@@ -790,21 +808,6 @@ int __devinit mp_register_lapic (
 		return -EINVAL;
 	}
 
-	if (id == boot_cpu_physical_apicid)
-		boot_cpu = 1;
-
-	processor.mpc_type = MP_PROCESSOR;
-	processor.mpc_apicid = id;
-	processor.mpc_apicver = GET_APIC_VERSION(apic_read(APIC_LVR));
-	processor.mpc_cpuflag = (enabled ? CPU_ENABLED : 0);
-	processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0);
-	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 
-		(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
-	processor.mpc_featureflag
-            = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
-	processor.mpc_reserved[0] = 0;
-	processor.mpc_reserved[1] = 0;
-
 	return MP_processor_info_x(&processor, id, hotplug);
 }
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] x86: suppress bogus log message
  2015-11-26 13:27 [PATCH] x86: suppress bogus log message Jan Beulich
@ 2015-11-26 13:42 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-11-26 13:42 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Keir Fraser

On 26/11/15 13:27, Jan Beulich wrote:
> The way we populate mpc_cpufeature is not compatible with modern CPUs,
> and hence the message printed using that information is useless/bogus.
> It's of interest only anyway when not using ACPI, so move it into MPS
> parsing code. This at once significantly reduces boot time logging on
> huge systems.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

I have been looking to find the time to reduce the volume of boot
logging like this, as it is predominantly noise.  This is a very good start.

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

end of thread, other threads:[~2015-11-26 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 13:27 [PATCH] x86: suppress bogus log message Jan Beulich
2015-11-26 13:42 ` Andrew Cooper

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.