]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
Merge tag 'pull-loongarch-20240509' of https://gitlab.com/gaosong/qemu into staging
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 9 May 2024 08:11:39 +0000 (10:11 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 9 May 2024 08:11:39 +0000 (10:11 +0200)
pull-loongarch-20240509

# -----BEGIN PGP SIGNATURE-----
#
# iLMEAAEKAB0WIQS4/x2g0v3LLaCcbCxAov/yOSY+3wUCZjyDAgAKCRBAov/yOSY+
# 33cfA/4jE0x+eLAT161caSwM3wBOfZRClfUhXdkxLP6GvWbACVQ8l0rEZiw2PuI8
# DFReU2gqs7wAfYKt7Yy62xXlCw1B3aSUzE45gS2TGIP1GqKBwigvpW4i1SgiOoMX
# 4TA+GG16KgR9zaxO48bjjyJ1epc7S3SxdAL09p2U08D9EdSwCA==
# =RLFu
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 09 May 2024 10:02:10 AM CEST
# gpg:                using RSA key B8FF1DA0D2FDCB2DA09C6C2C40A2FFF239263EDF
# gpg: Good signature from "Song Gao <m17746591750@163.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B8FF 1DA0 D2FD CB2D A09C  6C2C 40A2 FFF2 3926 3EDF

* tag 'pull-loongarch-20240509' of https://gitlab.com/gaosong/qemu:
  target/loongarch: Put cpucfg operation before CSR register
  target/loongarch: Add TCG macro in structure CPUArchState
  hw/loongarch: Refine default numa id calculation

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
1  2 
hw/loongarch/virt.c

index 852036467ab21bfa59869fa75cc8538262f5aeda,12d20055fefc09f07bd4d1d30465d287b0d6c493..f0640d2d80351941171fad8edf14c179c9183b7a
@@@ -1182,18 -1192,17 +1182,17 @@@ static CpuInstanceProperties virt_cpu_i
  
  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 loongarch_class_init(ObjectClass *oc, void *data)
 +static void virt_class_init(ObjectClass *oc, void *data)
  {
      MachineClass *mc = MACHINE_CLASS(oc);
      HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);