mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
hw: add .min_cpus and .default_cpus fields to machine_class
max_cpus needs to be an upper bound on the number of vCPUs initialized; otherwise TCG region initialization breaks. Some boards initialize a hard-coded number of vCPUs, which is not captured by the global max_cpus and therefore breaks TCG initialization. Fix it by adding the .min_cpus field to machine_class. This commit also changes some user-facing behaviour: we now die if -smp is below this hard-coded vCPU minimum instead of silently ignoring the passed -smp value (sometimes announcing this by printing a warning). However, the introduction of .default_cpus lessens the likelihood that users will notice this: if -smp isn't set, we now assign the value in .default_cpus to both smp_cpus and max_cpus. IOW, if a user does not set -smp, they always get a correct number of vCPUs. This change fixes3468b59
("tcg: enable multiple TCG contexts in softmmu", 2017-10-24), which broke TCG initialization for some ARM boards. Fixes:3468b59e18
Reported-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Emilio G. Cota <cota@braap.org> Message-id: 1510343626-25861-6-git-send-email-cota@braap.org Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
1342b0355e
commit
7264961934
5 changed files with 31 additions and 11 deletions
|
@ -102,6 +102,9 @@ typedef struct {
|
|||
|
||||
/**
|
||||
* MachineClass:
|
||||
* @max_cpus: maximum number of CPUs supported. Default: 1
|
||||
* @min_cpus: minimum number of CPUs supported. Default: 1
|
||||
* @default_cpus: number of CPUs instantiated if none are specified. Default: 1
|
||||
* @get_hotplug_handler: this function is called during bus-less
|
||||
* device hotplug. If defined it returns pointer to an instance
|
||||
* of HotplugHandler object, which handles hotplug operation
|
||||
|
@ -167,6 +170,8 @@ struct MachineClass {
|
|||
BlockInterfaceType block_default_type;
|
||||
int units_per_default_bus;
|
||||
int max_cpus;
|
||||
int min_cpus;
|
||||
int default_cpus;
|
||||
unsigned int no_serial:1,
|
||||
no_parallel:1,
|
||||
use_virtcon:1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue