From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Markus Armbruster" <armbru@redhat.com>
Subject: [RFC PATCH-for-10.1 18/39] target/arm: Move some definitions from 'cpu.h' to 'multiprocessing.h'
Date: Fri, 4 Apr 2025 01:58:00 +0200 [thread overview]
Message-ID: <20250403235821.9909-19-philmd@linaro.org> (raw)
In-Reply-To: <20250403235821.9909-1-philmd@linaro.org>
arm_build_mp_affinity() and affinity mask definitionss are
related to multiprocessing. Move them to "multiprocessing.h",
including this header when necessary.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
target/arm/cpu.h | 17 -----------------
target/arm/multiprocessing.h | 18 ++++++++++++++++++
hw/arm/aspeed_ast2600.c | 1 +
hw/arm/aspeed_ast27x0.c | 1 +
hw/arm/exynos4210.c | 1 +
hw/arm/npcm8xx.c | 1 +
hw/arm/sbsa-ref.c | 1 +
hw/vmapple/vmapple.c | 1 +
target/arm/kvm.c | 1 +
9 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 1a1ae229e1d..0db7292698c 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -1158,23 +1158,6 @@ void gt_rme_post_el_change(ARMCPU *cpu, void *opaque);
void arm_cpu_post_init(Object *obj);
-#define ARM_AFF0_SHIFT 0
-#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT)
-#define ARM_AFF1_SHIFT 8
-#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT)
-#define ARM_AFF2_SHIFT 16
-#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT)
-#define ARM_AFF3_SHIFT 32
-#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT)
-#define ARM_DEFAULT_CPUS_PER_CLUSTER 8
-
-#define ARM32_AFFINITY_MASK (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK)
-#define ARM64_AFFINITY_MASK \
- (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK | ARM_AFF3_MASK)
-#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK)
-
-uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
-
#ifndef CONFIG_USER_ONLY
extern const VMStateDescription vmstate_arm_cpu;
diff --git a/target/arm/multiprocessing.h b/target/arm/multiprocessing.h
index 81715d345c2..8eec79b11d8 100644
--- a/target/arm/multiprocessing.h
+++ b/target/arm/multiprocessing.h
@@ -11,6 +11,24 @@
#include "target/arm/cpu-qom.h"
+#define ARM_AFF0_SHIFT 0
+#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT)
+#define ARM_AFF1_SHIFT 8
+#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT)
+#define ARM_AFF2_SHIFT 16
+#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT)
+#define ARM_AFF3_SHIFT 32
+#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT)
+#define ARM_DEFAULT_CPUS_PER_CLUSTER 8
+
+#define ARM32_AFFINITY_MASK \
+ (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK)
+#define ARM64_AFFINITY_MASK \
+ (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK|ARM_AFF3_MASK)
+#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK)
+
+uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
+
uint64_t arm_cpu_mp_affinity(ARMCPU *cpu);
#endif
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index 1f994ba26c6..4438402340b 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -17,6 +17,7 @@
#include "net/net.h"
#include "system/system.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/multiprocessing.h"
#define ASPEED_SOC_IOMEM_SIZE 0x00200000
#define ASPEED_SOC_DPMCU_SIZE 0x00040000
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index dce7255a2c0..37bfeef304d 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -22,6 +22,7 @@
#include "hw/intc/arm_gicv3.h"
#include "qobject/qlist.h"
#include "qemu/log.h"
+#include "target/arm/multiprocessing.h"
static const hwaddr aspeed_soc_ast2700_memmap[] = {
[ASPEED_DEV_SRAM] = 0x10000000,
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 04439364370..01e6e2fb052 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -36,6 +36,7 @@
#include "hw/sd/sdhci.h"
#include "hw/usb/hcd-ehci.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/multiprocessing.h"
#define EXYNOS4210_CHIPID_ADDR 0x10000000
diff --git a/hw/arm/npcm8xx.c b/hw/arm/npcm8xx.c
index f182accc47c..3987e55355b 100644
--- a/hw/arm/npcm8xx.c
+++ b/hw/arm/npcm8xx.c
@@ -29,6 +29,7 @@
#include "qapi/error.h"
#include "qemu/units.h"
#include "system/system.h"
+#include "target/arm/multiprocessing.h"
/*
* This covers the whole MMIO space. We'll use this to catch any MMIO accesses
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 112cbbf29e6..90fbb56ba7a 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -52,6 +52,7 @@
#include "qom/object.h"
#include "target/arm/cpu-qom.h"
#include "target/arm/gtimer.h"
+#include "target/arm/multiprocessing.h"
#define RAMLIMIT_GB 8192
#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
diff --git a/hw/vmapple/vmapple.c b/hw/vmapple/vmapple.c
index fa117bf1511..9bb5b0553a2 100644
--- a/hw/vmapple/vmapple.c
+++ b/hw/vmapple/vmapple.c
@@ -51,6 +51,7 @@
#include "system/reset.h"
#include "system/runstate.h"
#include "system/system.h"
+#include "target/arm/multiprocessing.h"
struct VMAppleMachineState {
MachineState parent;
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 97de8c7e939..a28acdecf3e 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -39,6 +39,7 @@
#include "hw/acpi/acpi.h"
#include "hw/acpi/ghes.h"
#include "target/arm/gtimer.h"
+#include "target/arm/multiprocessing.h"
#include "migration/blocker.h"
const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
--
2.47.1
next prev parent reply other threads:[~2025-04-04 0:00 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 23:57 [RFC PATCH-for-10.1 00/39] single-binary: Make hw/arm/ common Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 01/39] target/arm: Implement per-binary TargetInfo structures Philippe Mathieu-Daudé
2025-04-04 18:16 ` Pierrick Bouvier
2025-04-03 23:57 ` [RFC PATCH-for-10.1 02/39] target/arm: Register TYPE_BINARY_QEMU_SYSTEM_ARM/AARCH64 interfaces Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 03/39] target/arm: Filter CPU types for binary Philippe Mathieu-Daudé
2025-04-04 18:17 ` Pierrick Bouvier
2025-04-03 23:57 ` [RFC PATCH-for-10.1 04/39] hw/arm: Filter machine " Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 05/39] hw/arm/aspeed: " Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 06/39] hw/arm/aspeed: Build objects once Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 07/39] hw/arm/raspi: Filter machine types for binary Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 08/39] hw/arm/raspi: Build objects once Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 09/39] target/arm/cpregs: Include missing 'target/arm/cpu.h' header Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 10/39] hw/arm/boot: Include missing 'system/memory.h' header Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 11/39] hw/arm: Use full "target/arm/cpu.h" path to include target's "cpu.h" Philippe Mathieu-Daudé
2025-04-04 18:20 ` Pierrick Bouvier
2025-04-04 21:53 ` Philippe Mathieu-Daudé
2025-04-05 1:03 ` Pierrick Bouvier
2025-04-05 14:27 ` Philippe Mathieu-Daudé
2025-04-07 17:13 ` Pierrick Bouvier
2025-04-03 23:57 ` [RFC PATCH-for-10.1 12/39] target/arm/cpu-features: Include missing 'cpu.h' header Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 13/39] target/arm/qmp: " Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 14/39] target/arm/kvm: Include missing 'cpu-qom.h' header Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 15/39] target/arm/hvf: " Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 16/39] hw/arm: Remove unnecessary 'cpu.h' header Philippe Mathieu-Daudé
2025-04-03 23:57 ` [RFC PATCH-for-10.1 17/39] target/arm: Restrict inclusion of 'multiprocessing.h' Philippe Mathieu-Daudé
2025-04-03 23:58 ` Philippe Mathieu-Daudé [this message]
2025-04-03 23:58 ` [RFC PATCH-for-10.1 19/39] hw/arm: Include missing 'target/arm/gtimer.h' header Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 20/39] target/arm: Extract PSCI definitions to 'psci.h' Philippe Mathieu-Daudé
2025-04-04 18:21 ` Pierrick Bouvier
2025-04-04 21:54 ` Philippe Mathieu-Daudé
2025-04-05 1:03 ` Pierrick Bouvier
2025-04-05 14:43 ` Philippe Mathieu-Daudé
2025-04-07 17:25 ` Pierrick Bouvier
2025-04-03 23:58 ` [RFC PATCH-for-10.1 21/39] target/arm: Extract feature definitions to 'cpu_has_feature.h' header Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 22/39] target/arm: Add arm_cpu_has_feature() helper Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 23/39] hw/arm/realview: Replace arm_feature() -> arm_cpu_has_feature() Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 24/39] hw/arm/virt-acpi: " Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 25/39] hw/arm: Build virt-acpi-build.c once Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 26/39] system/hvf: Avoid including 'cpu.h' Philippe Mathieu-Daudé
2025-05-06 14:14 ` Philippe Mathieu-Daudé
2025-05-06 15:00 ` Pierrick Bouvier
2025-04-03 23:58 ` [RFC PATCH-for-10.1 27/39] system/hvf: Expose hvf_enabled() to common code Philippe Mathieu-Daudé
2025-04-04 18:23 ` Pierrick Bouvier
2025-04-04 21:56 ` Philippe Mathieu-Daudé
2025-04-05 1:05 ` Pierrick Bouvier
2025-04-03 23:58 ` [RFC PATCH-for-10.1 28/39] exec: Do not poison hardware accelerators Philippe Mathieu-Daudé
2025-04-04 18:25 ` Pierrick Bouvier
2025-04-04 22:00 ` Philippe Mathieu-Daudé
2025-04-05 1:07 ` Pierrick Bouvier
2025-04-03 23:58 ` [RFC PATCH-for-10.1 29/39] hw/arm: Build sbsa-ref.c once Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 30/39] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 31/39] target/arm: Replace target_ulong -> uint64_t for HWBreakpoint Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 32/39] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 33/39] hw/core/machine: Allow dynamic registration of valid CPU types Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 34/39] hw/arm/virt: Register valid CPU types dynamically Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 35/39] hw/arm/virt: Replace TARGET_AARCH64 -> target_long_bits() Philippe Mathieu-Daudé
2025-04-04 18:28 ` Pierrick Bouvier
2025-04-04 22:05 ` Philippe Mathieu-Daudé
2025-04-05 1:10 ` Pierrick Bouvier
2025-04-03 23:58 ` [RFC PATCH-for-10.1 36/39] target/arm: Expose Aarch64 helpers indistinctly Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 37/39] hw/arm: Build virt.c once Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 38/39] hw/arm: Move xen files to arm_common_ss[] Philippe Mathieu-Daudé
2025-04-04 14:40 ` Philippe Mathieu-Daudé
2025-04-03 23:58 ` [RFC PATCH-for-10.1 39/39] hw/arm/meson: Remove arm_ss[] source set Philippe Mathieu-Daudé
2025-04-04 17:12 ` [RFC PATCH-for-10.1 00/39] single-binary: Make hw/arm/ common Pierrick Bouvier
2025-04-04 18:04 ` Philippe Mathieu-Daudé
2025-04-04 18:30 ` Pierrick Bouvier
2025-04-04 18:33 ` Pierrick Bouvier
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=20250403235821.9909-19-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=pierrick.bouvier@linaro.org \
--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).