Commit cf6567fe authored by Suresh Siddha's avatar Suresh Siddha Committed by H. Peter Anvin

x86, x2apic: fix clear_local_APIC() in the presence of x2apic

Impact: cleanup, paranoia

We were not clearing the local APIC in clear_local_APIC() in the
presence of x2apic. Fix it.
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 7c6d9f97
...@@ -184,6 +184,9 @@ static inline int x2apic_enabled(void) ...@@ -184,6 +184,9 @@ static inline int x2apic_enabled(void)
{ {
return 0; return 0;
} }
#define x2apic 0
#endif #endif
extern int get_physical_broadcast(void); extern int get_physical_broadcast(void);
......
#ifndef _ASM_X86_IRQ_REMAPPING_H #ifndef _ASM_X86_IRQ_REMAPPING_H
#define _ASM_X86_IRQ_REMAPPING_H #define _ASM_X86_IRQ_REMAPPING_H
extern int x2apic;
#define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8) #define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8)
#endif /* _ASM_X86_IRQ_REMAPPING_H */ #endif /* _ASM_X86_IRQ_REMAPPING_H */
...@@ -809,7 +809,7 @@ void clear_local_APIC(void) ...@@ -809,7 +809,7 @@ void clear_local_APIC(void)
u32 v; u32 v;
/* APIC hasn't been mapped yet */ /* APIC hasn't been mapped yet */
if (!apic_phys) if (!x2apic && !apic_phys)
return; return;
maxlvt = lapic_get_maxlvt(); maxlvt = lapic_get_maxlvt();
...@@ -1523,12 +1523,10 @@ void __init early_init_lapic_mapping(void) ...@@ -1523,12 +1523,10 @@ void __init early_init_lapic_mapping(void)
*/ */
void __init init_apic_mappings(void) void __init init_apic_mappings(void)
{ {
#ifdef CONFIG_X86_X2APIC
if (x2apic) { if (x2apic) {
boot_cpu_physical_apicid = read_apic_id(); boot_cpu_physical_apicid = read_apic_id();
return; return;
} }
#endif
/* /*
* If no local APIC can be found then set up a fake all * If no local APIC can be found then set up a fake all
...@@ -1972,12 +1970,9 @@ static int lapic_resume(struct sys_device *dev) ...@@ -1972,12 +1970,9 @@ static int lapic_resume(struct sys_device *dev)
local_irq_save(flags); local_irq_save(flags);
#ifdef CONFIG_X86_X2APIC
if (x2apic) if (x2apic)
enable_x2apic(); enable_x2apic();
else else {
#endif
{
/* /*
* Make sure the APICBASE points to the right address * Make sure the APICBASE points to the right address
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment