diff options
author | Yinghai Lu <yinghai@kernel.org> | 2011-02-09 02:22:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-02-14 07:23:51 -0500 |
commit | e5fea868e6c04343e501176a373d568c1c0094aa (patch) | |
tree | d552a38f46eac4ff8f97ef6229f7dd4eeb54d602 /arch/x86/kernel/apic | |
parent | 91e04ec05838a5b2c790decf2a91af98cb1666e8 (diff) |
x86: Fix and clean up generic_processor_info()
One of the error printouts in generic_processor_info() prints out
the APIC version instead of the cpu index the warning text describes.
Move version validation down, after we get the right cpu index.
-v2: add comments about reason why we can have cpu=0 there.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4D5240A9.4080703@kernel.org>
[ Cleaned up and made the BIOS bug printouts more consistent ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 06c196d7e59c..628dcdb7afd5 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1925,17 +1925,6 @@ void __cpuinit generic_processor_info(int apicid, int version) | |||
1925 | { | 1925 | { |
1926 | int cpu; | 1926 | int cpu; |
1927 | 1927 | ||
1928 | /* | ||
1929 | * Validate version | ||
1930 | */ | ||
1931 | if (version == 0x0) { | ||
1932 | pr_warning("BIOS bug, APIC version is 0 for CPU#%d! " | ||
1933 | "fixing up to 0x10. (tell your hw vendor)\n", | ||
1934 | version); | ||
1935 | version = 0x10; | ||
1936 | } | ||
1937 | apic_version[apicid] = version; | ||
1938 | |||
1939 | if (num_processors >= nr_cpu_ids) { | 1928 | if (num_processors >= nr_cpu_ids) { |
1940 | int max = nr_cpu_ids; | 1929 | int max = nr_cpu_ids; |
1941 | int thiscpu = max + disabled_cpus; | 1930 | int thiscpu = max + disabled_cpus; |
@@ -1949,22 +1938,34 @@ void __cpuinit generic_processor_info(int apicid, int version) | |||
1949 | } | 1938 | } |
1950 | 1939 | ||
1951 | num_processors++; | 1940 | num_processors++; |
1952 | cpu = cpumask_next_zero(-1, cpu_present_mask); | ||
1953 | |||
1954 | if (version != apic_version[boot_cpu_physical_apicid]) | ||
1955 | WARN_ONCE(1, | ||
1956 | "ACPI: apic version mismatch, bootcpu: %x cpu %d: %x\n", | ||
1957 | apic_version[boot_cpu_physical_apicid], cpu, version); | ||
1958 | |||
1959 | physid_set(apicid, phys_cpu_present_map); | ||
1960 | if (apicid == boot_cpu_physical_apicid) { | 1941 | if (apicid == boot_cpu_physical_apicid) { |
1961 | /* | 1942 | /* |
1962 | * x86_bios_cpu_apicid is required to have processors listed | 1943 | * x86_bios_cpu_apicid is required to have processors listed |
1963 | * in same order as logical cpu numbers. Hence the first | 1944 | * in same order as logical cpu numbers. Hence the first |
1964 | * entry is BSP, and so on. | 1945 | * entry is BSP, and so on. |
1946 | * boot_cpu_init() already hold bit 0 in cpu_present_mask | ||
1947 | * for BSP. | ||
1965 | */ | 1948 | */ |
1966 | cpu = 0; | 1949 | cpu = 0; |
1950 | } else | ||
1951 | cpu = cpumask_next_zero(-1, cpu_present_mask); | ||
1952 | |||
1953 | /* | ||
1954 | * Validate version | ||
1955 | */ | ||
1956 | if (version == 0x0) { | ||
1957 | pr_warning("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n", | ||
1958 | cpu, apicid); | ||
1959 | version = 0x10; | ||
1967 | } | 1960 | } |
1961 | apic_version[apicid] = version; | ||
1962 | |||
1963 | if (version != apic_version[boot_cpu_physical_apicid]) { | ||
1964 | pr_warning("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n", | ||
1965 | apic_version[boot_cpu_physical_apicid], cpu, version); | ||
1966 | } | ||
1967 | |||
1968 | physid_set(apicid, phys_cpu_present_map); | ||
1968 | if (apicid > max_physical_apicid) | 1969 | if (apicid > max_physical_apicid) |
1969 | max_physical_apicid = apicid; | 1970 | max_physical_apicid = apicid; |
1970 | 1971 | ||