Commit bb3f0a52 authored by Dou Liyang's avatar Dou Liyang Committed by Ingo Molnar

x86/apic: Fix a warning message in logical CPU IDs allocation

The current warning message in allocate_logical_cpuid() is somewhat confusing:

  Only 1 processors supported.Processor 2/0x2 and the rest are ignored.

As it might imply that there's only one CPU in the system - while what we ran
into here is a kernel limitation.

Fix the warning message to clarify all that:

  APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest are ignored.

( Also update the error return from -1 to -EINVAL, which is the more
  canonical return value. )
Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: nicstange@gmail.com
Cc: wanpeng.li@hotmail.com
Link: http://lkml.kernel.org/r/1488261052-25753-1-git-send-email-douly.fnst@cn.fujitsu.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 10bce841
...@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid) ...@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
/* Allocate a new cpuid. */ /* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) { if (nr_logical_cpuids >= nr_cpu_ids) {
WARN_ONCE(1, "Only %d processors supported." WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
"Processor %d/0x%x and the rest are ignored.\n", "Processor %d/0x%x and the rest are ignored.\n",
nr_cpu_ids - 1, nr_logical_cpuids, apicid); nr_cpu_ids, nr_logical_cpuids, apicid);
return -1; return -EINVAL;
} }
cpuid_to_apicid[nr_logical_cpuids] = apicid; cpuid_to_apicid[nr_logical_cpuids] = apicid;
......
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