From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Peter Xu" <peterx@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: [PULL 04/22] target/migration: Inline VMSTATE_CPU()
Date: Tue, 6 May 2025 16:34:53 +0200 [thread overview]
Message-ID: <20250506143512.4315-5-philmd@linaro.org> (raw)
In-Reply-To: <20250506143512.4315-1-philmd@linaro.org>
VMSTATE_CPU() is only used in 4 places and doesn't provide
much, directly inline it using VMSTATE_STRUCT().
This removes the last COMPILING_PER_TARGET in "hw/core/cpu.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250429085148.11876-1-philmd@linaro.org>
---
include/hw/core/cpu.h | 12 ------------
target/alpha/machine.c | 2 +-
target/hppa/machine.c | 2 +-
target/microblaze/machine.c | 2 +-
target/openrisc/machine.c | 2 +-
5 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 12b2ff1f7d2..1e87f7d393e 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -1121,20 +1121,8 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp);
void cpu_exec_unrealizefn(CPUState *cpu);
void cpu_exec_reset_hold(CPUState *cpu);
-#ifdef COMPILING_PER_TARGET
-
extern const VMStateDescription vmstate_cpu_common;
-#define VMSTATE_CPU() { \
- .name = "parent_obj", \
- .size = sizeof(CPUState), \
- .vmsd = &vmstate_cpu_common, \
- .flags = VMS_STRUCT, \
- .offset = 0, \
-}
-
-#endif /* COMPILING_PER_TARGET */
-
#define UNASSIGNED_CPU_INDEX -1
#define UNASSIGNED_CLUSTER_INDEX -1
diff --git a/target/alpha/machine.c b/target/alpha/machine.c
index f09834f635d..5f302b166da 100644
--- a/target/alpha/machine.c
+++ b/target/alpha/machine.c
@@ -74,7 +74,7 @@ static const VMStateDescription vmstate_env = {
};
static const VMStateField vmstate_cpu_fields[] = {
- VMSTATE_CPU(),
+ VMSTATE_STRUCT(parent_obj, AlphaCPU, 0, vmstate_cpu_common, CPUState),
VMSTATE_STRUCT(env, AlphaCPU, 1, vmstate_env, CPUAlphaState),
VMSTATE_END_OF_LIST()
};
diff --git a/target/hppa/machine.c b/target/hppa/machine.c
index bb47a2e689f..13e555151a6 100644
--- a/target/hppa/machine.c
+++ b/target/hppa/machine.c
@@ -216,7 +216,7 @@ static const VMStateDescription vmstate_env = {
};
static const VMStateField vmstate_cpu_fields[] = {
- VMSTATE_CPU(),
+ VMSTATE_STRUCT(parent_obj, HPPACPU, 0, vmstate_cpu_common, CPUState),
VMSTATE_STRUCT(env, HPPACPU, 1, vmstate_env, CPUHPPAState),
VMSTATE_END_OF_LIST()
};
diff --git a/target/microblaze/machine.c b/target/microblaze/machine.c
index 51705e4f5c9..a4cf38dc891 100644
--- a/target/microblaze/machine.c
+++ b/target/microblaze/machine.c
@@ -93,7 +93,7 @@ static const VMStateDescription vmstate_env = {
};
static const VMStateField vmstate_cpu_fields[] = {
- VMSTATE_CPU(),
+ VMSTATE_STRUCT(parent_obj, MicroBlazeCPU, 0, vmstate_cpu_common, CPUState),
VMSTATE_STRUCT(env, MicroBlazeCPU, 1, vmstate_env, CPUMBState),
VMSTATE_END_OF_LIST()
};
diff --git a/target/openrisc/machine.c b/target/openrisc/machine.c
index 3574e571cb2..081c706d02c 100644
--- a/target/openrisc/machine.c
+++ b/target/openrisc/machine.c
@@ -136,7 +136,7 @@ const VMStateDescription vmstate_openrisc_cpu = {
.minimum_version_id = 1,
.post_load = cpu_post_load,
.fields = (const VMStateField[]) {
- VMSTATE_CPU(),
+ VMSTATE_STRUCT(parent_obj, OpenRISCCPU, 0, vmstate_cpu_common, CPUState),
VMSTATE_STRUCT(env, OpenRISCCPU, 1, vmstate_env, CPUOpenRISCState),
VMSTATE_END_OF_LIST()
}
--
2.47.1
next prev parent reply other threads:[~2025-05-06 14:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 14:34 [PULL 00/22] Misc HW patches for 2025-05-06 Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 01/22] bsd-user: add option to enable plugins Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 02/22] qom: Factor qom_resolve_path() out Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 03/22] qom/object: Fix typo in comment Philippe Mathieu-Daudé
2025-05-06 14:34 ` Philippe Mathieu-Daudé [this message]
2025-05-06 14:34 ` [PULL 05/22] target/i386/hvf: Include missing 'exec/target_page.h' header Philippe Mathieu-Daudé
2025-05-07 6:35 ` Wei Liu
2025-05-07 11:20 ` Philippe Mathieu-Daudé
2025-05-08 1:09 ` Wei Liu
2025-05-06 14:34 ` [PULL 06/22] system/hvf: Avoid including 'cpu.h' Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 07/22] system/hvf: Expose hvf_enabled() to common code Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 08/22] hw/hyperv/hv-balloon-stub: common compilation unit Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 09/22] hw/hyperv/hyperv.h: header cleanup Philippe Mathieu-Daudé
2025-05-06 14:34 ` [PULL 10/22] hw/hyperv/vmbus: common compilation unit Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 11/22] hw/hyperv/syndbg: " Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 12/22] hw/hyperv/balloon: common balloon compilation units Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 13/22] hw/hyperv/hyperv_testdev: common compilation unit Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 14/22] hw/hyperv/hyperv: " Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 15/22] hw/core/machine: Fix indentation Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 16/22] hw/pci/pcie_port: Fix pcie_slot_is_hotpluggbale_bus typo Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 17/22] hw/acpi/ged: Fix wrong identation Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 18/22] hw/i386/acpi-build: Fix build_append_notfication_callback typo Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 19/22] hw/i386/acpi-build: Update document reference Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 20/22] hw/i386/acpi-build: Fix typo and grammar in comment Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 21/22] hw/acpi/pcihp: Fix typo in function name Philippe Mathieu-Daudé
2025-05-06 14:35 ` [PULL 22/22] hw/isa/ich9: Remove stray empty comment Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250506143512.4315-5-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).