diff options
author | Like Xu <like.xu@linux.intel.com> | 2019-05-19 04:54:19 +0800 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2019-07-05 17:07:35 -0300 |
commit | edeeec911702870adf8866311b5feb2bdaaee2ce (patch) | |
tree | f616d4490038f1b090d19c3b4742c2e6dc6abff7 /include | |
parent | d2c5f91ca944aaade642624397e1853801bbc744 (diff) |
hw/boards: Add struct CpuTopology to MachineState
The cpu topology property CpuTopology is added to the MachineState
and its members are initialized with the leagcy global smp variables.
From this commit, the code in the system emulation mode is supposed to
use cpu topology variables from MachineState instead of the global ones
defined in vl.c and there is no semantic change.
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Like Xu <like.xu@linux.intel.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20190518205428.90532-2-like.xu@linux.intel.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/boards.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index c6ad196b14..9597140936 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -233,6 +233,20 @@ typedef struct DeviceMemoryState { } DeviceMemoryState; /** + * CpuTopology: + * @cpus: the number of present logical processors on the machine + * @cores: the number of cores in one package + * @threads: the number of threads in one core + * @max_cpus: the maximum number of logical processors on the machine + */ +typedef struct CpuTopology { + unsigned int cpus; + unsigned int cores; + unsigned int threads; + unsigned int max_cpus; +} CpuTopology; + +/** * MachineState: */ struct MachineState { @@ -274,6 +288,7 @@ struct MachineState { const char *cpu_type; AccelState *accelerator; CPUArchIdList *possible_cpus; + CpuTopology smp; struct NVDIMMState *nvdimms_state; }; |