[PATCH] hw/cpu: Build a15mpcore.c once as common object

Philippe Mathieu-Daudé posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260225034451.41338-1-philmd@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>
hw/cpu/a15mpcore.c | 2 +-
hw/cpu/meson.build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] hw/cpu: Build a15mpcore.c once as common object
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
a15mpcore.c doesn't need to include the target-specific 'kvm_arm.h'
header, it only lacks the qemu_get_cpu() declaration which comes
from 'hw/core/cpu.h'. Include the latter and build as common object.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/cpu/a15mpcore.c | 2 +-
 hw/cpu/meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index 28cc4b3a4bd..28cda55ccf8 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -22,10 +22,10 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/cpu/a15mpcore.h"
+#include "hw/core/cpu.h"
 #include "hw/core/irq.h"
 #include "hw/core/qdev-properties.h"
 #include "system/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/hw/cpu/meson.build b/hw/cpu/meson.build
index 9d36bf8ae2c..9c1535ca325 100644
--- a/hw/cpu/meson.build
+++ b/hw/cpu/meson.build
@@ -4,4 +4,4 @@ system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('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'))
 system_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
+system_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
-- 
2.52.0


Re: [PATCH] hw/cpu: Build a15mpcore.c once as common object
Posted by Peter Maydell 1 month, 1 week ago
On Wed, 25 Feb 2026 at 03:44, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> a15mpcore.c doesn't need to include the target-specific 'kvm_arm.h'
> header, it only lacks the qemu_get_cpu() declaration which comes
> from 'hw/core/cpu.h'. Include the latter and build as common object.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>



Applied to target-arm.next, thanks (and now in master, looks like
I forgot to hit 'send' on this mail...).

-- PMM
Re: [PATCH] hw/cpu: Build a15mpcore.c once as common object
Posted by Richard Henderson 1 month, 2 weeks ago
On 2/25/26 14:44, Philippe Mathieu-Daudé wrote:
> a15mpcore.c doesn't need to include the target-specific 'kvm_arm.h'
> header, it only lacks the qemu_get_cpu() declaration which comes
> from 'hw/core/cpu.h'. Include the latter and build as common object.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/cpu/a15mpcore.c | 2 +-
>   hw/cpu/meson.build | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
> index 28cc4b3a4bd..28cda55ccf8 100644
> --- a/hw/cpu/a15mpcore.c
> +++ b/hw/cpu/a15mpcore.c
> @@ -22,10 +22,10 @@
>   #include "qapi/error.h"
>   #include "qemu/module.h"
>   #include "hw/cpu/a15mpcore.h"
> +#include "hw/core/cpu.h"
>   #include "hw/core/irq.h"
>   #include "hw/core/qdev-properties.h"
>   #include "system/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/hw/cpu/meson.build b/hw/cpu/meson.build
> index 9d36bf8ae2c..9c1535ca325 100644
> --- a/hw/cpu/meson.build
> +++ b/hw/cpu/meson.build
> @@ -4,4 +4,4 @@ system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('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'))
>   system_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
> -specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
> +system_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~