diff mbox series

[2/7] x86/APIC: suppress redundant "Switched to ..." messages

Message ID 5C9CDEEF0200007800222841@prv1-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show
Series x86: eliminate Intel-isms from x2APIC setup | expand

Commit Message

Jan Beulich March 28, 2019, 2:49 p.m. UTC
There's no need to log anything when what we "switch to" is what is in
use already.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper March 28, 2019, 4:33 p.m. UTC | #1
On 28/03/2019 14:49, Jan Beulich wrote:
> There's no need to log anything when what we "switch to" is what is in
> use already.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

Patch

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -884,6 +884,7 @@  void x2apic_ap_setup(void)
 void __init x2apic_bsp_setup(void)
 {
     struct IO_APIC_route_entry **ioapic_entries = NULL;
+    const char *orig_name;
 
     if ( !cpu_has_x2apic )
         return;
@@ -946,8 +947,10 @@  void __init x2apic_bsp_setup(void)
 
     force_iommu = 1;
 
+    orig_name = genapic.name;
     genapic = *apic_x2apic_probe();
-    printk("Switched to APIC driver %s.\n", genapic.name);
+    if ( genapic.name != orig_name )
+        printk("Switched to APIC driver %s\n", genapic.name);
 
     if ( !x2apic_enabled )
     {
--- a/xen/arch/x86/genapic/probe.c
+++ b/xen/arch/x86/genapic/probe.c
@@ -85,7 +85,8 @@  int __init mps_oem_check(struct mp_confi
 	int i;
 	for (i = 0; apic_probe[i]; ++i) { 
 		if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { 
-			if (!cmdline_apic) {
+			if (!cmdline_apic &&
+			     genapic.name != apic_probe[i]->name) {
 				genapic = *apic_probe[i];
 				printk(KERN_INFO "Switched to APIC driver `%s'.\n", 
 				       genapic.name);
@@ -101,7 +102,8 @@  int __init acpi_madt_oem_check(char *oem
 	int i;
 	for (i = 0; apic_probe[i]; ++i) { 
 		if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { 
-			if (!cmdline_apic) {
+			if (!cmdline_apic &&
+			     genapic.name != apic_probe[i]->name) {
 				genapic = *apic_probe[i];
 				printk(KERN_INFO "Switched to APIC driver `%s'.\n", 
 				       genapic.name);