Document MAX_CPUMASK_BITS and use it when limiting max_cpus
cover Document MAX_CPUMASK_BITS and use it when limiting max_cpus
Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I sent (which broke the build and where reverted).
Instead of renaming MAX_CPUMASK_BITS like I did previously, just document it and use it on the (max_cpus > 255) check on vl.c.
Eduardo Habkost (2):
sysemu.h: Document what MAX_CPUMASK_BITS really limits vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
include/sysemu/sysemu.h | 7 +++++++ vl.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.5.3
PATCH 1/2 sysemu.h: Document what MAX_CPUMASK_BITS really limits
--- include/sysemu/sysemu.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/sysemu/sysemu.h +7 -0
@@ -133,7 +133,14 @@ extern uint8_t qemu_extra_params_fw[2];extern QEMUClockType rtc_clock;#define MAX_NODES 64 + +/* The following shall be true for all CPUs: +* cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS +* +* Note that cpu->get_arch_id() may be larger than MAX_CPUMASK_BITS. +*/ #define MAX_CPUMASK_BITS 255 +extern int nb_numa_nodes;extern uint64_t node_mem[MAX_NODES ];extern unsigned long *node_cpumask[MAX_NODES ];
Signature · 1 line
1.8.5.3
PATCH 2/2 vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
In reply to Eduardo Habkost--- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
vl.c +1 -1
@@ -1418,7 +1418,7 @@ static void smp_parse(QemuOpts *opts) max_cpus = smp_cpus; } -if (max_cpus >255 ) { +if (max_cpus >MAX_CPUMASK_BITS ) {fprintf (stderr,"Unsupported number of maxcpus\n" );exit (1 ); }
Signature · 1 line
1.8.5.3
Quoted 6 lines · Eduardo Habkost
Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I sent (which broke the build and where reverted).
Instead of renaming
MAX_CPUMASK_BITSlike I did previously, just document it and use it on the (max_cpus> 255) check onvl.c.
Quoted 8 lines
Eduardo Habkost (2):
sysemu.h: Document whatMAX_CPUMASK_BITSreally limitsvl.c: UseMAX_CPUMASK_BITSmacro instead of hardcoded constantinclude/sysemu/sysemu.h | 7 +++++++ vl.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
series
Michael S. Tsirkin
AppliedQuoted 5 lines · Eduardo Habkost
Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I sent (which broke the build and where reverted).
Instead of renaming
MAX_CPUMASK_BITSlike I did previously, just document it and use it on the (max_cpus> 255) check onvl.c.
Applied, thanks!
Quoted 10 lines
Eduardo Habkost (2):
sysemu.h: Document whatMAX_CPUMASK_BITSreally limitsvl.c: UseMAX_CPUMASK_BITSmacro instead of hardcoded constantinclude/sysemu/sysemu.h | 7 +++++++ vl.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)Signature · 1 line
1.8.5.3