From patchwork Tue Apr 29 08:51:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 885715 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:38f:210b:807b with SMTP id g4csp209630wrq; Tue, 29 Apr 2025 01:52:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXySV8YRV00ETVjZra4tn6SSfy1DDBQrXyoe1HLj1fgu4qb7lAtDQehjZyIyVTX+d0MV4QkZA==@linaro.org X-Google-Smtp-Source: AGHT+IGQi9N6BzNL/N0ekM/qs3v1rOxsb56QDwaYQm4DoHdW68rie/SX98RCm2bzgM9coh7XHXm8 X-Received: by 2002:a05:6214:2422:b0:6ed:1651:e8dc with SMTP id 6a1803df08f44-6f4f05614fdmr36912706d6.11.1745916768598; Tue, 29 Apr 2025 01:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745916768; cv=none; d=google.com; s=arc-20240605; b=U99jmuzk6DOtqKWTXRs3vIhKoYICEsBh+9/o0OS7hOO2kjEHswbJbb6PgRF/TtjTzF dvgdU5GfrWLiYOZzzQYWkGRhWP78yiEVL8PjBvTIpXWYpkssbyQkrTTl6O+FJ6VGq575 dlF3OqS4eKGj/su6YQtK91kFkBtT1d7dMWVZfxzaInaEv40e3hNx3dypcbTnPsODMzdL hXWC84Xv8nXwfoFZTF6aCrcuN9i89PSEi8Xw+Q9kGRM+jIck9ZhmvdCHOwqqzAmglTcY eZ5r7EYgAiLJeX3MNKvBh+UMR2/5YO9o6c0htaIn7c+Ve9uiEOOOQpbi9W8TVjj65HSa en5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=yKCscmoOEco5+B+YXBR9ZwtoiYDokiLDPDs4PkzViVE=; fh=HuQRkTcFJl7yvgMpK4c94QeivsenZFJyjsd+/1ciCbg=; b=FEHSXThc37B2Yer0UPtBiuJeopNpIQ+HnZ5bwfIFLTvQ9FMkShLPVvn3FwgS2Gs8Hv rekWksuGDlLKqSL3ToVG+RzmUNM7Ah2REVnvRq2hBsjSaGhNxdjNSmiylB9sQ5u/pTjS Re2IInc4wVtBT5d8O2UZk3NbVEKMt9A7qLLFk2lLDCNM9xHVCKOF5VufoNRu9IehICln ZDblENRjIoDq1PbexC0/iusB1bqTnnUv3pmbSzvxRsR7T6FTsja4Y6CXMFF9HfXX2kGe 6jKms97JMTfgflwDNYA9HI/P8/5lOjKp2TQTdGElAo2Fne2HE8e6YlbhfvlC4hJDXREX qlrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nux5nikd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6f4c08d27aasi123553966d6.73.2025.04.29.01.52.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Apr 2025 01:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nux5nikd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9gh4-0006Bt-As; Tue, 29 Apr 2025 04:51:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9gh2-0006Bh-UN for qemu-devel@nongnu.org; Tue, 29 Apr 2025 04:51:57 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9gh0-0000Yw-Ae for qemu-devel@nongnu.org; Tue, 29 Apr 2025 04:51:56 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43edecbfb94so53512885e9.1 for ; Tue, 29 Apr 2025 01:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745916711; x=1746521511; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yKCscmoOEco5+B+YXBR9ZwtoiYDokiLDPDs4PkzViVE=; b=nux5nikdgwLaT9x6qOUlk4idL3FryjaFQNsGoksX+J5LLqxc0V7Ay5vxbc/WsXFg2M cv7oKHDXNRumyAC0QQBe0M2KcXR+f/y2pAoG1qIpbu9vXAWz/mMLW6ChM06QkfPHW21y p+BLNciBhTYcE7m0rf9nevvl/MmEL/nQtBLmpR5cdQK0bjeA1xfvfzfYOw6Rpqd0BN8B 9u3jyFzNh7x9aeK85ti4G5hDDlD7mm0hrqSNqCgWOOn1g06sqMaMhCMhTYeyCaNi3VWU k5eC3v59OgYMh0ws1qWNLzbFs43zyglvjtb5X/O9YMrKTa5eAlukB4jlQCY8UEeIsZN+ d58Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745916711; x=1746521511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yKCscmoOEco5+B+YXBR9ZwtoiYDokiLDPDs4PkzViVE=; b=OluGNwkL/OjShlL5/LSQ3pjbs6Sj+9R94IsbwsRzFTMprVGySnmwyfn7A9HKJ7jRol JzRzzP3dx60j7OcDXC8HfJfAjcWn5rqUedJqecFM6hiwl10Bbi0ZM7FS2ccwRQs8LMp5 HgZ6TW46mrU4s8XHON73snvTjWuPwrgDhiJxB5iny+mDKoDrBAN7KxEEbe1xnXourwTd hqI8GVb4ck2MfG62YIA7dO0Z/9Q53tcG3nSGoJs49JUE0gl5/3t0DIWbruZz+xuA8omk F45Wfsjv20KXrAqek6D9miZiSk/qpiurKC/fuwRz7UP4CsGybP81Nv44Lf3gpy0BbcNB k7uA== X-Gm-Message-State: AOJu0YzNwJgV326hknBFgaqR1MB2LBTitUlERWd0mwK6ZYBKZ/LekTfG 8cpovtRnEvbdR29bYdAYXfsHs2xbFR3DbumH35LG9wySCnyCcSJUC1NHigXCIflEnSQ30T3rbT7 P X-Gm-Gg: ASbGnctwWSI6y2bLAxOgVU+K5xHhbNzBcMmJba682kMftwVb/r91UW1cmXWYi8oy0Fp CTPf5BQCG2tIKbKqb0ojA464iGIsn7tqsr+poTZqEzgKxAhPECUcLjmXKRcoDRe70fr5wEHHeCF FOx4CL09RUqmb8jO+LzIXWwRLnlB+PDWu2KlkE6X5rxphCGl1+Iy8WDmLevis3OYrVwzbfSP+p0 7ksDoXE5hdSDa3NslKB3Onan0TuIFFHtAD9jz7J3p7TFZONwuf+WorNQW/REqJy0fckWKR1I+EN 07bfOIAcbuEQrKV8A27ldMc8w+jtRgRSub0o80cGrIjeiD4RO8RiNL8rIS7Y21NU7ceXSeADvts 5b2lWWoeffR/gJoJ92sMjo1XnO+QaLdU= X-Received: by 2002:a05:600c:1d9b:b0:43c:fe15:41cb with SMTP id 5b1f17b1804b1-441ac85cf5bmr28893445e9.15.1745916710833; Tue, 29 Apr 2025 01:51:50 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4409d2d8154sm180253175e9.30.2025.04.29.01.51.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 29 Apr 2025 01:51:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Richard Henderson , Zhao Liu , Pierrick Bouvier , Stafford Horne , "Edgar E. Iglesias" , Helge Deller , Yanan Wang , Fabiano Rosas , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH] target/migration: Inline VMSTATE_CPU() Date: Tue, 29 Apr 2025 10:51:48 +0200 Message-ID: <20250429085148.11876-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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é Acked-by: Peter Xu Reviewed-by: Richard Henderson --- 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() }