xen/arm: Allow setting the number of CPUs to activate at runtime
authorMichal Orzel <michal.orzel@arm.com>
Mon, 23 May 2022 09:13:24 +0000 (11:13 +0200)
committerJulien Grall <jgrall@amazon.com>
Wed, 8 Jun 2022 10:16:38 +0000 (11:16 +0100)
commit7ac12e3634cc3ed9234de03e48149e7f5fbf73c3
tree0246afb64c1abdbdb3953422571368439106b65d
parente7f144f80839168e632ea4405ad114e991beecdf
xen/arm: Allow setting the number of CPUs to activate at runtime

Introduce a command line parameter "maxcpus" on Arm to allow adjusting
the number of CPUs to activate. Currently the limit is defined by the
config option CONFIG_NR_CPUS. Such parameter already exists on x86.

Define a parameter "maxcpus" and a corresponding static variable
max_cpus in Arm smpboot.c. Modify function smp_get_max_cpus to take
max_cpus as a limit and to return proper unsigned int instead of int.

Take the opportunity to remove redundant variable cpus from start_xen
function and to directly assign the return value from smp_get_max_cpus
to nr_cpu_ids (global variable in Xen used to store the number of CPUs
actually activated).

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
docs/misc/xen-command-line.pandoc
xen/arch/arm/include/asm/smp.h
xen/arch/arm/setup.c
xen/arch/arm/smpboot.c