* [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once
@ 2024-01-18 20:06 Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 01/20] hw/arm/exynos4210: Include missing 'exec/tswap.h' header Philippe Mathieu-Daudé
` (22 more replies)
0 siblings, 23 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
Hi,
In order to fix a bug noticed [*] by Cédric and Fabiano in my
"Remove one use of qemu_get_cpu() in A7/A15 MPCore priv" series,
I ended reusing commits from other branches and it grew quite
a lot. This is the first "cleanup" part, unrelated on MPCorePriv.
Please review,
Phil.
Philippe Mathieu-Daudé (18):
hw/arm/exynos4210: Include missing 'exec/tswap.h' header
hw/arm/xilinx_zynq: Include missing 'exec/tswap.h' header
hw/arm/smmuv3: Include missing 'hw/registerfields.h' header
hw/arm/xlnx-versal: Include missing 'cpu.h' header
target/arm/cpu-features: Include missing 'hw/registerfields.h' header
target/arm/cpregs: Include missing 'hw/registerfields.h' header
target/arm/cpregs: Include missing 'kvm-consts.h' header
target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header
target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'
hw/cpu/a9mpcore: Build it only once
hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of
'cpu.h'
hw/misc/xlnx-versal-crl: Build it only once
target/arm: Expose M-profile register bank index definitions
hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header
target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header
target/arm: Move e2h_access() helper around
target/arm: Move GTimer definitions to new 'gtimer.h' header
hw/arm: Build various units only once
Richard Henderson (2):
target/arm: Rename arm_cpu_mp_affinity
target/arm: Create arm_cpu_mp_affinity
hw/arm/smmuv3-internal.h | 1 +
include/hw/arm/xlnx-versal.h | 1 +
include/hw/intc/armv7m_nvic.h | 2 +-
include/hw/misc/xlnx-versal-crl.h | 2 +-
target/arm/cpregs.h | 3 +++
target/arm/cpu-features.h | 2 ++
target/arm/cpu-qom.h | 24 ++++++++++++++++++++++
target/arm/cpu.h | 34 +++----------------------------
target/arm/gtimer.h | 21 +++++++++++++++++++
target/arm/multiprocessing.h | 16 +++++++++++++++
hw/arm/allwinner-a10.c | 1 +
hw/arm/allwinner-h3.c | 2 ++
hw/arm/allwinner-r40.c | 2 ++
hw/arm/armv7m.c | 2 ++
hw/arm/aspeed_ast2400.c | 1 +
hw/arm/aspeed_ast2600.c | 1 +
hw/arm/bcm2836.c | 2 ++
hw/arm/collie.c | 1 -
hw/arm/exynos4210.c | 2 ++
hw/arm/fsl-imx25.c | 1 +
hw/arm/fsl-imx31.c | 1 +
hw/arm/fsl-imx6.c | 1 +
hw/arm/fsl-imx6ul.c | 1 +
hw/arm/fsl-imx7.c | 1 +
hw/arm/gumstix.c | 1 -
hw/arm/highbank.c | 1 +
hw/arm/integratorcp.c | 2 +-
hw/arm/mainstone.c | 1 -
hw/arm/musicpal.c | 2 +-
hw/arm/npcm7xx.c | 3 ++-
hw/arm/omap1.c | 1 +
hw/arm/omap2.c | 2 +-
hw/arm/omap_sx1.c | 1 -
hw/arm/palm.c | 1 -
hw/arm/realview.c | 1 +
hw/arm/sbsa-ref.c | 4 +++-
hw/arm/spitz.c | 1 -
hw/arm/strongarm.c | 2 +-
hw/arm/versatilepb.c | 2 +-
hw/arm/vexpress.c | 2 +-
hw/arm/virt-acpi-build.c | 4 ++--
hw/arm/virt.c | 11 ++++++----
hw/arm/xilinx_zynq.c | 3 ++-
hw/arm/xlnx-versal-virt.c | 5 +++--
hw/arm/xlnx-versal.c | 2 ++
hw/arm/xlnx-zynqmp.c | 2 ++
hw/arm/z2.c | 1 -
hw/cpu/a15mpcore.c | 1 +
hw/cpu/a9mpcore.c | 2 +-
hw/misc/xlnx-versal-crl.c | 5 +++--
target/arm/arm-powerctl.c | 3 ++-
target/arm/cpu.c | 13 +++++++++---
target/arm/helper.c | 30 ++++++++++++++-------------
target/arm/hvf/hvf.c | 6 ++++--
target/arm/kvm.c | 1 +
target/arm/machine.c | 1 +
target/arm/tcg/psci.c | 3 ++-
hw/arm/meson.build | 23 +++++++++++----------
hw/cpu/meson.build | 2 +-
hw/misc/meson.build | 2 +-
60 files changed, 178 insertions(+), 94 deletions(-)
create mode 100644 target/arm/gtimer.h
create mode 100644 target/arm/multiprocessing.h
--
2.41.0
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 01/20] hw/arm/exynos4210: Include missing 'exec/tswap.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 02/20] hw/arm/xilinx_zynq: " Philippe Mathieu-Daudé
` (21 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
hw/arm/exynos4210.c calls tswap32() which is declared
in "exec/tswap.h". Include it in order to avoid when
refactoring unrelated headers:
hw/arm/exynos4210.c:499:22: error: call to undeclared function 'tswap32';
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
smpboot[n] = tswap32(smpboot[n]);
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/exynos4210.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index de39fb0ece..af511a153d 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -23,6 +23,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "exec/tswap.h"
#include "cpu.h"
#include "hw/cpu/a9mpcore.h"
#include "hw/irq.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 02/20] hw/arm/xilinx_zynq: Include missing 'exec/tswap.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 01/20] hw/arm/exynos4210: Include missing 'exec/tswap.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 03/20] hw/arm/smmuv3: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
` (20 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
hw/arm/xilinx_zynq.c calls tswap32() which is declared
in "exec/tswap.h". Include it in order to avoid when
refactoring unrelated headers:
hw/arm/xilinx_zynq.c:103:31: error: call to undeclared function 'tswap32';
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
board_setup_blob[n] = tswap32(board_setup_blob[n]);
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/xilinx_zynq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index dbb9793aa1..d4c817ecdc 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -37,6 +37,7 @@
#include "hw/qdev-clock.h"
#include "sysemu/reset.h"
#include "qom/object.h"
+#include "exec/tswap.h"
#define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9")
OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE)
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 03/20] hw/arm/smmuv3: Include missing 'hw/registerfields.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 01/20] hw/arm/exynos4210: Include missing 'exec/tswap.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 02/20] hw/arm/xilinx_zynq: " Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 04/20] hw/arm/xlnx-versal: Include missing 'cpu.h' header Philippe Mathieu-Daudé
` (19 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
hw/arm/smmuv3-internal.h uses the REG32() and FIELD()
macros defined in "hw/registerfields.h". Include it in
order to avoid when refactoring unrelated headers:
In file included from ../../hw/arm/smmuv3.c:34:
hw/arm/smmuv3-internal.h:36:28: error: expected identifier
REG32(IDR0, 0x0)
^
hw/arm/smmuv3-internal.h:37:5: error: expected function body after function declarator
FIELD(IDR0, S2P, 0 , 1)
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/smmuv3-internal.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h
index 6076025ad6..e987bc4686 100644
--- a/hw/arm/smmuv3-internal.h
+++ b/hw/arm/smmuv3-internal.h
@@ -21,6 +21,7 @@
#ifndef HW_ARM_SMMUV3_INTERNAL_H
#define HW_ARM_SMMUV3_INTERNAL_H
+#include "hw/registerfields.h"
#include "hw/arm/smmu-common.h"
typedef enum SMMUTranslationStatus {
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 04/20] hw/arm/xlnx-versal: Include missing 'cpu.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 03/20] hw/arm/smmuv3: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 05/20] target/arm/cpu-features: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
` (18 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
include/hw/arm/xlnx-versal.h uses the ARMCPU structure which
is defined in the "target/arm/cpu.h" header. Include it in
order to avoid when refactoring unrelated headers:
In file included from hw/arm/xlnx-versal-virt.c:20:
include/hw/arm/xlnx-versal.h:62:23: error: array has incomplete element type 'ARMCPU' (aka 'struct ArchCPU')
ARMCPU cpu[XLNX_VERSAL_NR_ACPUS];
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/arm/xlnx-versal.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
index b24fa64557..025beb5532 100644
--- a/include/hw/arm/xlnx-versal.h
+++ b/include/hw/arm/xlnx-versal.h
@@ -34,6 +34,7 @@
#include "hw/net/xlnx-versal-canfd.h"
#include "hw/misc/xlnx-versal-cfu.h"
#include "hw/misc/xlnx-versal-cframe-reg.h"
+#include "target/arm/cpu.h"
#define TYPE_XLNX_VERSAL "xlnx-versal"
OBJECT_DECLARE_SIMPLE_TYPE(Versal, XLNX_VERSAL)
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 05/20] target/arm/cpu-features: Include missing 'hw/registerfields.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 04/20] hw/arm/xlnx-versal: Include missing 'cpu.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 06/20] target/arm/cpregs: " Philippe Mathieu-Daudé
` (17 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
target/arm/cpu-features.h uses the FIELD_EX32() macro
defined in "hw/registerfields.h". Include it in order
to avoid when refactoring unrelated headers:
target/arm/cpu-features.h:44:12: error: call to undeclared function 'FIELD_EX32';
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0;
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu-features.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h
index 7a590c824c..028795ff23 100644
--- a/target/arm/cpu-features.h
+++ b/target/arm/cpu-features.h
@@ -20,6 +20,8 @@
#ifndef TARGET_ARM_FEATURES_H
#define TARGET_ARM_FEATURES_H
+#include "hw/registerfields.h"
+
/*
* Naming convention for isar_feature functions:
* Functions which test 32-bit ID registers should have _aa32_ in
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 06/20] target/arm/cpregs: Include missing 'hw/registerfields.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 05/20] target/arm/cpu-features: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header Philippe Mathieu-Daudé
` (16 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
target/arm/cpregs.h uses the FIELD() macro defined in
"hw/registerfields.h". Include it in order to avoid when
refactoring unrelated headers:
target/arm/cpregs.h:347:30: error: expected identifier
FIELD(HFGRTR_EL2, AFSR0_EL1, 0, 1)
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpregs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h
index b6fdd0f3eb..ca2d6006ce 100644
--- a/target/arm/cpregs.h
+++ b/target/arm/cpregs.h
@@ -21,6 +21,8 @@
#ifndef TARGET_ARM_CPREGS_H
#define TARGET_ARM_CPREGS_H
+#include "hw/registerfields.h"
+
/*
* ARMCPRegInfo type field bits:
*/
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 06/20] target/arm/cpregs: " Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity Philippe Mathieu-Daudé
` (15 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
target/arm/cpregs.h uses the CP_REG_ARCH_* definitions
from "target/arm/kvm-consts.h". Include it in order to
avoid when refactoring unrelated headers:
target/arm/cpregs.h:191:18: error: use of undeclared identifier 'CP_REG_ARCH_MASK'
if ((kvmid & CP_REG_ARCH_MASK) == CP_REG_ARM64) {
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpregs.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h
index ca2d6006ce..cc7c54378f 100644
--- a/target/arm/cpregs.h
+++ b/target/arm/cpregs.h
@@ -22,6 +22,7 @@
#define TARGET_ARM_CPREGS_H
#include "hw/registerfields.h"
+#include "target/arm/kvm-consts.h"
/*
* ARMCPRegInfo type field bits:
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-04-15 12:51 ` Peter Maydell
2024-01-18 20:06 ` [PATCH 09/20] target/arm: Create arm_cpu_mp_affinity Philippe Mathieu-Daudé
` (14 subsequent siblings)
22 siblings, 1 reply; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm,
Richard Henderson
From: Richard Henderson <richard.henderson@linaro.org>
Rename to arm_build_mp_affinity. This frees up the name for
other usage, and emphasizes that the cpu object is not involved.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.h | 2 +-
hw/arm/npcm7xx.c | 2 +-
hw/arm/sbsa-ref.c | 2 +-
hw/arm/virt.c | 2 +-
target/arm/cpu.c | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index ec276fcd57..55a19e8539 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -1171,7 +1171,7 @@ void arm_cpu_post_init(Object *obj);
(ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK | ARM_AFF3_MASK)
#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK)
-uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz);
+uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
#ifndef CONFIG_USER_ONLY
extern const VMStateDescription vmstate_arm_cpu;
diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c
index 15ff21d047..7fb0a233b2 100644
--- a/hw/arm/npcm7xx.c
+++ b/hw/arm/npcm7xx.c
@@ -474,7 +474,7 @@ static void npcm7xx_realize(DeviceState *dev, Error **errp)
/* CPUs */
for (i = 0; i < nc->num_cpus; i++) {
object_property_set_int(OBJECT(&s->cpu[i]), "mp-affinity",
- arm_cpu_mp_affinity(i, NPCM7XX_MAX_NUM_CPUS),
+ arm_build_mp_affinity(i, NPCM7XX_MAX_NUM_CPUS),
&error_abort);
object_property_set_int(OBJECT(&s->cpu[i]), "reset-cbar",
NPCM7XX_GIC_CPU_IF_ADDR, &error_abort);
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 477dca0637..b8857d1e9e 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -148,7 +148,7 @@ static const int sbsa_ref_irqmap[] = {
static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
{
uint8_t clustersz = ARM_DEFAULT_CPUS_PER_CLUSTER;
- return arm_cpu_mp_affinity(idx, clustersz);
+ return arm_build_mp_affinity(idx, clustersz);
}
static void sbsa_fdt_add_gic_node(SBSAMachineState *sms)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 2793121cb4..3fc144236b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1676,7 +1676,7 @@ static uint64_t virt_cpu_mp_affinity(VirtMachineState *vms, int idx)
clustersz = GICV3_TARGETLIST_BITS;
}
}
- return arm_cpu_mp_affinity(idx, clustersz);
+ return arm_build_mp_affinity(idx, clustersz);
}
static inline bool *virt_get_high_memmap_enabled(VirtMachineState *vms,
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 826ce842c0..0bbba48faa 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1307,7 +1307,7 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags)
}
}
-uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz)
+uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz)
{
uint32_t Aff1 = idx / clustersz;
uint32_t Aff0 = idx % clustersz;
@@ -2113,8 +2113,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
* so these bits always RAZ.
*/
if (cpu->mp_affinity == ARM64_AFFINITY_INVALID) {
- cpu->mp_affinity = arm_cpu_mp_affinity(cs->cpu_index,
- ARM_DEFAULT_CPUS_PER_CLUSTER);
+ cpu->mp_affinity = arm_build_mp_affinity(cs->cpu_index,
+ ARM_DEFAULT_CPUS_PER_CLUSTER);
}
if (cpu->reset_hivecs) {
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 09/20] target/arm: Create arm_cpu_mp_affinity
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 10/20] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header Philippe Mathieu-Daudé
` (13 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm,
Richard Henderson
From: Richard Henderson <richard.henderson@linaro.org>
Wrapper to return the mp affinity bits from the cpu.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.h | 5 +++++
hw/arm/virt-acpi-build.c | 2 +-
hw/arm/virt.c | 6 +++---
hw/arm/xlnx-versal-virt.c | 3 ++-
hw/misc/xlnx-versal-crl.c | 4 ++--
target/arm/arm-powerctl.c | 2 +-
target/arm/hvf/hvf.c | 4 ++--
target/arm/tcg/psci.c | 2 +-
8 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 55a19e8539..d1584bdb3b 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -1173,6 +1173,11 @@ void arm_cpu_post_init(Object *obj);
uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
+static inline uint64_t arm_cpu_mp_affinity(ARMCPU *cpu)
+{
+ return cpu->mp_affinity;
+}
+
#ifndef CONFIG_USER_ONLY
extern const VMStateDescription vmstate_arm_cpu;
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index a22a2f43a5..2127778c1e 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -720,7 +720,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
build_append_int_noprefix(table_data, vgic_interrupt, 4);
build_append_int_noprefix(table_data, 0, 8); /* GICR Base Address*/
/* MPIDR */
- build_append_int_noprefix(table_data, armcpu->mp_affinity, 8);
+ build_append_int_noprefix(table_data, arm_cpu_mp_affinity(armcpu), 8);
/* Processor Power Efficiency Class */
build_append_int_noprefix(table_data, 0, 1);
/* Reserved */
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 3fc144236b..34cba9ebd8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -370,7 +370,7 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms)
for (cpu = 0; cpu < smp_cpus; cpu++) {
ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu));
- if (armcpu->mp_affinity & ARM_AFF3_MASK) {
+ if (arm_cpu_mp_affinity(armcpu) & ARM_AFF3_MASK) {
addr_cells = 2;
break;
}
@@ -397,10 +397,10 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms)
if (addr_cells == 2) {
qemu_fdt_setprop_u64(ms->fdt, nodename, "reg",
- armcpu->mp_affinity);
+ arm_cpu_mp_affinity(armcpu));
} else {
qemu_fdt_setprop_cell(ms->fdt, nodename, "reg",
- armcpu->mp_affinity);
+ arm_cpu_mp_affinity(armcpu));
}
if (ms->possible_cpus->cpus[cs->cpu_index].props.has_node_id) {
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 537118224f..841ef69df6 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -107,7 +107,8 @@ static void fdt_add_cpu_nodes(VersalVirt *s, uint32_t psci_conduit)
ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(i));
qemu_fdt_add_subnode(s->fdt, name);
- qemu_fdt_setprop_cell(s->fdt, name, "reg", armcpu->mp_affinity);
+ qemu_fdt_setprop_cell(s->fdt, name, "reg",
+ arm_cpu_mp_affinity(armcpu));
if (psci_conduit != QEMU_PSCI_CONDUIT_DISABLED) {
qemu_fdt_setprop_string(s->fdt, name, "enable-method", "psci");
}
diff --git a/hw/misc/xlnx-versal-crl.c b/hw/misc/xlnx-versal-crl.c
index ac6889fcf2..9bfa9baa15 100644
--- a/hw/misc/xlnx-versal-crl.c
+++ b/hw/misc/xlnx-versal-crl.c
@@ -67,9 +67,9 @@ static void crl_reset_cpu(XlnxVersalCRL *s, ARMCPU *armcpu,
bool rst_old, bool rst_new)
{
if (rst_new) {
- arm_set_cpu_off(armcpu->mp_affinity);
+ arm_set_cpu_off(arm_cpu_mp_affinity(armcpu));
} else {
- arm_set_cpu_on_and_reset(armcpu->mp_affinity);
+ arm_set_cpu_on_and_reset(arm_cpu_mp_affinity(armcpu));
}
}
diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index 8850381565..6c86e90102 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -37,7 +37,7 @@ CPUState *arm_get_cpu_by_id(uint64_t id)
CPU_FOREACH(cpu) {
ARMCPU *armcpu = ARM_CPU(cpu);
- if (armcpu->mp_affinity == id) {
+ if (arm_cpu_mp_affinity(armcpu) == id) {
return cpu;
}
}
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index a537a5bc94..659401e12c 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1016,7 +1016,7 @@ static void hvf_raise_exception(CPUState *cpu, uint32_t excp,
static void hvf_psci_cpu_off(ARMCPU *arm_cpu)
{
- int32_t ret = arm_set_cpu_off(arm_cpu->mp_affinity);
+ int32_t ret = arm_set_cpu_off(arm_cpu_mp_affinity(arm_cpu));
assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);
}
@@ -1045,7 +1045,7 @@ static bool hvf_handle_psci_call(CPUState *cpu)
int32_t ret = 0;
trace_hvf_psci_call(param[0], param[1], param[2], param[3],
- arm_cpu->mp_affinity);
+ arm_cpu_mp_affinity(arm_cpu));
switch (param[0]) {
case QEMU_PSCI_0_2_FN_PSCI_VERSION:
diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c
index 9080a91d9c..50d4b23d26 100644
--- a/target/arm/tcg/psci.c
+++ b/target/arm/tcg/psci.c
@@ -215,7 +215,7 @@ err:
return;
cpu_off:
- ret = arm_set_cpu_off(cpu->mp_affinity);
+ ret = arm_set_cpu_off(arm_cpu_mp_affinity(cpu));
/* notreached */
/* sanity check in case something failed */
assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 10/20] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 09/20] target/arm: Create arm_cpu_mp_affinity Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 11/20] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h' Philippe Mathieu-Daudé
` (12 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
Declare arm_cpu_mp_affinity() prototype in the new
"target/arm/multiprocessing.h" header so units in
hw/arm/ can use it without having to include the huge
target-specific "cpu.h".
File list to include the new header generated using:
$ git grep -lw arm_cpu_mp_affinity
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.h | 6 +-----
target/arm/multiprocessing.h | 16 ++++++++++++++++
hw/arm/virt-acpi-build.c | 1 +
hw/arm/virt.c | 1 +
hw/arm/xlnx-versal-virt.c | 1 +
hw/misc/xlnx-versal-crl.c | 1 +
target/arm/arm-powerctl.c | 1 +
target/arm/cpu.c | 5 +++++
target/arm/hvf/hvf.c | 1 +
target/arm/tcg/psci.c | 1 +
10 files changed, 29 insertions(+), 5 deletions(-)
create mode 100644 target/arm/multiprocessing.h
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index d1584bdb3b..cecac4c0a1 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -26,6 +26,7 @@
#include "cpu-qom.h"
#include "exec/cpu-defs.h"
#include "qapi/qapi-types-common.h"
+#include "target/arm/multiprocessing.h"
/* ARM processors have a weak memory model */
#define TCG_GUEST_DEFAULT_MO (0)
@@ -1173,11 +1174,6 @@ void arm_cpu_post_init(Object *obj);
uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
-static inline uint64_t arm_cpu_mp_affinity(ARMCPU *cpu)
-{
- return cpu->mp_affinity;
-}
-
#ifndef CONFIG_USER_ONLY
extern const VMStateDescription vmstate_arm_cpu;
diff --git a/target/arm/multiprocessing.h b/target/arm/multiprocessing.h
new file mode 100644
index 0000000000..81715d345c
--- /dev/null
+++ b/target/arm/multiprocessing.h
@@ -0,0 +1,16 @@
+/*
+ * ARM multiprocessor CPU helpers
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef TARGET_ARM_MULTIPROCESSING_H
+#define TARGET_ARM_MULTIPROCESSING_H
+
+#include "target/arm/cpu-qom.h"
+
+uint64_t arm_cpu_mp_affinity(ARMCPU *cpu);
+
+#endif
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 2127778c1e..43ccc60f43 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -59,6 +59,7 @@
#include "hw/acpi/ghes.h"
#include "hw/acpi/viot.h"
#include "hw/virtio/virtio-acpi.h"
+#include "target/arm/multiprocessing.h"
#define ARM_SPI_BASE 32
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 34cba9ebd8..beba151620 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -74,6 +74,7 @@
#include "hw/arm/smmuv3.h"
#include "hw/acpi/acpi.h"
#include "target/arm/internals.h"
+#include "target/arm/multiprocessing.h"
#include "hw/mem/pc-dimm.h"
#include "hw/mem/nvdimm.h"
#include "hw/acpi/generic_event_device.h"
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 841ef69df6..29f4d2c2dc 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -20,6 +20,7 @@
#include "hw/qdev-properties.h"
#include "hw/arm/xlnx-versal.h"
#include "hw/arm/boot.h"
+#include "target/arm/multiprocessing.h"
#include "qom/object.h"
#define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
diff --git a/hw/misc/xlnx-versal-crl.c b/hw/misc/xlnx-versal-crl.c
index 9bfa9baa15..1f1762ef16 100644
--- a/hw/misc/xlnx-versal-crl.c
+++ b/hw/misc/xlnx-versal-crl.c
@@ -19,6 +19,7 @@
#include "hw/resettable.h"
#include "target/arm/arm-powerctl.h"
+#include "target/arm/multiprocessing.h"
#include "hw/misc/xlnx-versal-crl.h"
#ifndef XLNX_VERSAL_CRL_ERR_DEBUG
diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index 6c86e90102..2b2055c6ac 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -16,6 +16,7 @@
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "sysemu/tcg.h"
+#include "target/arm/multiprocessing.h"
#ifndef DEBUG_ARM_POWERCTL
#define DEBUG_ARM_POWERCTL 0
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 0bbba48faa..89e44a31fd 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1314,6 +1314,11 @@ uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz)
return (Aff1 << ARM_AFF1_SHIFT) | Aff0;
}
+uint64_t arm_cpu_mp_affinity(ARMCPU *cpu)
+{
+ return cpu->mp_affinity;
+}
+
static void arm_cpu_initfn(Object *obj)
{
ARMCPU *cpu = ARM_CPU(obj);
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 659401e12c..71a26db188 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -28,6 +28,7 @@
#include "arm-powerctl.h"
#include "target/arm/cpu.h"
#include "target/arm/internals.h"
+#include "target/arm/multiprocessing.h"
#include "trace/trace-target_arm_hvf.h"
#include "migration/vmstate.h"
diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c
index 50d4b23d26..51d2ca3d30 100644
--- a/target/arm/tcg/psci.c
+++ b/target/arm/tcg/psci.c
@@ -24,6 +24,7 @@
#include "sysemu/runstate.h"
#include "internals.h"
#include "arm-powerctl.h"
+#include "target/arm/multiprocessing.h"
bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 11/20] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 10/20] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 12/20] hw/cpu/a9mpcore: Build it only once Philippe Mathieu-Daudé
` (11 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm,
Richard Henderson
Missed in commit 2d56be5a29 ("target: Declare
FOO_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'"). See
it for more details.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu-qom.h | 3 +++
target/arm/cpu.h | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h
index 02b914c876..f795994135 100644
--- a/target/arm/cpu-qom.h
+++ b/target/arm/cpu-qom.h
@@ -33,4 +33,7 @@ typedef struct AArch64CPUClass AArch64CPUClass;
DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU,
TYPE_AARCH64_CPU)
+#define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
+#define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
+
#endif
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index cecac4c0a1..41659d0ef1 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2837,8 +2837,6 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);
#define ARM_CPUID_TI915T 0x54029152
#define ARM_CPUID_TI925T 0x54029252
-#define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
-#define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
#define CPU_RESOLVING_TYPE TYPE_ARM_CPU
#define TYPE_ARM_HOST_CPU "host-" TYPE_ARM_CPU
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 12/20] hw/cpu/a9mpcore: Build it only once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 11/20] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h' Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 13/20] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h' Philippe Mathieu-Daudé
` (10 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
hw/cpu/a9mpcore.c doesn't require "cpu.h" anymore.
By removing it, the unit become target agnostic:
we can build it once. Update meson.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/cpu/a9mpcore.c | 2 +-
hw/cpu/meson.build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index d03f57e579..c30ef72c66 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -15,7 +15,7 @@
#include "hw/irq.h"
#include "hw/qdev-properties.h"
#include "hw/core/cpu.h"
-#include "cpu.h"
+#include "target/arm/cpu-qom.h"
#define A9_GIC_NUM_PRIORITY_BITS 5
diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build
index 6d319947ca..38cdcfbe57 100644
--- a/hw/cpu/meson.build
+++ b/hw/cpu/meson.build
@@ -2,5 +2,5 @@ system_ss.add(files('core.c', 'cluster.c'))
system_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
system_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
-specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
+system_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 13/20] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h'
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 12/20] hw/cpu/a9mpcore: Build it only once Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 14/20] hw/misc/xlnx-versal-crl: Build it only once Philippe Mathieu-Daudé
` (9 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
"target/arm/cpu.h" is target specific, any file including it
becomes target specific too, thus this is the same for any file
including "hw/misc/xlnx-versal-crl.h".
"hw/misc/xlnx-versal-crl.h" doesn't require any target specific
definition however, only the target-agnostic QOM definitions
from "target/arm/cpu-qom.h". Include the latter header to avoid
tainting unnecessary objects as target-specific.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/misc/xlnx-versal-crl.h | 2 +-
hw/misc/xlnx-versal-crl.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/misc/xlnx-versal-crl.h b/include/hw/misc/xlnx-versal-crl.h
index dfb8dff197..dba6d3585d 100644
--- a/include/hw/misc/xlnx-versal-crl.h
+++ b/include/hw/misc/xlnx-versal-crl.h
@@ -11,7 +11,7 @@
#include "hw/sysbus.h"
#include "hw/register.h"
-#include "target/arm/cpu.h"
+#include "target/arm/cpu-qom.h"
#define TYPE_XLNX_VERSAL_CRL "xlnx-versal-crl"
OBJECT_DECLARE_SIMPLE_TYPE(XlnxVersalCRL, XLNX_VERSAL_CRL)
diff --git a/hw/misc/xlnx-versal-crl.c b/hw/misc/xlnx-versal-crl.c
index 1f1762ef16..1a596f1cf5 100644
--- a/hw/misc/xlnx-versal-crl.c
+++ b/hw/misc/xlnx-versal-crl.c
@@ -18,6 +18,7 @@
#include "hw/register.h"
#include "hw/resettable.h"
+#include "target/arm/cpu.h"
#include "target/arm/arm-powerctl.h"
#include "target/arm/multiprocessing.h"
#include "hw/misc/xlnx-versal-crl.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 14/20] hw/misc/xlnx-versal-crl: Build it only once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 13/20] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h' Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 15/20] target/arm: Expose M-profile register bank index definitions Philippe Mathieu-Daudé
` (8 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
hw/misc/xlnx-versal-crl.c doesn't require "cpu.h"
anymore. By removing it, the unit become target
agnostic: we can build it once. Update meson.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/misc/xlnx-versal-crl.c | 1 -
hw/misc/meson.build | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/misc/xlnx-versal-crl.c b/hw/misc/xlnx-versal-crl.c
index 1a596f1cf5..1f1762ef16 100644
--- a/hw/misc/xlnx-versal-crl.c
+++ b/hw/misc/xlnx-versal-crl.c
@@ -18,7 +18,6 @@
#include "hw/register.h"
#include "hw/resettable.h"
-#include "target/arm/cpu.h"
#include "target/arm/arm-powerctl.h"
#include "target/arm/multiprocessing.h"
#include "hw/misc/xlnx-versal-crl.h"
diff --git a/hw/misc/meson.build b/hw/misc/meson.build
index 36c20d5637..66820acac3 100644
--- a/hw/misc/meson.build
+++ b/hw/misc/meson.build
@@ -96,8 +96,8 @@ system_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_misc.c'))
system_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c'))
system_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp-crf.c'))
system_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp-apu-ctrl.c'))
-specific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-crl.c'))
system_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files(
+ 'xlnx-versal-crl.c',
'xlnx-versal-xramc.c',
'xlnx-versal-pmc-iou-slcr.c',
'xlnx-versal-cfu.c',
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 15/20] target/arm: Expose M-profile register bank index definitions
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (13 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 14/20] hw/misc/xlnx-versal-crl: Build it only once Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 16/20] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header Philippe Mathieu-Daudé
` (7 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
The ARMv7M QDev container accesses the QDev SysTickState
by its secure/non-secure bank index. In order to make
the "hw/intc/armv7m_nvic.h" header target-agnostic in
the next commit, first move the M-profile bank index
definitions to "target/arm/cpu-qom.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Or do we want these in a more specific header?
---
target/arm/cpu-qom.h | 15 +++++++++++++++
target/arm/cpu.h | 15 ---------------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h
index f795994135..77bbc1f13c 100644
--- a/target/arm/cpu-qom.h
+++ b/target/arm/cpu-qom.h
@@ -36,4 +36,19 @@ DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU,
#define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
#define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
+/* For M profile, some registers are banked secure vs non-secure;
+ * these are represented as a 2-element array where the first element
+ * is the non-secure copy and the second is the secure copy.
+ * When the CPU does not have implement the security extension then
+ * only the first element is used.
+ * This means that the copy for the current security state can be
+ * accessed via env->registerfield[env->v7m.secure] (whether the security
+ * extension is implemented or not).
+ */
+enum {
+ M_REG_NS = 0,
+ M_REG_S = 1,
+ M_REG_NUM_BANKS = 2,
+};
+
#endif
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 41659d0ef1..d6a79482ad 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -73,21 +73,6 @@
#define ARMV7M_EXCP_PENDSV 14
#define ARMV7M_EXCP_SYSTICK 15
-/* For M profile, some registers are banked secure vs non-secure;
- * these are represented as a 2-element array where the first element
- * is the non-secure copy and the second is the secure copy.
- * When the CPU does not have implement the security extension then
- * only the first element is used.
- * This means that the copy for the current security state can be
- * accessed via env->registerfield[env->v7m.secure] (whether the security
- * extension is implemented or not).
- */
-enum {
- M_REG_NS = 0,
- M_REG_S = 1,
- M_REG_NUM_BANKS = 2,
-};
-
/* ARM-specific interrupt pending bits. */
#define CPU_INTERRUPT_FIQ CPU_INTERRUPT_TGT_EXT_1
#define CPU_INTERRUPT_VIRQ CPU_INTERRUPT_TGT_EXT_2
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 16/20] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (14 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 15/20] target/arm: Expose M-profile register bank index definitions Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 17/20] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header Philippe Mathieu-Daudé
` (6 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
Now than we can access the M-profile bank index
definitions from the target-agnostic "cpu-qom.h"
header, we don't need the huge "cpu.h" anymore
(except in hw/arm/armv7m.c). Reduce its inclusion
to the source unit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/intc/armv7m_nvic.h | 2 +-
hw/arm/armv7m.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h
index 6b4ae566c9..89fe8aedaa 100644
--- a/include/hw/intc/armv7m_nvic.h
+++ b/include/hw/intc/armv7m_nvic.h
@@ -10,7 +10,7 @@
#ifndef HW_ARM_ARMV7M_NVIC_H
#define HW_ARM_ARMV7M_NVIC_H
-#include "target/arm/cpu.h"
+#include "target/arm/cpu-qom.h"
#include "hw/sysbus.h"
#include "hw/timer/armv7m_systick.h"
#include "qom/object.h"
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 1f21827773..edcd8adc74 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -21,6 +21,7 @@
#include "qemu/module.h"
#include "qemu/log.h"
#include "target/arm/idau.h"
+#include "target/arm/cpu.h"
#include "target/arm/cpu-features.h"
#include "migration/vmstate.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 17/20] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (15 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 16/20] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 18/20] target/arm: Move e2h_access() helper around Philippe Mathieu-Daudé
` (5 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
The ARM_CPU_IRQ/FIQ definitions are used to index the GPIO
IRQ created calling qdev_init_gpio_in() in ARMCPU instance_init()
handler. To allow non-ARM code to raise interrupt on ARM cores,
move they to 'target/arm/cpu-qom.h' which is non-ARM specific and
can be included by any hw/ file.
File list to include the new header generated using:
$ git grep -wEl 'ARM_CPU_(\w*IRQ|FIQ)'
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu-qom.h | 6 ++++++
target/arm/cpu.h | 6 ------
hw/arm/allwinner-a10.c | 1 +
hw/arm/allwinner-h3.c | 1 +
hw/arm/allwinner-r40.c | 1 +
hw/arm/armv7m.c | 1 +
hw/arm/aspeed_ast2400.c | 1 +
hw/arm/aspeed_ast2600.c | 1 +
hw/arm/bcm2836.c | 1 +
hw/arm/exynos4210.c | 1 +
hw/arm/fsl-imx25.c | 1 +
hw/arm/fsl-imx31.c | 1 +
hw/arm/fsl-imx6.c | 1 +
hw/arm/fsl-imx6ul.c | 1 +
hw/arm/fsl-imx7.c | 1 +
hw/arm/highbank.c | 1 +
hw/arm/integratorcp.c | 1 +
hw/arm/musicpal.c | 1 +
hw/arm/npcm7xx.c | 1 +
hw/arm/omap1.c | 1 +
hw/arm/omap2.c | 1 +
hw/arm/realview.c | 1 +
hw/arm/sbsa-ref.c | 1 +
hw/arm/strongarm.c | 1 +
hw/arm/versatilepb.c | 1 +
hw/arm/vexpress.c | 1 +
hw/arm/virt.c | 1 +
hw/arm/xilinx_zynq.c | 1 +
hw/arm/xlnx-versal.c | 1 +
hw/arm/xlnx-zynqmp.c | 1 +
target/arm/cpu.c | 1 +
31 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h
index 77bbc1f13c..8e032691db 100644
--- a/target/arm/cpu-qom.h
+++ b/target/arm/cpu-qom.h
@@ -36,6 +36,12 @@ DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU,
#define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
#define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
+/* Meanings of the ARMCPU object's four inbound GPIO lines */
+#define ARM_CPU_IRQ 0
+#define ARM_CPU_FIQ 1
+#define ARM_CPU_VIRQ 2
+#define ARM_CPU_VFIQ 3
+
/* For M profile, some registers are banked secure vs non-secure;
* these are represented as a 2-element array where the first element
* is the non-secure copy and the second is the secure copy.
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index d6a79482ad..e8df41d642 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -93,12 +93,6 @@
#define offsetofhigh32(S, M) (offsetof(S, M) + sizeof(uint32_t))
#endif
-/* Meanings of the ARMCPU object's four inbound GPIO lines */
-#define ARM_CPU_IRQ 0
-#define ARM_CPU_FIQ 1
-#define ARM_CPU_VIRQ 2
-#define ARM_CPU_VFIQ 3
-
/* ARM-specific extra insn start words:
* 1: Conditional execution bits
* 2: Partial exception syndrome for data aborts
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index b0ea3f7f66..7e2ae7a15f 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -26,6 +26,7 @@
#include "hw/boards.h"
#include "hw/usb/hcd-ohci.h"
#include "hw/loader.h"
+#include "target/arm/cpu-qom.h"
#define AW_A10_SRAM_A_BASE 0x00000000
#define AW_A10_DRAMC_BASE 0x01c01000
diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index f05afddf7e..2d684b5287 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -30,6 +30,7 @@
#include "hw/loader.h"
#include "sysemu/sysemu.h"
#include "hw/arm/allwinner-h3.h"
+#include "target/arm/cpu-qom.h"
/* Memory map */
const hwaddr allwinner_h3_memmap[] = {
diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
index a0d367c60d..65392dbc23 100644
--- a/hw/arm/allwinner-r40.c
+++ b/hw/arm/allwinner-r40.c
@@ -32,6 +32,7 @@
#include "sysemu/sysemu.h"
#include "hw/arm/allwinner-r40.h"
#include "hw/misc/allwinner-r40-dramc.h"
+#include "target/arm/cpu-qom.h"
/* Memory map */
const hwaddr allwinner_r40_memmap[] = {
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index edcd8adc74..7c68525a9e 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -23,6 +23,7 @@
#include "target/arm/idau.h"
#include "target/arm/cpu.h"
#include "target/arm/cpu-features.h"
+#include "target/arm/cpu-qom.h"
#include "migration/vmstate.h"
/* Bitbanded IO. Each word corresponds to a single bit. */
diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c
index 0baa2ff96e..ad76035528 100644
--- a/hw/arm/aspeed_ast2400.c
+++ b/hw/arm/aspeed_ast2400.c
@@ -21,6 +21,7 @@
#include "hw/i2c/aspeed_i2c.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
+#include "target/arm/cpu-qom.h"
#define ASPEED_SOC_IOMEM_SIZE 0x00200000
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index 3a9a303ab8..386a88d4e0 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -16,6 +16,7 @@
#include "hw/i2c/aspeed_i2c.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
+#include "target/arm/cpu-qom.h"
#define ASPEED_SOC_IOMEM_SIZE 0x00200000
#define ASPEED_SOC_DPMCU_SIZE 0x00040000
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index b0674a22a6..58a78780d2 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -15,6 +15,7 @@
#include "hw/arm/bcm2836.h"
#include "hw/arm/raspi_platform.h"
#include "hw/sysbus.h"
+#include "target/arm/cpu-qom.h"
struct BCM283XClass {
/*< private >*/
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index af511a153d..6c428d8eeb 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -36,6 +36,7 @@
#include "hw/arm/exynos4210.h"
#include "hw/sd/sdhci.h"
#include "hw/usb/hcd-ehci.h"
+#include "target/arm/cpu-qom.h"
#define EXYNOS4210_CHIPID_ADDR 0x10000000
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index 9d2fb75a68..4a49507ef1 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -28,6 +28,7 @@
#include "sysemu/sysemu.h"
#include "hw/qdev-properties.h"
#include "chardev/char.h"
+#include "target/arm/cpu-qom.h"
#define IMX25_ESDHC_CAPABILITIES 0x07e20000
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index c0584e4dfc..4b8d9b8e4f 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -26,6 +26,7 @@
#include "exec/address-spaces.h"
#include "hw/qdev-properties.h"
#include "chardev/char.h"
+#include "target/arm/cpu-qom.h"
static void fsl_imx31_init(Object *obj)
{
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index af2e982b05..42f9058825 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -29,6 +29,7 @@
#include "chardev/char.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "target/arm/cpu-qom.h"
#define IMX6_ESDHC_CAPABILITIES 0x057834b4
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
index e37b69a5e1..486a009deb 100644
--- a/hw/arm/fsl-imx6ul.c
+++ b/hw/arm/fsl-imx6ul.c
@@ -25,6 +25,7 @@
#include "sysemu/sysemu.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "target/arm/cpu-qom.h"
#define NAME_SIZE 20
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index 474cfdc87c..5728109491 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -26,6 +26,7 @@
#include "sysemu/sysemu.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "target/arm/cpu-qom.h"
#define NAME_SIZE 20
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index c21e18d08f..e6e27d69af 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -36,6 +36,7 @@
#include "qemu/log.h"
#include "qom/object.h"
#include "cpu.h"
+#include "target/arm/cpu-qom.h"
#define SMP_BOOT_ADDR 0x100
#define SMP_BOOT_REG 0x40
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index 1830e1d785..5600616a4d 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -28,6 +28,7 @@
#include "hw/sd/sd.h"
#include "qom/object.h"
#include "audio/audio.h"
+#include "target/arm/cpu-qom.h"
#define TYPE_INTEGRATOR_CM "integrator_core"
OBJECT_DECLARE_SIMPLE_TYPE(IntegratorCMState, INTEGRATOR_CM)
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 3200c9f68a..d89824f600 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -39,6 +39,7 @@
#include "hw/net/mv88w8618_eth.h"
#include "audio/audio.h"
#include "qemu/error-report.h"
+#include "target/arm/cpu-qom.h"
#define MP_MISC_BASE 0x80002000
#define MP_MISC_SIZE 0x00001000
diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c
index 7fb0a233b2..e3243a520d 100644
--- a/hw/arm/npcm7xx.c
+++ b/hw/arm/npcm7xx.c
@@ -26,6 +26,7 @@
#include "qapi/error.h"
#include "qemu/units.h"
#include "sysemu/sysemu.h"
+#include "target/arm/cpu-qom.h"
/*
* This covers the whole MMIO space. We'll use this to catch any MMIO accesses
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index d5438156ee..86ee336e59 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -40,6 +40,7 @@
#include "hw/sysbus.h"
#include "qemu/cutils.h"
#include "qemu/bcd.h"
+#include "target/arm/cpu-qom.h"
static inline void omap_log_badwidth(const char *funcname, hwaddr addr, int sz)
{
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index f170728e7e..f159fb73ea 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -39,6 +39,7 @@
#include "hw/sysbus.h"
#include "hw/boards.h"
#include "audio/audio.h"
+#include "target/arm/cpu-qom.h"
/* Enhanced Audio Controller (CODEC only) */
struct omap_eac_s {
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 132217b2ed..566deff9ce 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -30,6 +30,7 @@
#include "hw/i2c/arm_sbcon_i2c.h"
#include "hw/sd/sd.h"
#include "audio/audio.h"
+#include "target/arm/cpu-qom.h"
#define SMP_BOOT_ADDR 0xe0000000
#define SMP_BOOTREG_ADDR 0x10000030
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index b8857d1e9e..d6081bfc41 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -50,6 +50,7 @@
#include "net/net.h"
#include "qapi/qmp/qlist.h"
#include "qom/object.h"
+#include "target/arm/cpu-qom.h"
#define RAMLIMIT_GB 8192
#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index fef3638aca..75637869cb 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -46,6 +46,7 @@
#include "qemu/cutils.h"
#include "qemu/log.h"
#include "qom/object.h"
+#include "target/arm/cpu-qom.h"
//#define DEBUG
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 4b2257787b..15b5ed0ced 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -27,6 +27,7 @@
#include "hw/sd/sd.h"
#include "qom/object.h"
#include "audio/audio.h"
+#include "target/arm/cpu-qom.h"
#define VERSATILE_FLASH_ADDR 0x34000000
#define VERSATILE_FLASH_SIZE (64 * 1024 * 1024)
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index fd981f4c33..49dbcdcbf0 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -46,6 +46,7 @@
#include "qapi/qmp/qlist.h"
#include "qom/object.h"
#include "audio/audio.h"
+#include "target/arm/cpu-qom.h"
#define VEXPRESS_BOARD_ID 0x8e0
#define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index beba151620..0ab5fd9477 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -73,6 +73,7 @@
#include "standard-headers/linux/input.h"
#include "hw/arm/smmuv3.h"
#include "hw/acpi/acpi.h"
+#include "target/arm/cpu-qom.h"
#include "target/arm/internals.h"
#include "target/arm/multiprocessing.h"
#include "hw/mem/pc-dimm.h"
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index d4c817ecdc..5809fc32af 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -38,6 +38,7 @@
#include "sysemu/reset.h"
#include "qom/object.h"
#include "exec/tswap.h"
+#include "target/arm/cpu-qom.h"
#define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9")
OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE)
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index 9600551c44..87fdb39d43 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -23,6 +23,7 @@
#include "hw/misc/unimp.h"
#include "hw/arm/xlnx-versal.h"
#include "qemu/log.h"
+#include "target/arm/cpu-qom.h"
#define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")
#define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 5905a33015..38cb34942f 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -25,6 +25,7 @@
#include "sysemu/kvm.h"
#include "sysemu/sysemu.h"
#include "kvm_arm.h"
+#include "target/arm/cpu-qom.h"
#define GIC_NUM_SPI_INTR 160
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 89e44a31fd..07357daabe 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -48,6 +48,7 @@
#include "disas/capstone.h"
#include "fpu/softfloat.h"
#include "cpregs.h"
+#include "target/arm/cpu-qom.h"
static void arm_cpu_set_pc(CPUState *cs, vaddr value)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 18/20] target/arm: Move e2h_access() helper around
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (16 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 17/20] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 19/20] target/arm: Move GTimer definitions to new 'gtimer.h' header Philippe Mathieu-Daudé
` (4 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
e2h_access() was added in commit bb5972e439 ("target/arm:
Add VHE timer register redirection and aliasing") close to
the generic_timer_cp_reginfo[] array, but isn't used until
vhe_reginfo[] definition. Move it closer to the other e2h
helpers.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/helper.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc8f14f433..1ef00e50e4 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -3342,20 +3342,6 @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = {
},
};
-static CPAccessResult e2h_access(CPUARMState *env, const ARMCPRegInfo *ri,
- bool isread)
-{
- if (arm_current_el(env) == 1) {
- /* This must be a FEAT_NV access */
- /* TODO: FEAT_ECV will need to check CNTHCTL_EL2 here */
- return CP_ACCESS_OK;
- }
- if (!(arm_hcr_el2_eff(env) & HCR_E2H)) {
- return CP_ACCESS_TRAP;
- }
- return CP_ACCESS_OK;
-}
-
#else
/*
@@ -6543,6 +6529,21 @@ static const ARMCPRegInfo el3_cp_reginfo[] = {
};
#ifndef CONFIG_USER_ONLY
+
+static CPAccessResult e2h_access(CPUARMState *env, const ARMCPRegInfo *ri,
+ bool isread)
+{
+ if (arm_current_el(env) == 1) {
+ /* This must be a FEAT_NV access */
+ /* TODO: FEAT_ECV will need to check CNTHCTL_EL2 here */
+ return CP_ACCESS_OK;
+ }
+ if (!(arm_hcr_el2_eff(env) & HCR_E2H)) {
+ return CP_ACCESS_TRAP;
+ }
+ return CP_ACCESS_OK;
+}
+
/* Test if system register redirection is to occur in the current state. */
static bool redirect_for_e2h(CPUARMState *env)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 19/20] target/arm: Move GTimer definitions to new 'gtimer.h' header
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (17 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 18/20] target/arm: Move e2h_access() helper around Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 20/20] hw/arm: Build various units only once Philippe Mathieu-Daudé
` (3 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm,
Richard Henderson
Move Arm A-class Generic Timer definitions to the new
"target/arm/gtimer.h" header so units in hw/ which don't
need access to ARMCPU internals can use them without
having to include the huge "cpu.h".
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.h | 8 +-------
target/arm/gtimer.h | 21 +++++++++++++++++++++
hw/arm/allwinner-h3.c | 1 +
hw/arm/allwinner-r40.c | 1 +
hw/arm/bcm2836.c | 1 +
hw/arm/sbsa-ref.c | 1 +
hw/arm/virt.c | 1 +
hw/arm/xlnx-versal.c | 1 +
hw/arm/xlnx-zynqmp.c | 1 +
hw/cpu/a15mpcore.c | 1 +
target/arm/cpu.c | 1 +
target/arm/helper.c | 1 +
target/arm/hvf/hvf.c | 1 +
target/arm/kvm.c | 1 +
target/arm/machine.c | 1 +
15 files changed, 35 insertions(+), 7 deletions(-)
create mode 100644 target/arm/gtimer.h
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index e8df41d642..d3477b1601 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -27,6 +27,7 @@
#include "exec/cpu-defs.h"
#include "qapi/qapi-types-common.h"
#include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
/* ARM processors have a weak memory model */
#define TCG_GUEST_DEFAULT_MO (0)
@@ -140,13 +141,6 @@ typedef struct ARMGenericTimer {
uint64_t ctl; /* Timer Control register */
} ARMGenericTimer;
-#define GTIMER_PHYS 0
-#define GTIMER_VIRT 1
-#define GTIMER_HYP 2
-#define GTIMER_SEC 3
-#define GTIMER_HYPVIRT 4
-#define NUM_GTIMERS 5
-
#define VTCR_NSW (1u << 29)
#define VTCR_NSA (1u << 30)
#define VSTCR_SW VTCR_NSW
diff --git a/target/arm/gtimer.h b/target/arm/gtimer.h
new file mode 100644
index 0000000000..b992941bef
--- /dev/null
+++ b/target/arm/gtimer.h
@@ -0,0 +1,21 @@
+/*
+ * ARM generic timer definitions for Arm A-class CPU
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef TARGET_ARM_GTIMER_H
+#define TARGET_ARM_GTIMER_H
+
+enum {
+ GTIMER_PHYS = 0,
+ GTIMER_VIRT = 1,
+ GTIMER_HYP = 2,
+ GTIMER_SEC = 3,
+ GTIMER_HYPVIRT = 4,
+#define NUM_GTIMERS 5
+};
+
+#endif
diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 2d684b5287..380e0ec11d 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -31,6 +31,7 @@
#include "sysemu/sysemu.h"
#include "hw/arm/allwinner-h3.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
/* Memory map */
const hwaddr allwinner_h3_memmap[] = {
diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
index 65392dbc23..898bef9d93 100644
--- a/hw/arm/allwinner-r40.c
+++ b/hw/arm/allwinner-r40.c
@@ -33,6 +33,7 @@
#include "hw/arm/allwinner-r40.h"
#include "hw/misc/allwinner-r40-dramc.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
/* Memory map */
const hwaddr allwinner_r40_memmap[] = {
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 58a78780d2..e3ba18a8ec 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -16,6 +16,7 @@
#include "hw/arm/raspi_platform.h"
#include "hw/sysbus.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
struct BCM283XClass {
/*< private >*/
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index d6081bfc41..85cb68d546 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -51,6 +51,7 @@
#include "qapi/qmp/qlist.h"
#include "qom/object.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
#define RAMLIMIT_GB 8192
#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 0ab5fd9477..bdfcf028a0 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -76,6 +76,7 @@
#include "target/arm/cpu-qom.h"
#include "target/arm/internals.h"
#include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
#include "hw/mem/pc-dimm.h"
#include "hw/mem/nvdimm.h"
#include "hw/acpi/generic_event_device.h"
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index 87fdb39d43..2798df3730 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -24,6 +24,7 @@
#include "hw/arm/xlnx-versal.h"
#include "qemu/log.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
#define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")
#define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 38cb34942f..65901c6e74 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -26,6 +26,7 @@
#include "sysemu/sysemu.h"
#include "kvm_arm.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
#define GIC_NUM_SPI_INTR 160
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index bfd8aa5644..967d8d3dd5 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -26,6 +26,7 @@
#include "hw/qdev-properties.h"
#include "sysemu/kvm.h"
#include "kvm_arm.h"
+#include "target/arm/gtimer.h"
static void a15mp_priv_set_irq(void *opaque, int irq, int level)
{
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 07357daabe..4c57b9c3b8 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -49,6 +49,7 @@
#include "fpu/softfloat.h"
#include "cpregs.h"
#include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
static void arm_cpu_set_pc(CPUState *cs, vaddr value)
{
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 1ef00e50e4..39e2ba25c8 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -30,6 +30,7 @@
#include "semihosting/common-semi.h"
#endif
#include "cpregs.h"
+#include "target/arm/gtimer.h"
#define ARM_CPU_FREQ 1000000000 /* FIXME: 1 GHz, should be configurable */
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 71a26db188..e5f0f60093 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -29,6 +29,7 @@
#include "target/arm/cpu.h"
#include "target/arm/internals.h"
#include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
#include "trace/trace-target_arm_hvf.h"
#include "migration/vmstate.h"
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 8f52b211f9..81813030a5 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -38,6 +38,7 @@
#include "qemu/log.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/ghes.h"
+#include "target/arm/gtimer.h"
const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
KVM_CAP_LAST_INFO
diff --git a/target/arm/machine.c b/target/arm/machine.c
index 542be14bec..9d7dbaea54 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -7,6 +7,7 @@
#include "internals.h"
#include "cpu-features.h"
#include "migration/cpu.h"
+#include "target/arm/gtimer.h"
static bool vfp_needed(void *opaque)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 20/20] hw/arm: Build various units only once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (18 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 19/20] target/arm: Move GTimer definitions to new 'gtimer.h' header Philippe Mathieu-Daudé
@ 2024-01-18 20:06 ` Philippe Mathieu-Daudé
2024-01-18 20:08 ` [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (2 subsequent siblings)
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:06 UTC (permalink / raw)
To: qemu-devel
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini,
Jean-Christophe Dubois, Joel Stanley, Hao Wu, kvm
Various files in hw/arm/ don't require "cpu.h" anymore.
Except virt-acpi-build.c, all of them don't require any
ARM specific knowledge anymore and can be build once as
target agnostic units. Update meson accordingly.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/collie.c | 1 -
hw/arm/gumstix.c | 1 -
hw/arm/integratorcp.c | 1 -
hw/arm/mainstone.c | 1 -
hw/arm/musicpal.c | 1 -
hw/arm/omap2.c | 1 -
hw/arm/omap_sx1.c | 1 -
hw/arm/palm.c | 1 -
hw/arm/spitz.c | 1 -
hw/arm/strongarm.c | 1 -
hw/arm/versatilepb.c | 1 -
hw/arm/vexpress.c | 1 -
hw/arm/virt-acpi-build.c | 1 -
hw/arm/xilinx_zynq.c | 1 -
hw/arm/xlnx-versal-virt.c | 1 -
hw/arm/z2.c | 1 -
hw/arm/meson.build | 23 ++++++++++++-----------
17 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
index a0ad1b8dc7..eaa5c52d45 100644
--- a/hw/arm/collie.c
+++ b/hw/arm/collie.c
@@ -17,7 +17,6 @@
#include "hw/arm/boot.h"
#include "hw/block/flash.h"
#include "exec/address-spaces.h"
-#include "cpu.h"
#include "qom/object.h"
#include "qemu/error-report.h"
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index 2ca4140c9f..3f2bcaa24e 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -44,7 +44,6 @@
#include "hw/boards.h"
#include "exec/address-spaces.h"
#include "sysemu/qtest.h"
-#include "cpu.h"
#define CONNEX_FLASH_SIZE (16 * MiB)
#define CONNEX_RAM_SIZE (64 * MiB)
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index 5600616a4d..793262eca8 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -9,7 +9,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
#include "hw/boards.h"
diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 68329c4617..fc14e05060 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -23,7 +23,6 @@
#include "hw/block/flash.h"
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
-#include "cpu.h"
/* Device addresses */
#define MST_FPGA_PHYS 0x08000000
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index d89824f600..e46aa91807 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -12,7 +12,6 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
#include "hw/arm/boot.h"
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index f159fb73ea..d9683276c6 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -21,7 +21,6 @@
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "exec/address-spaces.h"
#include "sysemu/blockdev.h"
#include "sysemu/qtest.h"
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 4bf1579f8c..62d7915fb8 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -35,7 +35,6 @@
#include "hw/block/flash.h"
#include "sysemu/qtest.h"
#include "exec/address-spaces.h"
-#include "cpu.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index b86f2c331b..8c4c831614 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -29,7 +29,6 @@
#include "hw/input/tsc2xxx.h"
#include "hw/irq.h"
#include "hw/loader.h"
-#include "cpu.h"
#include "qemu/cutils.h"
#include "qom/object.h"
#include "qemu/error-report.h"
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 1d680b61e2..643a02b180 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -33,7 +33,6 @@
#include "hw/adc/max111x.h"
#include "migration/vmstate.h"
#include "exec/address-spaces.h"
-#include "cpu.h"
#include "qom/object.h"
#include "audio/audio.h"
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index 75637869cb..7fd99a0f14 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -28,7 +28,6 @@
*/
#include "qemu/osdep.h"
-#include "cpu.h"
#include "hw/irq.h"
#include "hw/qdev-properties.h"
#include "hw/qdev-properties-system.h"
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 15b5ed0ced..1d813aa23b 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -9,7 +9,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
#include "hw/arm/boot.h"
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 49dbcdcbf0..f1b45245d5 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/datadir.h"
-#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/arm/boot.h"
#include "hw/arm/primecell.h"
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 43ccc60f43..17aeec7a6f 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -32,7 +32,6 @@
#include "qemu/error-report.h"
#include "trace.h"
#include "hw/core/cpu.h"
-#include "target/arm/cpu.h"
#include "hw/acpi/acpi-defs.h"
#include "hw/acpi/acpi.h"
#include "hw/nvram/fw_cfg_acpi.h"
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 5809fc32af..66d0de139f 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -18,7 +18,6 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/arm/boot.h"
#include "net/net.h"
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 29f4d2c2dc..94942c55df 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -16,7 +16,6 @@
#include "hw/boards.h"
#include "hw/sysbus.h"
#include "hw/arm/fdt.h"
-#include "cpu.h"
#include "hw/qdev-properties.h"
#include "hw/arm/xlnx-versal.h"
#include "hw/arm/boot.h"
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 83741a4909..a67fba2cfd 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -25,7 +25,6 @@
#include "hw/audio/wm8750.h"
#include "audio/audio.h"
#include "exec/address-spaces.h"
-#include "cpu.h"
#include "qom/object.h"
#include "qapi/error.h"
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index bb92b27db3..c401779067 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -9,23 +9,14 @@ arm_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c'))
arm_ss.add(when: 'CONFIG_MAINSTONE', if_true: files('mainstone.c'))
arm_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c'))
arm_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('musicpal.c'))
-arm_ss.add(when: 'CONFIG_NETDUINO2', if_true: files('netduino2.c'))
arm_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinoplus2.c'))
arm_ss.add(when: 'CONFIG_OLIMEX_STM32_H405', if_true: files('olimex-stm32-h405.c'))
arm_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx.c', 'npcm7xx_boards.c'))
arm_ss.add(when: 'CONFIG_NSERIES', if_true: files('nseries.c'))
-arm_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c'))
-arm_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
-arm_ss.add(when: 'CONFIG_GUMSTIX', if_true: files('gumstix.c'))
-arm_ss.add(when: 'CONFIG_SPITZ', if_true: files('spitz.c'))
-arm_ss.add(when: 'CONFIG_Z2', if_true: files('z2.c'))
arm_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview.c'))
arm_ss.add(when: 'CONFIG_SBSA_REF', if_true: files('sbsa-ref.c'))
arm_ss.add(when: 'CONFIG_STELLARIS', if_true: files('stellaris.c'))
arm_ss.add(when: 'CONFIG_STM32VLDISCOVERY', if_true: files('stm32vldiscovery.c'))
-arm_ss.add(when: 'CONFIG_COLLIE', if_true: files('collie.c'))
-arm_ss.add(when: 'CONFIG_VERSATILE', if_true: files('versatilepb.c'))
-arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c'))
arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c'))
@@ -33,8 +24,7 @@ arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c'))
arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c'))
arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c'))
-arm_ss.add(when: 'CONFIG_OMAP', if_true: files('omap1.c', 'omap2.c'))
-arm_ss.add(when: 'CONFIG_STRONGARM', if_true: files('strongarm.c'))
+arm_ss.add(when: 'CONFIG_OMAP', if_true: files('omap1.c'))
arm_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubieboard.c'))
arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c'))
arm_ss.add(when: 'CONFIG_ALLWINNER_R40', if_true: files('allwinner-r40.c', 'bananapi_m2u.c'))
@@ -69,8 +59,19 @@ arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
+system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
+system_ss.add(when: 'CONFIG_COLLIE', if_true: files('collie.c'))
system_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4_boards.c'))
+system_ss.add(when: 'CONFIG_GUMSTIX', if_true: files('gumstix.c'))
+system_ss.add(when: 'CONFIG_NETDUINO2', if_true: files('netduino2.c'))
+system_ss.add(when: 'CONFIG_OMAP', if_true: files('omap2.c'))
system_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_peripherals.c'))
+system_ss.add(when: 'CONFIG_SPITZ', if_true: files('spitz.c'))
+system_ss.add(when: 'CONFIG_STRONGARM', if_true: files('strongarm.c'))
+system_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c'))
system_ss.add(when: 'CONFIG_TOSA', if_true: files('tosa.c'))
+system_ss.add(when: 'CONFIG_VERSATILE', if_true: files('versatilepb.c'))
+system_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
+system_ss.add(when: 'CONFIG_Z2', if_true: files('z2.c'))
hw_arch += {'arm': arm_ss}
--
2.41.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (19 preceding siblings ...)
2024-01-18 20:06 ` [PATCH 20/20] hw/arm: Build various units only once Philippe Mathieu-Daudé
@ 2024-01-18 20:08 ` Philippe Mathieu-Daudé
2024-01-18 22:20 ` Richard Henderson
2024-01-19 18:09 ` Peter Maydell
22 siblings, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 20:08 UTC (permalink / raw)
To: qemu-devel, Thomas Huth
Cc: Igor Mitsyanko, qemu-arm, Strahinja Jankovic, Edgar E. Iglesias,
Igor Mammedov, Cédric Le Goater, Eric Auger, Niek Linnenbank,
Michael S. Tsirkin, Jan Kiszka, Marcin Juszkiewicz,
Alistair Francis, Radoslaw Biernacki, Andrew Jeffery,
Andrey Smirnov, Rob Herring, Shannon Zhao, Tyrone Ting,
Beniamino Galvani, Alexander Graf, Leif Lindholm, Ani Sinha,
Peter Maydell, Paolo Bonzini, Jean-Christophe Dubois,
Joel Stanley, Hao Wu, kvm
On 18/1/24 21:06, Philippe Mathieu-Daudé wrote:
> Hi,
>
> In order to fix a bug noticed [*] by Cédric and Fabiano in my
> "Remove one use of qemu_get_cpu() in A7/A15 MPCore priv" series,
> I ended reusing commits from other branches and it grew quite
> a lot. This is the first "cleanup" part, unrelated on MPCorePriv.
>
> Please review,
>
> Phil.
>
[*]
https://lore.kernel.org/qemu-devel/501c1bfe-fb26-42ab-a925-9888755c72ad@linaro.org/
> Philippe Mathieu-Daudé (18):
> hw/arm/exynos4210: Include missing 'exec/tswap.h' header
> hw/arm/xilinx_zynq: Include missing 'exec/tswap.h' header
> hw/arm/smmuv3: Include missing 'hw/registerfields.h' header
> hw/arm/xlnx-versal: Include missing 'cpu.h' header
> target/arm/cpu-features: Include missing 'hw/registerfields.h' header
> target/arm/cpregs: Include missing 'hw/registerfields.h' header
> target/arm/cpregs: Include missing 'kvm-consts.h' header
> target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header
> target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'
> hw/cpu/a9mpcore: Build it only once
> hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of
> 'cpu.h'
> hw/misc/xlnx-versal-crl: Build it only once
> target/arm: Expose M-profile register bank index definitions
> hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header
> target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header
> target/arm: Move e2h_access() helper around
> target/arm: Move GTimer definitions to new 'gtimer.h' header
> hw/arm: Build various units only once
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (20 preceding siblings ...)
2024-01-18 20:08 ` [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
@ 2024-01-18 22:20 ` Richard Henderson
2024-01-19 18:09 ` Peter Maydell
22 siblings, 0 replies; 25+ messages in thread
From: Richard Henderson @ 2024-01-18 22:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 1/19/24 07:06, Philippe Mathieu-Daudé wrote:
> Hi,
>
> In order to fix a bug noticed [*] by Cédric and Fabiano in my
> "Remove one use of qemu_get_cpu() in A7/A15 MPCore priv" series,
> I ended reusing commits from other branches and it grew quite
> a lot. This is the first "cleanup" part, unrelated on MPCorePriv.
>
> Please review,
>
> Phil.
>
> Philippe Mathieu-Daudé (18):
> hw/arm/exynos4210: Include missing 'exec/tswap.h' header
> hw/arm/xilinx_zynq: Include missing 'exec/tswap.h' header
> hw/arm/smmuv3: Include missing 'hw/registerfields.h' header
> hw/arm/xlnx-versal: Include missing 'cpu.h' header
> target/arm/cpu-features: Include missing 'hw/registerfields.h' header
> target/arm/cpregs: Include missing 'hw/registerfields.h' header
> target/arm/cpregs: Include missing 'kvm-consts.h' header
> target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header
> target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'
> hw/cpu/a9mpcore: Build it only once
> hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of
> 'cpu.h'
> hw/misc/xlnx-versal-crl: Build it only once
> target/arm: Expose M-profile register bank index definitions
> hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header
> target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header
> target/arm: Move e2h_access() helper around
> target/arm: Move GTimer definitions to new 'gtimer.h' header
> hw/arm: Build various units only once
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
` (21 preceding siblings ...)
2024-01-18 22:20 ` Richard Henderson
@ 2024-01-19 18:09 ` Peter Maydell
22 siblings, 0 replies; 25+ messages in thread
From: Peter Maydell @ 2024-01-19 18:09 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Igor Mitsyanko, qemu-arm, Strahinja Jankovic,
Edgar E. Iglesias, Igor Mammedov, Cédric Le Goater,
Eric Auger, Niek Linnenbank, Michael S. Tsirkin, Jan Kiszka,
Marcin Juszkiewicz, Alistair Francis, Radoslaw Biernacki,
Andrew Jeffery, Andrey Smirnov, Rob Herring, Shannon Zhao,
Tyrone Ting, Beniamino Galvani, Alexander Graf, Leif Lindholm,
Ani Sinha, Paolo Bonzini, Jean-Christophe Dubois, Joel Stanley,
Hao Wu, kvm
On Thu, 18 Jan 2024 at 20:06, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Hi,
>
> In order to fix a bug noticed [*] by Cédric and Fabiano in my
> "Remove one use of qemu_get_cpu() in A7/A15 MPCore priv" series,
> I ended reusing commits from other branches and it grew quite
> a lot. This is the first "cleanup" part, unrelated on MPCorePriv.
>
> Please review,
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity
2024-01-18 20:06 ` [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity Philippe Mathieu-Daudé
@ 2024-04-15 12:51 ` Peter Maydell
0 siblings, 0 replies; 25+ messages in thread
From: Peter Maydell @ 2024-04-15 12:51 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, qemu-arm, Richard Henderson
On Thu, 18 Jan 2024 at 20:07, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> From: Richard Henderson <richard.henderson@linaro.org>
>
> Rename to arm_build_mp_affinity. This frees up the name for
> other usage, and emphasizes that the cpu object is not involved.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Hi; I just had cause to re-look at this commit. The problem
here is that to determine the right MP affinity value the
CPU *should* be involved. This is because for some Arm
CPUs the MPIDR MT bit is 0, and the CPU number is in Aff0,
but for others the MPIDR MT bit is 1, and the CPU number is
in Aff1, and Aff0 is 0. We don't currently model the latter
CPUs correctly, treating everything as MT=0, but we should.
So really arm_build_mp_affinity() ought to take a CPU
argument (which is awkward because we don't always have one
to hand at the callsite)...
thanks
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2024-04-15 12:53 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 20:06 [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 01/20] hw/arm/exynos4210: Include missing 'exec/tswap.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 02/20] hw/arm/xilinx_zynq: " Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 03/20] hw/arm/smmuv3: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 04/20] hw/arm/xlnx-versal: Include missing 'cpu.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 05/20] target/arm/cpu-features: Include missing 'hw/registerfields.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 06/20] target/arm/cpregs: " Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity Philippe Mathieu-Daudé
2024-04-15 12:51 ` Peter Maydell
2024-01-18 20:06 ` [PATCH 09/20] target/arm: Create arm_cpu_mp_affinity Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 10/20] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 11/20] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h' Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 12/20] hw/cpu/a9mpcore: Build it only once Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 13/20] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h' Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 14/20] hw/misc/xlnx-versal-crl: Build it only once Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 15/20] target/arm: Expose M-profile register bank index definitions Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 16/20] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 17/20] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 18/20] target/arm: Move e2h_access() helper around Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 19/20] target/arm: Move GTimer definitions to new 'gtimer.h' header Philippe Mathieu-Daudé
2024-01-18 20:06 ` [PATCH 20/20] hw/arm: Build various units only once Philippe Mathieu-Daudé
2024-01-18 20:08 ` [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once Philippe Mathieu-Daudé
2024-01-18 22:20 ` Richard Henderson
2024-01-19 18:09 ` Peter Maydell
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).