qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] hw/loongarch/virt: Modify ipi as percpu device


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/3] hw/loongarch/virt: Modify ipi as percpu device
Date: Thu, 11 May 2023 21:11:46 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1

On 6/4/23 12:00, Song Gao wrote:
ipi is used to communicate between cpus, this patch modified
loongarch ipi device as percpu deivce, so that there are
2 MemoryRegions with ipi device, rather than 2*cpus
MemoryRegions, which may be large than QDEV_MAX_MMIO if
more cpus are added on loongarch virt machine.

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
  hw/intc/loongarch_ipi.c         | 32 ++++++++++----------------------
  hw/loongarch/virt.c             | 12 ++++++------
  include/hw/intc/loongarch_ipi.h | 10 ++++------
  include/hw/loongarch/virt.h     |  1 -
  4 files changed, 20 insertions(+), 35 deletions(-)


  static const VMStateDescription vmstate_ipi_core = {
@@ -233,7 +223,7 @@ static const VMStateDescription vmstate_ipi_core = {
          VMSTATE_UINT32(en, IPICore),
          VMSTATE_UINT32(set, IPICore),
          VMSTATE_UINT32(clear, IPICore),
-        VMSTATE_UINT32_ARRAY(buf, IPICore, MAX_IPI_MBX_NUM * 2),
+        VMSTATE_UINT32_ARRAY(buf, IPICore, 2),

Since this break the migration stream, you should update the version_id.

          VMSTATE_END_OF_LIST()
      }
  };
@@ -243,9 +233,7 @@ static const VMStateDescription vmstate_loongarch_ipi = {
      .version_id = 0,

Ditto.

      .minimum_version_id = 0,
      .fields = (VMStateField[]) {
-        VMSTATE_STRUCT_ARRAY(ipi_core, LoongArchMachineState,
-                             MAX_IPI_CORE_NUM, 0,
-                             vmstate_ipi_core, IPICore),
+        VMSTATE_STRUCT(ipi_core, LoongArchIPI, 0, vmstate_ipi_core, IPICore),
          VMSTATE_END_OF_LIST()
      }
  };

The rest LGTM.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]