Skip to content
Commit 4988a40c authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Ingo Molnar
Browse files

x86/apic: Make cpu_mask_to_apicid() operations check cpu_online_mask



Currently cpu_mask_to_apicid() should not get a offline CPU with
the cpumask. Otherwise some apic drivers might try to access
non-existent per-cpu variables (i.e. x2apic). In that regard
cpu_mask_to_apicid() and cpu_mask_to_apicid_and() operations are
inconsistent.

This fix makes the two operations do not rely on calling
functions and always return the apicid for only online CPUs. As
result, the meaning and implementations of cpu_mask_to_apicid()
and cpu_mask_to_apicid_and() operations become straight.

Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
Acked-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20120607131624.GG4759@dhcp-26-207.brq.redhat.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent ff164324
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment