diff options
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/core/machine.c | 1 | ||||
| -rw-r--r-- | hw/loongarch/virt.c | 11 |
2 files changed, 5 insertions, 7 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c index 4ff60911e7..c7ceb11501 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -192,7 +192,6 @@ GlobalProperty hw_compat_3_0[] = {}; const size_t hw_compat_3_0_len = G_N_ELEMENTS(hw_compat_3_0); GlobalProperty hw_compat_2_12[] = { - { "migration", "decompress-error-check", "off" }, { "hda-audio", "use-timer", "false" }, { "cirrus-vga", "global-vmstate", "true" }, { "VGA", "global-vmstate", "true" }, diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 852036467a..f0640d2d80 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1182,15 +1182,14 @@ static CpuInstanceProperties virt_cpu_index_to_props(MachineState *ms, static int64_t virt_get_default_cpu_node_id(const MachineState *ms, int idx) { - int64_t nidx = 0; + int64_t socket_id; if (ms->numa_state->num_nodes) { - nidx = idx / (ms->smp.cpus / ms->numa_state->num_nodes); - if (ms->numa_state->num_nodes <= nidx) { - nidx = ms->numa_state->num_nodes - 1; - } + socket_id = ms->possible_cpus->cpus[idx].props.socket_id; + return socket_id % ms->numa_state->num_nodes; + } else { + return 0; } - return nidx; } static void virt_class_init(ObjectClass *oc, void *data) |