x86/APIC: suppress redundant "Switched to ..." messages
authorJan Beulich <jbeulich@suse.com>
Mon, 1 Apr 2019 09:12:54 +0000 (11:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 1 Apr 2019 09:12:54 +0000 (11:12 +0200)
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>
xen/arch/x86/apic.c
xen/arch/x86/genapic/probe.c

index 2a2432619e3edce2cdbc275abbd4e80ffcdcd9f0..e6130cfc81100d8ffafa188f5e5cd6e06e65f163 100644 (file)
@@ -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 )
     {
index 6aa7eb7b1c45a1de552726ffd458e1a7cd93b307..1fcc1734f5a0bac3b623f65a2ace35cbcf61720f 100644 (file)
@@ -85,7 +85,8 @@ int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid
        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_id, char *oem_table_id)
        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);