mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
i386/cpu: Consolidate die-id validity in smp context
The field die_id (default as 0) and has_die_id are introduced to X86CPU. Following the legacy smp check rules, the die_id validity is added to the same contexts as leagcy smp variables such as hmp_hotpluggable_cpus(), machine_set_cpu_numa_node(), cpu_slot_to_string() and pc_cpu_pre_plug(). Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Like Xu <like.xu@linux.intel.com> Message-Id: <20190612084104.34984-4-like.xu@linux.intel.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
cabea7dcd0
commit
176d2cda0d
7 changed files with 38 additions and 3 deletions
|
@ -683,6 +683,11 @@ void machine_set_cpu_numa_node(MachineState *machine,
|
|||
return;
|
||||
}
|
||||
|
||||
if (props->has_die_id && !slot->props.has_die_id) {
|
||||
error_setg(errp, "die-id is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
/* skip slots with explicit mismatch */
|
||||
if (props->has_thread_id && props->thread_id != slot->props.thread_id) {
|
||||
continue;
|
||||
|
@ -692,6 +697,10 @@ void machine_set_cpu_numa_node(MachineState *machine,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (props->has_die_id && props->die_id != slot->props.die_id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (props->has_socket_id && props->socket_id != slot->props.socket_id) {
|
||||
continue;
|
||||
}
|
||||
|
@ -949,6 +958,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
|
|||
if (cpu->props.has_socket_id) {
|
||||
g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
|
||||
}
|
||||
if (cpu->props.has_die_id) {
|
||||
g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
|
||||
}
|
||||
if (cpu->props.has_core_id) {
|
||||
if (s->len) {
|
||||
g_string_append_printf(s, ", ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue