[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 4/4] x86/APIC: restrict certain messages to BSP
All CPUs get an equal setting of EOI broadcast suppression; no need to log one message per CPU, even if it's only in verbose APIC mode. Only the BSP is eligible to possibly get ExtINT enabled; no need to log that it gets disabled on all APs, even if - again - it's only in verbose APIC mode. Take the opportunity and introduce a "bsp" parameter to the function, to stop using smp_processor_id() to tell BSP from APs. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -499,7 +499,7 @@ static void resume_x2apic(void) __enable_x2apic(); } -void setup_local_APIC(void) +void setup_local_APIC(bool bsp) { unsigned long oldvalue, value, maxlvt; int i, j; @@ -598,8 +598,8 @@ void setup_local_APIC(void) if ( directed_eoi_enabled ) { value |= APIC_SPIV_DIRECTED_EOI; - apic_printk(APIC_VERBOSE, "Suppress EOI broadcast on CPU#%d\n", - smp_processor_id()); + if ( bsp ) + apic_printk(APIC_VERBOSE, "Suppressing EOI broadcast\n"); } apic_write(APIC_SPIV, value); @@ -615,21 +615,22 @@ void setup_local_APIC(void) * TODO: set up through-local-APIC from through-I/O-APIC? --macro */ value = apic_read(APIC_LVT0) & APIC_LVT_MASKED; - if (!smp_processor_id() && (pic_mode || !value)) { + if (bsp && (pic_mode || !value)) { value = APIC_DM_EXTINT; apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", smp_processor_id()); } else { value = APIC_DM_EXTINT | APIC_LVT_MASKED; - apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", - smp_processor_id()); + if (bsp) + apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", + smp_processor_id()); } apic_write(APIC_LVT0, value); /* * only the BP should see the LINT1 NMI signal, obviously. */ - if (!smp_processor_id()) + if (bsp) value = APIC_DM_NMI; else value = APIC_DM_NMI | APIC_LVT_MASKED; @@ -663,7 +664,7 @@ void setup_local_APIC(void) printk("Leaving ESR disabled.\n"); } - if (nmi_watchdog == NMI_LOCAL_APIC && smp_processor_id()) + if (nmi_watchdog == NMI_LOCAL_APIC && !bsp) setup_apic_nmi_watchdog(); apic_pm_activate(); } @@ -1474,7 +1475,7 @@ int __init APIC_init_uniprocessor (void) physids_clear(phys_cpu_present_map); physid_set(boot_cpu_physical_apicid, phys_cpu_present_map); - setup_local_APIC(); + setup_local_APIC(true); if (nmi_watchdog == NMI_LOCAL_APIC) check_nmi_watchdog(); --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -191,7 +191,7 @@ static void smp_callin(void) */ Dprintk("CALLIN, before setup_local_APIC().\n"); x2apic_ap_setup(); - setup_local_APIC(); + setup_local_APIC(false); /* Save our processor parameters. */ if ( !smp_store_cpu_info(cpu) ) @@ -1165,7 +1165,7 @@ void __init smp_prepare_cpus(void) verify_local_APIC(); connect_bsp_APIC(); - setup_local_APIC(); + setup_local_APIC(true); if ( !skip_ioapic_setup && nr_ioapics ) setup_IO_APIC(); --- a/xen/include/asm-x86/apic.h +++ b/xen/include/asm-x86/apic.h @@ -169,7 +169,7 @@ extern int verify_local_APIC (void); extern void cache_APIC_registers (void); extern void sync_Arb_IDs (void); extern void init_bsp_APIC (void); -extern void setup_local_APIC (void); +extern void setup_local_APIC(bool bsp); extern void init_apic_mappings (void); extern void smp_local_timer_interrupt (struct cpu_user_regs *regs); extern void setup_boot_APIC_clock (void); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |