target/arm: More header rework around arm_feature() & multiprocessing.h
Subsystems (7)
cover target/arm: More header rework around arm_feature() & multiprocessing.h
Before I respin my "single-binary: Make hw/arm/ common" [1] I'm extracting these random cleanup patches. Some aren't necessary anymore because now units in arm_common_ss[] can access "cpu.h", but the patches are reviewed and simplify a bit IMO.
Based-on: <[email protected]>
"single-binary: compile target/arm twice"
[1] https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (19):
target/arm/tcg-stubs: compile file once (system) target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition target/arm: Only link with zlib when TCG is enabled target/arm/cpregs: Include missing 'target/arm/cpu.h' header hw/arm/boot: Include missing 'system/memory.h' header target/arm/cpu-features: Include missing 'cpu.h' header target/arm/qmp: Include missing 'cpu.h' header target/arm/kvm: Include missing 'cpu-qom.h' header target/arm/hvf: Include missing 'cpu-qom.h' header
hw/arm: Remove unnecessary 'cpu.h' header
target/arm: Restrict inclusion of 'multiprocessing.h' target/arm: Move some definitions from 'cpu.h' to 'multiprocessing.h' hw/arm: Include missing 'target/arm/gtimer.h' header target/arm: Extract PSCI definitions to 'psci.h' target/arm: Extract feature definitions to 'cpu_has_feature.h' header target/arm: Add arm_cpu_has_feature() helper hw/arm/realview: Replace arm_feature() -> arm_cpu_has_feature() hw/arm/virt-acpi: Replace arm_feature() -> arm_cpu_has_feature() target/arm: Always include full path to 'cpu.h'
MAINTAINERS | 1 + include/hw/arm/boot.h | 3 +- target/arm/cpregs.h | 1 + target/arm/cpu-features.h | 1 + target/arm/cpu.h | 79 ++-------------------------------- target/arm/cpu_has_feature.h | 67 ++++++++++++++++++++++++++++ target/arm/hvf_arm.h | 18 +------- target/arm/kvm_arm.h | 1 + target/arm/multiprocessing.h | 18 ++++++++ target/arm/psci.h | 18 ++++++++ target/arm/tcg/translate.h | 2 +- hw/arm/aspeed_ast2600.c | 1 + hw/arm/aspeed_ast27x0.c | 2 + hw/arm/bananapi_m2u.c | 1 + hw/arm/bcm2838.c | 1 + hw/arm/boot.c | 2 + hw/arm/exynos4210.c | 3 +- hw/arm/fsl-imx8mp.c | 1 + hw/arm/highbank.c | 2 +- hw/arm/imx8mp-evk.c | 1 + hw/arm/mcimx6ul-evk.c | 1 + hw/arm/mcimx7d-sabre.c | 1 + hw/arm/mps3r.c | 2 +- hw/arm/npcm8xx.c | 2 + hw/arm/orangepi.c | 1 + hw/arm/realview.c | 10 ++--- hw/arm/sbsa-ref.c | 2 + hw/arm/smmuv3.c | 1 - hw/arm/virt-acpi-build.c | 4 +- hw/arm/virt.c | 1 + hw/arm/xlnx-versal-virt.c | 1 + hw/arm/xlnx-zcu102.c | 1 + hw/vmapple/vmapple.c | 3 ++ target/arm/arch_dump.c | 2 +- target/arm/arm-powerctl.c | 2 +- target/arm/arm-qmp-cmds.c | 1 + target/arm/cortex-regs.c | 2 +- target/arm/cpu.c | 10 ++++- target/arm/cpu64.c | 2 +- target/arm/debug_helper.c | 2 +- target/arm/gdbstub.c | 2 +- target/arm/gdbstub64.c | 2 +- target/arm/helper.c | 3 +- target/arm/hvf-stub.c | 20 +++++++++ target/arm/hvf/hvf.c | 1 + target/arm/hyp_gdbstub.c | 2 +- target/arm/kvm-stub.c | 2 +- target/arm/kvm.c | 3 +- target/arm/machine.c | 2 +- target/arm/ptw.c | 2 +- target/arm/tcg-stubs.c | 2 +- target/arm/tcg/cpu-v7m.c | 2 +- target/arm/tcg/cpu32.c | 2 +- target/arm/tcg/cpu64.c | 2 +- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/hflags.c | 2 +- target/arm/tcg/iwmmxt_helper.c | 2 +- target/arm/tcg/m_helper.c | 2 +- target/arm/tcg/mte_helper.c | 2 +- target/arm/tcg/mve_helper.c | 2 +- target/arm/tcg/neon_helper.c | 2 +- target/arm/tcg/op_helper.c | 4 +- target/arm/tcg/pauth_helper.c | 2 +- target/arm/tcg/psci.c | 3 +- target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/sve_helper.c | 2 +- target/arm/tcg/tlb-insns.c | 2 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/vec_helper.c | 2 +- target/arm/tcg/vfp_helper.c | 2 +- target/arm/vfp_fpscr.c | 2 +- target/arm/meson.build | 4 +- target/arm/tcg/meson.build | 2 + 73 files changed, 221 insertions(+), 143 deletions(-) create mode 100644 target/arm/cpu_has_feature.h create mode 100644 target/arm/psci.h create mode 100644 target/arm/hvf-stub.c
Signature · 1 line
2.47.1
PATCH 1/19 target/arm/tcg-stubs: compile file once (system)
--- target/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/meson.build +1 -1
@@ -48,7 +48,7 @@ subdir('hvf') if 'CONFIG_TCG' in config_all_accel subdir('tcg') else - arm_ss.add(files('tcg-stubs.c')) + arm_common_system_ss.add(files('tcg-stubs.c')) endif target_arch += {'arm': arm_ss}
Signature · 1 line
2.47.1
Re: [PATCH 01/19] target/arm/tcg-stubs: compile file once (system)
On 13/5/25 19:39, Philippe Mathieu-Daudé wrote:
The objective is to remove the arm_ss[] source set soon.
Quoted 18 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/arm/meson.build +1
-1@@ -48,7 +48,7 @@ subdir('hvf') if 'CONFIG_TCG' in config_all_accel subdir('tcg') else - arm_ss.add(files('tcg-stubs.c')) + arm_common_system_ss.add(files('tcg-stubs.c')) endif target_arch += {'arm': arm_ss}
Re: [PATCH 01/19] target/arm/tcg-stubs: compile file once (system)
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 01/19] target/arm/tcg-stubs: compile file once (system)
In reply to Philippe Mathieu-DaudéQuoted 10 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/arm/meson.build +0
-0
target/arm/meson.build subdir('hvf') · line 54
Quoted 8 lines
target/arm/meson.build +1
-1@@ -48,7 +48,7 @@ subdir('hvf') if 'CONFIG_TCG' in config_all_accel subdir('tcg') else - arm_ss.add(files('tcg-stubs.c')) + arm_common_system_ss.add(files('tcg-stubs.c')) endif target_arch += {'arm': arm_ss}
r~
PATCH 2/19 target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition
In reply to Philippe Mathieu-DaudéIn order to allow non-target specific code to include "hvf_arm.h", define the stubs in hvf-stub.c.
--- MAINTAINERS | 1 + target/arm/hvf_arm.h | 16 ---------------- target/arm/hvf-stub.c | 20 ++++++++++++++++++++ target/arm/meson.build | 1 + 4 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 target/arm/hvf-stub.c
MAINTAINERS +1 -0
@@ -509,6 +509,7 @@ Apple Silicon HVF CPUs M: Alexander Graf <[email protected]> S: Maintained F: target/arm/hvf/ +F: target/arm/hvf-stub.c X86 HVF CPUs M: Cameron Esfahani <[email protected]>
target/arm/hvf_arm.h +0 -16
@@ -22,23 +22,7 @@ void hvf_arm_init_debug(void);void hvf_arm_set_cpu_features_from_host (ARMCPU *cpu); -#ifdef CONFIG_HVF -uint32_t hvf_arm_get_default_ipa_bit_size (void );uint32_t hvf_arm_get_max_ipa_bit_size (void ); -#else - -static inline uint32_t hvf_arm_get_default_ipa_bit_size (void ) -{ -return 0 ; -} - -static inline uint32_t hvf_arm_get_max_ipa_bit_size (void ) -{ -return 0 ; -} - -#endif -#endif
target/arm/hvf-stub.c new file +20 -0
@@ -0,0 +1,20 @@ +/* +* QEMU Hypervisor.framework (HVF) stubs for ARM +* +* Copyright (c) Linaro +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hvf_arm.h" + +uint32_t hvf_arm_get_default_ipa_bit_size (void ) +{ +g_assert_not_reached (); +} + +uint32_t hvf_arm_get_max_ipa_bit_size (void ) +{ +g_assert_not_reached (); +}
target/arm/meson.build +1 -0
@@ -32,6 +32,7 @@ arm_common_system_ss.add(files('cpu.c'), capstone) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c')) arm_common_system_ss.add(files( 'arch_dump.c', 'arm-powerctl.c',
Signature · 1 line
2.47.1
Re: [PATCH 02/19] target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition
Quoted 11 lines · Philippe Mathieu-Daudé
In order to allow non-target specific code to include "
hvf_arm.h", define the stubs inhvf-stub.c.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- MAINTAINERS | 1 + target/arm/hvf_arm.h | 16 ---------------- target/arm/hvf-stub.c | 20 ++++++++++++++++++++ target/arm/meson.build | 1 + 4 files changed, 22 insertions(+), 16 deletions(-)create mode 100644
target/arm/hvf-stub.c
Re: [PATCH 02/19] target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition
In reply to Philippe Mathieu-DaudéQuoted 11 lines · Philippe Mathieu-Daudé
In order to allow non-target specific code to include "
hvf_arm.h", define the stubs inhvf-stub.c.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- MAINTAINERS | 1 + target/arm/hvf_arm.h | 16 ---------------- target/arm/hvf-stub.c | 20 ++++++++++++++++++++ target/arm/meson.build | 1 + 4 files changed, 22 insertions(+), 16 deletions(-)create mode 100644
target/arm/hvf-stub.c
r~
PATCH 3/19 target/arm: Only link with zlib when TCG is enabled
In reply to Philippe Mathieu-DaudéSince commit 538b764d341 ("target/arm: Move minor arithmetic helpers out of helper.c") we only use the zlib helpers under TCG.
--- target/arm/meson.build | 1 - target/arm/tcg/meson.build | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
target/arm/meson.build +0 -1
@@ -3,7 +3,6 @@ arm_common_ss = ss.source_set() arm_ss.add(files( 'gdbstub.c', )) -arm_ss.add(zlib) arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'cpu64.c',
target/arm/tcg/meson.build +2 -0
@@ -56,6 +56,8 @@ arm_system_ss.add(files( arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files('cpu-v7m.c')) +arm_common_ss.add(zlib) + arm_common_ss.add(files( 'arith_helper.c', 'crypto_helper.c',
Signature · 1 line
2.47.1
Re: [PATCH 03/19] target/arm: Only link with zlib when TCG is enabled
Quoted 9 lines · Philippe Mathieu-Daudé
Since commit
538b764d341("target/arm: Move minor arithmetic helpers out ofhelper.c") we only use the zlib helpers under TCG.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/meson.build | 1 - target/arm/tcg/meson.build | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
PATCH 4/19 target/arm/cpregs: Include missing 'target/arm/cpu.h' header
In reply to Philippe Mathieu-DaudéCPReadFn type definitions use the CPUARMState type, itself declared in "cpu.h". Include this file in order to avoid when refactoring headers:
../target/arm/cpregs.h:241:27: error: unknown type name 'CPUARMState'
typedef uint64_t CPReadFn(CPUARMState *env, const ARMCPRegInfo *opaque);
^--- target/arm/cpregs.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpregs.h +1 -0
@@ -23,6 +23,7 @@#include "hw/registerfields.h" #include "target/arm/kvm-consts.h" +#include "cpu.h" /* * ARMCPRegInfo type field bits:
Signature · 1 line
2.47.1
PATCH 5/19 hw/arm/boot: Include missing 'system/memory.h' header
In reply to Philippe Mathieu-Daudédefault_reset_secondary() uses address_space_stl_notdirty(), itself declared in "system/memory.h". Include this header in order to avoid when refactoring headers:
../hw/arm/boot.c:281:5: error: implicit declaration of function 'address_space_stl_notdirty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
address_space_stl_notdirty(as, info->smp_bootreg_addr,
^--- hw/arm/boot.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/boot.c +1 -0
@@ -19,6 +19,7 @@#include "system/kvm.h" #include "system/tcg.h" #include "system/system.h" +#include "system/memory.h" #include "system/numa.h" #include "hw/boards.h" #include "system/reset.h"
Signature · 1 line
2.47.1
PATCH 6/19 target/arm/cpu-features: Include missing 'cpu.h' header
In reply to Philippe Mathieu-Daudé"target/arm/cpu-features.h" dereferences the ARMISARegisters structure, which is defined in "cpu.h". Include the latter to avoid when refactoring unrelated headers:
In file included from target/arm/internals.h:33:
target/arm/cpu-features.h:45:54: error: unknown type name 'ARMISARegisters'
45 | static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id)
| ^
target/arm/cpu-features.h:47:12: error: use of undeclared identifier 'R_ID_ISAR0_DIVIDE_SHIFT'
47 | return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0;
| ^--- target/arm/cpu-features.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu-features.h +1 -0
@@ -22,6 +22,7 @@#include "hw/registerfields.h" #include "qemu/host-utils.h" +#include "cpu.h" /* * Naming convention for isar_feature functions:
Signature · 1 line
2.47.1
PATCH 7/19 target/arm/qmp: Include missing 'cpu.h' header
In reply to Philippe Mathieu-Daudéarm-qmp-cmds.c uses ARM_MAX_VQ, which is defined in "cpu.h". Include the latter to avoid when refactoring unrelated headers:
target/arm/arm-qmp-cmds.c:83:19: error: use of undeclared identifier 'ARM_MAX_VQ'
83 | QEMU_BUILD_BUG_ON(ARM_MAX_VQ > 16);
| ^--- target/arm/arm-qmp-cmds.c | 1 + 1 file changed, 1 insertion(+)
target/arm/arm-qmp-cmds.c +1 -0
@@ -30,6 +30,7 @@#include "qapi/qapi-commands-misc-target.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" +#include "cpu.h" static GICCapability *gic_cap_new (int version) {
Signature · 1 line
2.47.1
PATCH 8/19 target/arm/kvm: Include missing 'cpu-qom.h' header
In reply to Philippe Mathieu-DaudéARMCPU typedef is declared in "cpu-qom.h". Include it in order to avoid when refactoring unrelated headers:
target/arm/kvm_arm.h:54:29: error: unknown type name 'ARMCPU'
54 | bool write_list_to_kvmstate(ARMCPU *cpu, int level);
| ^--- target/arm/kvm_arm.h | 1 + 1 file changed, 1 insertion(+)
target/arm/kvm_arm.h +1 -0
@@ -12,6 +12,7 @@#define QEMU_KVM_ARM_H #include "system/kvm.h" +#include "target/arm/cpu-qom.h" #define KVM_ARM_VGIC_V2 (1 << 0)#define KVM_ARM_VGIC_V3 (1 << 1)
Signature · 1 line
2.47.1
PATCH 9/19 target/arm/hvf: Include missing 'cpu-qom.h' header
In reply to Philippe Mathieu-DaudéARMCPU typedef is declared in "cpu-qom.h". Include it in order to avoid when refactoring unrelated headers:
target/arm/hvf_arm.h:23:41: error: unknown type name 'ARMCPU'
23 | void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
| ^--- target/arm/hvf_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/hvf_arm.h +1 -1
@@ -11,7 +11,7 @@#ifndef QEMU_HVF_ARM_H #define QEMU_HVF_ARM_H -#include "cpu.h" +#include "target/arm/cpu-qom.h" /** * hvf_arm_init_debug() - initialize guest debug capabilities
Signature · 1 line
2.47.1
Quoted 6 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (19):
target/arm/tcg-stubs: compile file once (system) target/arm/hvf_arm: Avoid using poisonedCONFIG_HVFdefinition target/arm: Only link with zlib when TCG is enabledtarget/arm: Always include full path to '
cpu.h'
Missing review: 1-3 & 19
Quoted 10 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (19):
target/arm/tcg-stubs: compile file once (system) target/arm/hvf_arm: Avoid using poisonedCONFIG_HVFdefinition target/arm: Only link with zlib when TCG is enabledtarget/arm: Always include full path to '
cpu.h'Missing review: 1-3 & 19
Thanks Philippe,
hopefully it can be pulled at the same than its base series.
Pierrick
PATCH 10/19 hw/arm: Remove unnecessary 'cpu.h' header
In reply to Philippe Mathieu-Daudé--- hw/arm/exynos4210.c | 1 - hw/arm/highbank.c | 1 - hw/arm/mps3r.c | 1 - hw/arm/smmuv3.c | 1 - 4 files changed, 4 deletions(-)
hw/arm/exynos4210.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "exec/tswap.h" -#include "cpu.h" #include "hw/cpu/a9mpcore.h" #include "hw/irq.h" #include "system/blockdev.h"
hw/arm/highbank.c +0 -1
@@ -35,7 +35,6 @@#include "hw/cpu/a15mpcore.h" #include "qemu/log.h" #include "qom/object.h" -#include "cpu.h" #include "target/arm/cpu-qom.h" #define SMP_BOOT_ADDR 0x100
hw/arm/mps3r.c +0 -1
@@ -29,7 +29,6 @@#include "qapi/error.h" #include "qobject/qlist.h" #include "system/address-spaces.h" -#include "cpu.h" #include "system/system.h" #include "hw/boards.h" #include "hw/or-irq.h"
hw/arm/smmuv3.c +0 -1
@@ -24,7 +24,6 @@#include "hw/qdev-properties.h" #include "hw/qdev-core.h" #include "hw/pci/pci.h" -#include "cpu.h" #include "exec/target_page.h" #include "trace.h" #include "qemu/log.h"
Signature · 1 line
2.47.1
PATCH 11/19 target/arm: Restrict inclusion of 'multiprocessing.h'
In reply to Philippe Mathieu-DaudéOnly cpu.c requires "multiprocessing.h" definitions so far.
--- target/arm/cpu.h | 1 - target/arm/cpu.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
target/arm/cpu.h +0 -1
@@ -30,7 +30,6 @@#include "exec/gdbstub.h" #include "exec/page-protection.h" #include "qapi/qapi-types-common.h" -#include "target/arm/multiprocessing.h" #include "target/arm/gtimer.h" #define EXCP_UDEF 1/* undefined instruction */
target/arm/cpu.c +1 -0
@@ -52,6 +52,7 @@#include "cpregs.h" #include "target/arm/cpu-qom.h" #include "target/arm/gtimer.h" +#include "target/arm/multiprocessing.h" static void arm_cpu_set_pc (CPUState *cs,vaddr value) {
Signature · 1 line
2.47.1
PATCH 12/19 target/arm: Move some definitions from 'cpu.h' to 'multiprocessing.h'
In reply to Philippe Mathieu-Daudéarm_build_mp_affinity() and affinity mask definitionss are related to multiprocessing. Move them to "multiprocessing.h", including this header when necessary.
--- target/arm/cpu.h | 17 ----------------- target/arm/multiprocessing.h | 18 ++++++++++++++++++ hw/arm/aspeed_ast2600.c | 1 + hw/arm/aspeed_ast27x0.c | 1 + hw/arm/exynos4210.c | 1 + hw/arm/npcm8xx.c | 1 + hw/arm/sbsa-ref.c | 1 + hw/vmapple/vmapple.c | 1 + target/arm/kvm.c | 1 + 9 files changed, 25 insertions(+), 17 deletions(-)
target/arm/cpu.h +0 -17
@@ -1155,23 +1155,6 @@ void gt_rme_post_el_change(ARMCPU *cpu, void *opaque);void arm_cpu_post_init (Object *obj); -#define ARM_AFF0_SHIFT 0 -#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT) -#define ARM_AFF1_SHIFT 8 -#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT) -#define ARM_AFF2_SHIFT 16 -#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT) -#define ARM_AFF3_SHIFT 32 -#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT) -#define ARM_DEFAULT_CPUS_PER_CLUSTER 8 - -#define ARM32_AFFINITY_MASK (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK) -#define ARM64_AFFINITY_MASK \ - (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK | ARM_AFF3_MASK) -#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK) - -uint64_t arm_build_mp_affinity (int idx,uint8_t clustersz); -#ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_arm_cpu;
target/arm/multiprocessing.h +18 -0
@@ -11,6 +11,24 @@#include "target/arm/cpu-qom.h" +#define ARM_AFF0_SHIFT 0 +#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT) +#define ARM_AFF1_SHIFT 8 +#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT) +#define ARM_AFF2_SHIFT 16 +#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT) +#define ARM_AFF3_SHIFT 32 +#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT) +#define ARM_DEFAULT_CPUS_PER_CLUSTER 8 + +#define ARM32_AFFINITY_MASK \ + (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK) +#define ARM64_AFFINITY_MASK \ + (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK|ARM_AFF3_MASK) +#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK) + +uint64_t arm_build_mp_affinity (int idx,uint8_t clustersz); +uint64_t arm_cpu_mp_affinity (ARMCPU *cpu);#endif
hw/arm/aspeed_ast2600.c +1 -0
@@ -17,6 +17,7 @@#include "net/net.h" #include "system/system.h" #include "target/arm/cpu-qom.h" +#include "target/arm/multiprocessing.h" #define ASPEED_SOC_IOMEM_SIZE 0x00200000#define ASPEED_SOC_DPMCU_SIZE 0x00040000
hw/arm/aspeed_ast27x0.c +1 -0
@@ -22,6 +22,7 @@#include "hw/intc/arm_gicv3.h" #include "qobject/qlist.h" #include "qemu/log.h" +#include "target/arm/multiprocessing.h" #define AST2700_SOC_IO_SIZE 0x01000000#define AST2700_SOC_IOMEM_SIZE 0x01000000
hw/arm/exynos4210.c +1 -0
@@ -36,6 +36,7 @@#include "hw/sd/sdhci.h" #include "hw/usb/hcd-ehci.h" #include "target/arm/cpu-qom.h" +#include "target/arm/multiprocessing.h" #define EXYNOS4210_CHIPID_ADDR 0x10000000
hw/arm/npcm8xx.c +1 -0
@@ -29,6 +29,7 @@#include "qapi/error.h" #include "qemu/units.h" #include "system/system.h" +#include "target/arm/multiprocessing.h" /* * This covers the whole MMIO space. We'll use this to catch any MMIO accesses
hw/arm/sbsa-ref.c +1 -0
@@ -52,6 +52,7 @@#include "qom/object.h" #include "target/arm/cpu-qom.h" #include "target/arm/gtimer.h" +#include "target/arm/multiprocessing.h" #define RAMLIMIT_GB 8192#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
hw/vmapple/vmapple.c +1 -0
@@ -51,6 +51,7 @@#include "system/reset.h" #include "system/runstate.h" #include "system/system.h" +#include "target/arm/multiprocessing.h" struct VMAppleMachineState {MachineState parent;
target/arm/kvm.c +1 -0
@@ -39,6 +39,7 @@#include "hw/acpi/acpi.h" #include "hw/acpi/ghes.h" #include "target/arm/gtimer.h" +#include "target/arm/multiprocessing.h" #include "migration/blocker.h" const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
Signature · 1 line
2.47.1
PATCH 13/19 hw/arm: Include missing 'target/arm/gtimer.h' header
In reply to Philippe Mathieu-Daudé--- hw/arm/aspeed_ast27x0.c | 1 + hw/arm/bcm2838.c | 1 + hw/arm/exynos4210.c | 1 + hw/arm/fsl-imx8mp.c | 1 + hw/arm/mps3r.c | 1 + hw/arm/npcm8xx.c | 1 + hw/vmapple/vmapple.c | 1 + target/arm/tcg/op_helper.c | 1 + 8 files changed, 8 insertions(+)
hw/arm/aspeed_ast27x0.c +1 -0
@@ -22,6 +22,7 @@#include "hw/intc/arm_gicv3.h" #include "qobject/qlist.h" #include "qemu/log.h" +#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" #define AST2700_SOC_IO_SIZE 0x01000000
hw/arm/bcm2838.c +1 -0
@@ -12,6 +12,7 @@#include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" #include "hw/arm/bcm2838.h" +#include "target/arm/gtimer.h" #include "trace.h" #define GIC400_MAINTENANCE_IRQ 9
hw/arm/exynos4210.c +1 -0
@@ -36,6 +36,7 @@#include "hw/sd/sdhci.h" #include "hw/usb/hcd-ehci.h" #include "target/arm/cpu-qom.h" +#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" #define EXYNOS4210_CHIPID_ADDR 0x10000000
hw/arm/fsl-imx8mp.c +1 -0
@@ -17,6 +17,7 @@#include "hw/boards.h" #include "system/system.h" #include "target/arm/cpu-qom.h" +#include "target/arm/gtimer.h" #include "qapi/error.h" #include "qobject/qlist.h"
hw/arm/mps3r.c +1 -0
@@ -47,6 +47,7 @@#include "hw/ssi/pl022.h" #include "hw/timer/cmsdk-apb-dualtimer.h" #include "hw/watchdog/cmsdk-apb-watchdog.h" +#include "target/arm/gtimer.h" /* Define the layout of RAM and ROM in a board */ typedef struct RAMInfo {
hw/arm/npcm8xx.c +1 -0
@@ -29,6 +29,7 @@#include "qapi/error.h" #include "qemu/units.h" #include "system/system.h" +#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" /*
hw/vmapple/vmapple.c +1 -0
@@ -51,6 +51,7 @@#include "system/reset.h" #include "system/runstate.h" #include "system/system.h" +#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" struct VMAppleMachineState {
target/arm/tcg/op_helper.c +1 -0
@@ -25,6 +25,7 @@#include "cpu-features.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/probe.h" +#include "target/arm/gtimer.h" #include "cpregs.h" #define SIGNBIT (uint32_t)0x80000000
Signature · 1 line
2.47.1
PATCH 14/19 target/arm: Extract PSCI definitions to 'psci.h'
In reply to Philippe Mathieu-DaudéExtract PSCI definitions (which are not target specific) to the new "target/arm/psci.h", so code from hw/arm/ can use them without having to include the target specific "cpu.h" header.
--- include/hw/arm/boot.h | 3 ++- target/arm/cpu.h | 7 ++----- target/arm/psci.h | 18 ++++++++++++++++++ hw/arm/bananapi_m2u.c | 1 + hw/arm/boot.c | 1 + hw/arm/highbank.c | 1 + hw/arm/imx8mp-evk.c | 1 + hw/arm/mcimx6ul-evk.c | 1 + hw/arm/mcimx7d-sabre.c | 1 + hw/arm/orangepi.c | 1 + hw/arm/sbsa-ref.c | 1 + hw/arm/virt-acpi-build.c | 1 + hw/arm/virt.c | 1 + hw/arm/xlnx-versal-virt.c | 1 + hw/arm/xlnx-zcu102.c | 1 + hw/vmapple/vmapple.c | 1 + target/arm/helper.c | 1 + target/arm/hvf/hvf.c | 1 + target/arm/tcg/op_helper.c | 1 + target/arm/tcg/psci.c | 1 + 20 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 target/arm/psci.h
include/hw/arm/boot.h +2 -1
@@ -12,6 +12,7 @@#define HW_ARM_BOOT_H #include "target/arm/cpu-qom.h" +//#include "target/arm/psci.h" #include "qemu/notify.h" typedef enum {
@@ -100,7 +101,7 @@ struct arm_boot_info {* as the conduit specifies calls should go to (eg guest firmware booted * to EL3) then PSCI will not be enabled. */ -int psci_conduit; +int psci_conduit;// /* Used internally by arm_boot.c */ int is_linux;hwaddr initrd_start;
target/arm/cpu.h +2 -5
@@ -3098,11 +3098,8 @@ static inline bool bswap_code(bool sctlr_b)#endif } -enum { -QEMU_PSCI_CONDUIT_DISABLED =0 , -QEMU_PSCI_CONDUIT_SMC =1 , -QEMU_PSCI_CONDUIT_HVC =2 , -}; +void cpu_get_tb_cpu_state (CPUARMState *env,vaddr *pc, +uint64_t *cs_base,uint32_t *flags);#ifndef CONFIG_USER_ONLY /* Return the address space index to use for a memory access */
target/arm/psci.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* ARM Power State Coordination Interface (PSCI) definitions +* +* Copyright (c) 2003 Fabrice Bellard +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef TARGET_ARM_PSCI_H +#define TARGET_ARM_PSCI_H + +enum { +QEMU_PSCI_CONDUIT_DISABLED =0 , +QEMU_PSCI_CONDUIT_SMC =1 , +QEMU_PSCI_CONDUIT_HVC =2 , +}; + +#endif
hw/arm/bananapi_m2u.c +1 -0
@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "hw/arm/allwinner-r40.h" #include "hw/arm/boot.h" +#include "target/arm/psci.h" static struct arm_boot_info bpim2u_binfo;
hw/arm/boot.c +1 -0
@@ -29,6 +29,7 @@#include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/units.h" +#include "target/arm/psci.h" /* Kernel boot protocol is specified in the kernel docs * Documentation/arm/Booting and Documentation/arm64/booting.txt
hw/arm/highbank.c +1 -0
@@ -36,6 +36,7 @@#include "qemu/log.h" #include "qom/object.h" #include "target/arm/cpu-qom.h" +#include "target/arm/psci.h" #define SMP_BOOT_ADDR 0x100#define SMP_BOOT_REG 0x40
hw/arm/imx8mp-evk.c +1 -0
@@ -15,6 +15,7 @@#include "system/qtest.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "target/arm/psci.h" #include <libfdt.h> static void imx8mp_evk_modify_dtb (const struct arm_boot_info *info,void *fdt)
hw/arm/mcimx6ul-evk.c +1 -0
@@ -18,6 +18,7 @@#include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "system/qtest.h" +#include "target/arm/psci.h" static void mcimx6ul_evk_init (MachineState *machine) {
hw/arm/mcimx7d-sabre.c +1 -0
@@ -20,6 +20,7 @@#include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "system/qtest.h" +#include "target/arm/psci.h" static void mcimx7d_sabre_init (MachineState *machine) {
hw/arm/orangepi.c +1 -0
@@ -26,6 +26,7 @@#include "hw/qdev-properties.h" #include "hw/arm/allwinner-h3.h" #include "hw/arm/boot.h" +#include "target/arm/psci.h" static struct arm_boot_info orangepi_binfo;
hw/arm/sbsa-ref.c +1 -0
@@ -53,6 +53,7 @@#include "target/arm/cpu-qom.h" #include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +#include "target/arm/psci.h" #define RAMLIMIT_GB 8192#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
hw/arm/virt-acpi-build.c +1 -0
@@ -59,6 +59,7 @@#include "hw/acpi/viot.h" #include "hw/virtio/virtio-acpi.h" #include "target/arm/multiprocessing.h" +#include "target/arm/psci.h" #define ARM_SPI_BASE 32
hw/arm/virt.c +1 -0
@@ -79,6 +79,7 @@#include "target/arm/internals.h" #include "target/arm/multiprocessing.h" #include "target/arm/gtimer.h" +#include "target/arm/psci.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" #include "hw/acpi/generic_event_device.h"
hw/arm/xlnx-versal-virt.c +1 -0
@@ -21,6 +21,7 @@#include "hw/arm/xlnx-versal.h" #include "hw/arm/boot.h" #include "target/arm/multiprocessing.h" +#include "target/arm/psci.h" #include "qom/object.h" #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
hw/arm/xlnx-zcu102.c +1 -0
@@ -26,6 +26,7 @@#include "qom/object.h" #include "net/can_emu.h" #include "audio/audio.h" +#include "target/arm/psci.h" struct XlnxZCU102 {MachineState parent_obj;
hw/vmapple/vmapple.c +1 -0
@@ -53,6 +53,7 @@#include "system/system.h" #include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +#include "target/arm/psci.h" struct VMAppleMachineState {MachineState parent;
target/arm/helper.c +1 -0
@@ -34,6 +34,7 @@#endif #include "cpregs.h" #include "target/arm/gtimer.h" +#include "target/arm/psci.h" #define HELPER_H "tcg/helper.h"#include "exec/helper-proto.h.inc"
target/arm/hvf/hvf.c +1 -0
@@ -33,6 +33,7 @@#include "target/arm/internals.h" #include "target/arm/multiprocessing.h" #include "target/arm/gtimer.h" +#include "target/arm/psci.h" #include "trace.h" #include "migration/vmstate.h"
target/arm/tcg/op_helper.c +1 -0
@@ -26,6 +26,7 @@#include "accel/tcg/cpu-ldst.h" #include "accel/tcg/probe.h" #include "target/arm/gtimer.h" +#include "target/arm/psci.h" #include "cpregs.h" #define SIGNBIT (uint32_t)0x80000000
target/arm/tcg/psci.c +1 -0
@@ -25,6 +25,7 @@#include "internals.h" #include "arm-powerctl.h" #include "target/arm/multiprocessing.h" +#include "target/arm/psci.h" bool arm_is_psci_call (ARMCPU *cpu,int excp_type) {
Signature · 1 line
2.47.1
PATCH 15/19 target/arm: Extract feature definitions to 'cpu_has_feature.h' header
In reply to Philippe Mathieu-Daudé--- target/arm/cpu.h | 54 +----------------------------- target/arm/cpu_has_feature.h | 65 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 53 deletions(-) create mode 100644 target/arm/cpu_has_feature.h
target/arm/cpu.h +1 -53
@@ -30,6 +30,7 @@#include "exec/gdbstub.h" #include "exec/page-protection.h" #include "qapi/qapi-types-common.h" +#include "target/arm/cpu_has_feature.h" #include "target/arm/gtimer.h" #define EXCP_UDEF 1/* undefined instruction */
@@ -2376,59 +2377,6 @@ FIELD(MFAR, NS, 63, 1)QEMU_BUILD_BUG_ON (ARRAY_SIZE (((ARMCPU *)0 )->ccsidr) <=R_V7M_CSSELR_INDEX_MASK ); -/* If adding a feature bit which corresponds to a Linux ELF -* HWCAP bit, remember to update the feature-bit-to-hwcap -* mapping in linux-user/elfload.c:get_elf_hwcap(). -*/ -enum arm_features { -ARM_FEATURE_AUXCR ,/* ARM1026 Auxiliary control register. */ -ARM_FEATURE_XSCALE ,/* Intel XScale extensions. */ -ARM_FEATURE_IWMMXT ,/* Intel iwMMXt extension. */ -ARM_FEATURE_V6 , -ARM_FEATURE_V6K , -ARM_FEATURE_V7 , -ARM_FEATURE_THUMB2 , -ARM_FEATURE_PMSA ,/* no MMU; may have Memory Protection Unit */ -ARM_FEATURE_NEON , -ARM_FEATURE_M ,/* Microcontroller profile. */ -ARM_FEATURE_OMAPCP ,/* OMAP specific CP15 ops handling. */ -ARM_FEATURE_THUMB2EE , -ARM_FEATURE_V7MP ,/* v7 Multiprocessing Extensions */ -ARM_FEATURE_V7VE ,/* v7 Virtualization Extensions (non-EL2 parts) */ -ARM_FEATURE_V4T , -ARM_FEATURE_V5 , -ARM_FEATURE_STRONGARM , -ARM_FEATURE_VAPA ,/* cp15 VA to PA lookups */ -ARM_FEATURE_GENERIC_TIMER , -ARM_FEATURE_MVFR ,/* Media and VFP Feature Registers 0 and 1 */ -ARM_FEATURE_DUMMY_C15_REGS ,/* RAZ/WI all of cp15 crn=15 */ -ARM_FEATURE_CACHE_TEST_CLEAN ,/* 926/1026 style test-and-clean ops */ -ARM_FEATURE_CACHE_DIRTY_REG ,/* 1136/1176 cache dirty status register */ -ARM_FEATURE_CACHE_BLOCK_OPS ,/* v6 optional cache block operations */ -ARM_FEATURE_MPIDR ,/* has cp15 MPIDR */ -ARM_FEATURE_LPAE ,/* has Large Physical Address Extension */ -ARM_FEATURE_V8 , -ARM_FEATURE_AARCH64 ,/* supports 64 bit mode */ -ARM_FEATURE_CBAR ,/* has cp15 CBAR */ -ARM_FEATURE_CBAR_RO ,/* has cp15 CBAR and it is read-only */ -ARM_FEATURE_EL2 ,/* has EL2 Virtualization support */ -ARM_FEATURE_EL3 ,/* has EL3 Secure monitor support */ -ARM_FEATURE_THUMB_DSP ,/* DSP insns supported in the Thumb encodings */ -ARM_FEATURE_PMU ,/* has PMU support */ -ARM_FEATURE_VBAR ,/* has cp15 VBAR */ -ARM_FEATURE_M_SECURITY ,/* M profile Security Extension */ -ARM_FEATURE_M_MAIN ,/* M profile Main Extension */ -ARM_FEATURE_V8_1M ,/* M profile extras only in v8.1M and later */ -/* -* ARM_FEATURE_BACKCOMPAT_CNTFRQ makes the CPU default cntfrq be 62.5MHz -* if the board doesn't set a value, instead of 1GHz. It is for backwards -* compatibility and used only with CPU definitions that were already -* in QEMU before we changed the default. It should not be set on any -* CPU types added in future. -*/ -ARM_FEATURE_BACKCOMPAT_CNTFRQ ,/* 62.5MHz timer default */ -}; -static inline int arm_feature (CPUARMState *env,int feature) {return (env->features & (1ULL << feature)) !=0 ;
target/arm/cpu_has_feature.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.47.1
PATCH 16/19 target/arm: Add arm_cpu_has_feature() helper
In reply to Philippe Mathieu-Daudéarm_cpu_has_feature() is equivalent of arm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.
--- target/arm/cpu_has_feature.h | 2 ++ target/arm/cpu.c | 7 +++++++ 2 files changed, 9 insertions(+)
target/arm/cpu_has_feature.h +2 -0
@@ -62,4 +62,6 @@ typedef enum arm_features {ARM_FEATURE_BACKCOMPAT_CNTFRQ ,/* 62.5MHz timer default */ } ArmCpuFeature; +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature); +#endif
target/arm/cpu.c +7 -0
@@ -54,6 +54,13 @@#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature) +{ +CPUARMState *env = &cpu->env; + +return arm_feature (env, feature); +} +static void arm_cpu_set_pc (CPUState *cs,vaddr value) {ARMCPU *cpu =ARM_CPU (cs);
Signature · 1 line
2.47.1
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.
CPUARMState is no more target-specific than ARMCPU.
Did you really mean to use CPUState?
Or is it merely that arm_cpu_has_feature is out-of-line?
r~
Quoted 37 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>--- target/arm/cpu_has_feature.h | 2 ++ target/arm/cpu.c | 7 +++++++ 2 files changed, 9 insertions(+)target/arm/cpu_has_feature.h +2
-0@@ -62,4 +62,6 @@ typedef enum arm_features {ARM_FEATURE_BACKCOMPAT_CNTFRQ ,/* 62.5MHz timer default */ } ArmCpuFeature; +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature); +#endif target/arm/cpu.c +7
-0@@ -54,6 +54,13 @@#include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature) +{ +CPUARMState *env = &cpu->env; + +return arm_feature (env, feature); +} +static void arm_cpu_set_pc (CPUState *cs,vaddr value) {ARMCPU *cpu =ARM_CPU (cs);
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 6 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.
Quoted 43 lines
Did you really mean to use CPUState?
Or is it merely thatarm_cpu_has_featureis out-of-line?r~
Quoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>---
target/arm/cpu_has_feature.h| 2 ++
target/arm/cpu.c | 7 +++++++2 files changed, 9 insertions(+)target/arm/cpu_has_feature.h +0
-0@@ -62,4 +62,6 @@ typedef enum arm_features {
ARM_FEATURE_BACKCOMPAT_CNTFRQ, /* 62.5MHz timer default */ } ArmCpuFeature;target/arm/cpu_has_feature.h +2
-0+bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature); +#endif
target/arm/cpu.c +7
-0@@ -54,6 +54,13 @@ #include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature) +{ + CPUARMState *env = &cpu->env; + + return arm_feature(env, feature); +} + static void arm_cpu_set_pc(CPUState *cs, vaddr value) { ARMCPU *cpu = ARM_CPU(cs);
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.
Quoted 7 lines
Quoted 1 line
CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in
target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.
Maybe we can simply postpone introduction of arm_cpu_has_feature() when it will be really needed.
Patches 17 and 18 are not strictly needed, as cpu.h (which resolves to target/arm/cpu.h implicitely) is perfectly accessible to code in hw/arm without any problem.
I asked in the past if there was a real need for this function, but didn't have a clear answer on where it's mandatory. In this series, it's an optional change.
That said, I don't want block any work arguing over this, so if you feel it's better to have it, so be it, and let's pull this.
Quoted 44 lines
Quoted 43 lines
Did you really mean to use CPUState?
Or is it merely thatarm_cpu_has_featureis out-of-line?r~
Quoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>--- target/arm/cpu_has_feature.h | 2 ++ target/arm/cpu.c | 7 +++++++ 2 files changed, 9 insertions(+)target/arm/cpu_has_feature.h +2
-0@@ -62,4 +62,6 @@ typedef enum arm_features { ARM_FEATURE_BACKCOMPAT_CNTFRQ, /* 62.5MHz timer default */ } ArmCpuFeature; +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature); + #endiftarget/arm/cpu.c +7
-0@@ -54,6 +54,13 @@ #include "target/arm/gtimer.h" #include "target/arm/multiprocessing.h" +bool arm_cpu_has_feature (ARMCPU *cpu,ArmCpuFeature feature) +{ + CPUARMState *env = &cpu->env; + + return arm_feature(env, feature); +} + static void arm_cpu_set_pc(CPUState *cs, vaddr value) { ARMCPU *cpu = ARM_CPU(cs);
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 15 lines · Pierrick Bouvier
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.Quoted 7 lines
Quoted 1 line
CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in
target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.
Quoted 3 lines
Maybe we can simply postpone introduction of
arm_cpu_has_feature()when it will be really needed.Patches 17 and 18 are not strictly needed, as
cpu.h(which resolves totarget/arm/cpu.himplicitely) is perfectly accessible to code in hw/arm without any problem.
OK.
Peter, would you be OK to take reviewed patches #1 up to #15 (the previous one) or do you rather I respin them?
Regards,
Phil.
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Pierrick Bouvier
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.Quoted 7 lines
Quoted 1 line
CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in
target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.Maybe we can simply postpone introduction of
arm_cpu_has_feature()when it will be really needed.
Quoted 9 lines
Quoted 3 lines
Patches 17 and 18 are not strictly needed, as
cpu.h(which resolves totarget/arm/cpu.himplicitely) is perfectly accessible to code in hw/arm without any problem.OK.
Peter, would you be OK to take reviewed patches #1 up to #15 (the previous one) or do you rather I respin them?
In case you respin, feel free to include the base series, so we can combine both.
Quoted 3 lines
Regards,
Phil.
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 24 lines · Pierrick Bouvier
Quoted 23 lines · Philippe Mathieu-Daudé
Quoted 21 lines · Pierrick Bouvier
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.Quoted 7 lines
Quoted 1 line
CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in
target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.Maybe we can simply postpone introduction of
arm_cpu_has_feature()when it will be really needed.Patches 17 and 18 are not strictly needed, as
cpu.h(which resolves totarget/arm/cpu.himplicitely) is perfectly accessible to code in hw/arm without any problem.
Quoted 7 lines
Quoted 5 lines
OK.
Peter, would you be OK to take reviewed patches #1 up to #15 (the previous one) or do you rather I respin them?
In case you respin, feel free to include the base series, so we can combine both.
Isn't the base already pulled in by Peter? I thought it was:
Re: [PATCH 16/19] target/arm: Add arm_cpu_has_feature() helper
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 26 lines · Pierrick Bouvier
Quoted 25 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Pierrick Bouvier
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
arm_cpu_has_feature()is equivalent ofarm_feature(), however while the latter uses CPUARMState so is target-specific, the former doesn't and can be called by target-agnostic code in hw/.Quoted 7 lines
Quoted 1 line
CPUARMState is no more target-specific than ARMCPU.
ARMCPU is forward-declared as opaque pointer in
target/arm/cpu-qom.h, so we can expose prototypes using it to non-ARM units. CPUARMState is only declared in "cpu.h", itself only accessible by ARM-related units.Quoted 6 lines
Maybe we can simply postpone introduction of
arm_cpu_has_feature()when it will be really needed.Patches 17 and 18 are not strictly needed, as
cpu.h(which resolves totarget/arm/cpu.himplicitely) is perfectly accessible to code in hw/arm without any problem.OK.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Peter, would you be OK to take reviewed patches #1 up to #15 (the previous one) or do you rather I respin them?
In case you respin, feel free to include the base series, so we can combine both.
Isn't the base already pulled in by Peter? I thought it was:
Oh, I missed it, thanks.
PATCH 17/19 hw/arm/realview: Replace arm_feature() -> arm_cpu_has_feature()
In reply to Philippe Mathieu-DaudéBy using arm_cpu_has_feature() instead of arm_feature() we don't need to include "cpu.h" anymore.
--- hw/arm/realview.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
hw/arm/realview.c +4 -6
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/primecell.h"
@@ -31,6 +30,7 @@#include "hw/sd/sd.h" #include "audio/audio.h" #include "target/arm/cpu-qom.h" +#include "target/arm/cpu_has_feature.h" #define SMP_BOOT_ADDR 0xe0000000#define SMP_BOOTREG_ADDR 0x10000030
@@ -77,7 +77,6 @@ static void realview_init(MachineState *machine, enum realview_board_type board_type) {ARMCPU *cpu =NULL ; -CPUARMState *env;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram_lo;MemoryRegion *ram_hi =g_new (MemoryRegion,1 );
@@ -138,16 +137,15 @@ static void realview_init(MachineState *machine, cpu_irq[n] =qdev_get_gpio_in (DEVICE (cpuobj),ARM_CPU_IRQ ); } cpu =ARM_CPU (first_cpu); - env = &cpu->env; -if (arm_feature (env,ARM_FEATURE_V7 )) { +if (arm_cpu_has_feature (cpu,ARM_FEATURE_V7 )) {if (is_mpcore) { proc_id =0x0c000000 ; }else { proc_id =0x0e000000 ; } - }else if (arm_feature (env,ARM_FEATURE_V6K )) { + }else if (arm_cpu_has_feature (cpu,ARM_FEATURE_V6K )) { proc_id =0x06000000 ; - }else if (arm_feature (env,ARM_FEATURE_V6 )) { + }else if (arm_cpu_has_feature (cpu,ARM_FEATURE_V6 )) { proc_id =0x04000000 ; }else { proc_id =0x02000000 ;
Signature · 1 line
2.47.1
PATCH 18/19 hw/arm/virt-acpi: Replace arm_feature() -> arm_cpu_has_feature()
In reply to Philippe Mathieu-DaudéUsing arm_cpu_has_feature() instead of arm_feature() remove a dependency on (the indirectly included) "cpu.h" header.
--- hw/arm/virt-acpi-build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +2 -1
@@ -58,6 +58,7 @@#include "hw/acpi/ghes.h" #include "hw/acpi/viot.h" #include "hw/virtio/virtio-acpi.h" +#include "target/arm/cpu_has_feature.h" #include "target/arm/multiprocessing.h" #include "target/arm/psci.h"
@@ -693,7 +694,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)ARMCPU *armcpu =ARM_CPU (qemu_get_cpu (i));uint64_t physical_base_address =0 , gich =0 , gicv =0 ;uint32_t vgic_interrupt = vms->virt ?ARCH_GIC_MAINT_IRQ :0 ; -uint32_t pmu_interrupt =arm_feature (&armcpu->env,ARM_FEATURE_PMU ) ? +uint32_t pmu_interrupt =arm_cpu_has_feature (armcpu,ARM_FEATURE_PMU ) ?VIRTUAL_PMU_IRQ :0 ;if (vms->gic_version ==VIRT_GIC_VERSION_2 ) {
Signature · 1 line
2.47.1
PATCH 19/19 target/arm: Always include full path to 'cpu.h'
In reply to Philippe Mathieu-DaudéSome files include "cpu.h", others "target/arm/cpu.h". Unify by using the latter which is more explicit.
--- target/arm/cpregs.h | 2 +- target/arm/cpu-features.h | 2 +- target/arm/tcg/translate.h | 2 +- target/arm/arch_dump.c | 2 +- target/arm/arm-powerctl.c | 2 +- target/arm/arm-qmp-cmds.c | 2 +- target/arm/cortex-regs.c | 2 +- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 2 +- target/arm/debug_helper.c | 2 +- target/arm/gdbstub.c | 2 +- target/arm/gdbstub64.c | 2 +- target/arm/helper.c | 2 +- target/arm/hyp_gdbstub.c | 2 +- target/arm/kvm-stub.c | 2 +- target/arm/kvm.c | 2 +- target/arm/machine.c | 2 +- target/arm/ptw.c | 2 +- target/arm/tcg-stubs.c | 2 +- target/arm/tcg/cpu-v7m.c | 2 +- target/arm/tcg/cpu32.c | 2 +- target/arm/tcg/cpu64.c | 2 +- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/hflags.c | 2 +- target/arm/tcg/iwmmxt_helper.c | 2 +- target/arm/tcg/m_helper.c | 2 +- target/arm/tcg/mte_helper.c | 2 +- target/arm/tcg/mve_helper.c | 2 +- target/arm/tcg/neon_helper.c | 2 +- target/arm/tcg/op_helper.c | 2 +- target/arm/tcg/pauth_helper.c | 2 +- target/arm/tcg/psci.c | 2 +- target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/sve_helper.c | 2 +- target/arm/tcg/tlb-insns.c | 2 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/vec_helper.c | 2 +- target/arm/tcg/vfp_helper.c | 2 +- target/arm/vfp_fpscr.c | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-)
target/arm/cpregs.h +1 -1
@@ -23,7 +23,7 @@#include "hw/registerfields.h" #include "target/arm/kvm-consts.h" -#include "cpu.h" +#include "target/arm/cpu.h" /* * ARMCPRegInfo type field bits:
target/arm/cpu-features.h +1 -1
@@ -22,7 +22,7 @@#include "hw/registerfields.h" #include "qemu/host-utils.h" -#include "cpu.h" +#include "target/arm/cpu.h" /* * Naming convention for isar_feature functions:
target/arm/tcg/translate.h +1 -1
@@ -1,7 +1,7 @@#ifndef TARGET_ARM_TRANSLATE_H #define TARGET_ARM_TRANSLATE_H -#include "cpu.h" +#include "target/arm/cpu.h" #include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "exec/translator.h"
target/arm/arch_dump.c +1 -1
@@ -19,7 +19,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "elf.h" #include "system/dump.h" #include "cpu-features.h"
target/arm/arm-powerctl.c +1 -1
@@ -9,7 +9,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "cpu-qom.h" #include "internals.h" #include "arm-powerctl.h"
target/arm/arm-qmp-cmds.c +1 -1
@@ -30,7 +30,7 @@#include "qapi/qapi-commands-misc-target.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" -#include "cpu.h" +#include "target/arm/cpu.h" static GICCapability *gic_cap_new (int version) {
target/arm/cortex-regs.c +1 -1
@@ -7,7 +7,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "cpregs.h"
target/arm/cpu.c +1 -1
@@ -27,7 +27,7 @@#include "target/arm/idau.h" #include "qemu/module.h" #include "qapi/error.h" -#include "cpu.h" +#include "target/arm/cpu.h" #ifdef CONFIG_TCG #include "exec/translation-block.h" #include "accel/tcg/cpu-ops.h"
target/arm/cpu64.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "cpregs.h" #include "qemu/module.h" #include "qemu/units.h"
target/arm/debug_helper.c +1 -1
@@ -7,7 +7,7 @@*/ #include "qemu/osdep.h" #include "qemu/log.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "cpregs.h"
target/arm/gdbstub.c +1 -1
@@ -18,7 +18,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "exec/gdbstub.h" #include "gdbstub/helpers.h" #include "gdbstub/commands.h"
target/arm/gdbstub64.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" #include "qemu/log.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "gdbstub/helpers.h" #include "gdbstub/commands.h"
target/arm/helper.c +1 -1
@@ -9,7 +9,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "trace.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "exec/page-protection.h"
target/arm/hyp_gdbstub.c +1 -1
@@ -10,7 +10,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "gdbstub/enums.h"
target/arm/kvm-stub.c +1 -1
@@ -10,7 +10,7 @@* */ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "kvm_arm.h" bool write_kvmstate_to_list (ARMCPU *cpu)
target/arm/kvm.c +1 -1
@@ -25,7 +25,7 @@#include "system/kvm.h" #include "system/kvm_int.h" #include "kvm_arm.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "trace.h" #include "internals.h" #include "hw/pci/pci.h"
target/arm/machine.c +1 -1
@@ -1,5 +1,5 @@#include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "qemu/error-report.h" #include "system/kvm.h" #include "system/tcg.h"
target/arm/ptw.c +1 -1
@@ -14,7 +14,7 @@#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "accel/tcg/probe.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "idau.h"
target/arm/tcg-stubs.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" void write_v7m_exception (CPUARMState *env,uint32_t new_exc)
target/arm/tcg/cpu-v7m.c +1 -1
@@ -9,7 +9,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "accel/tcg/cpu-ops.h" #include "internals.h"
target/arm/tcg/cpu32.c +1 -1
@@ -9,7 +9,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "accel/tcg/cpu-ops.h" #include "internals.h" #include "target/arm/idau.h"
target/arm/tcg/cpu64.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "qemu/module.h" #include "qapi/visitor.h" #include "hw/qdev-properties.h"
target/arm/tcg/helper-a64.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "gdbstub/helpers.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target/arm/tcg/hflags.c +1 -1
@@ -6,7 +6,7 @@* SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "exec/translation-block.h"
target/arm/tcg/iwmmxt_helper.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #define HELPER_H "tcg/helper.h"#include "exec/helper-proto.h.inc"
target/arm/tcg/m_helper.c +1 -1
@@ -7,7 +7,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "gdbstub/helpers.h"
target/arm/tcg/mte_helper.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "exec/page-protection.h" #ifdef CONFIG_USER_ONLY
target/arm/tcg/mve_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "vec_internal.h" #include "exec/helper-proto.h"
target/arm/tcg/neon_helper.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "vec_internal.h"
target/arm/tcg/op_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" #include "qemu/main-loop.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "exec/helper-proto.h" #include "exec/target_page.h" #include "internals.h"
target/arm/tcg/pauth_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "accel/tcg/cpu-ldst.h"
target/arm/tcg/psci.c +1 -1
@@ -17,7 +17,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "exec/helper-proto.h" #include "kvm-consts.h" #include "qemu/main-loop.h"
target/arm/tcg/sme_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "tcg/tcg-gvec-desc.h" #include "exec/helper-proto.h"
target/arm/tcg/sve_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "exec/page-protection.h" #include "exec/helper-proto.h"
target/arm/tcg/tlb-insns.c +1 -1
@@ -9,7 +9,7 @@#include "qemu/log.h" #include "exec/cputlb.h" #include "exec/target_page.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "cpregs.h"
target/arm/tcg/tlb_helper.c +1 -1
@@ -6,7 +6,7 @@* SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h"
target/arm/tcg/vec_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h"
target/arm/tcg/vfp_helper.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h" #include "fpu/softfloat.h"
target/arm/vfp_fpscr.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "cpu.h" +#include "target/arm/cpu.h" #include "internals.h" #include "cpu-features.h"
Signature · 1 line
2.47.1
Re: [PATCH 19/19] target/arm: Always include full path to 'cpu.h'
Quoted 38 lines · Philippe Mathieu-Daudé
Some files include "
cpu.h", others "target/arm/cpu.h". Unify by using the latter which is more explicit.Suggested-by Pierrick Bouvier <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/cpregs.h | 2 +- target/arm/cpu-features.h | 2 +- target/arm/tcg/translate.h | 2 +- target/arm/arch_dump.c | 2 +- target/arm/arm-powerctl.c | 2 +- target/arm/arm-qmp-cmds.c | 2 +- target/arm/cortex-regs.c | 2 +- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 2 +- target/arm/debug_helper.c | 2 +- target/arm/gdbstub.c | 2 +- target/arm/gdbstub64.c | 2 +- target/arm/helper.c | 2 +- target/arm/hyp_gdbstub.c | 2 +- target/arm/kvm-stub.c | 2 +- target/arm/kvm.c | 2 +- target/arm/machine.c | 2 +- target/arm/ptw.c | 2 +- target/arm/tcg-stubs.c | 2 +- target/arm/tcg/cpu-v7m.c | 2 +- target/arm/tcg/cpu32.c | 2 +- target/arm/tcg/cpu64.c | 2 +- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/hflags.c | 2 +- target/arm/tcg/iwmmxt_helper.c | 2 +- target/arm/tcg/m_helper.c | 2 +- target/arm/tcg/mte_helper.c | 2 +- target/arm/tcg/mve_helper.c | 2 +- target/arm/tcg/neon_helper.c | 2 +- target/arm/tcg/op_helper.c | 2 +- target/arm/tcg/pauth_helper.c | 2 +- target/arm/tcg/psci.c | 2 +-
Quoted 8 lines
target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/sve_helper.c | 2 +- target/arm/tcg/tlb-insns.c | 2 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/vec_helper.c | 2 +- target/arm/tcg/vfp_helper.c | 2 +- target/arm/vfp_fpscr.c | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-)
Quoted 11 lines · Philippe Mathieu-Daudé
Before I respin my "single-binary: Make hw/arm/ common" [1] I'm extracting these random cleanup patches. Some aren't necessary anymore because now units in arm_common_ss[] can access "
cpu.h", but the patches are reviewed and simplify a bit IMO.Based-on: <[email protected]>
"single-binary: compile target/arm twice"
Quoted 10 lines
Philippe Mathieu-Daudé (19):
target/arm/tcg-stubs: compile file once (system) target/arm/hvf_arm: Avoid using poisonedCONFIG_HVFdefinition target/arm: Only link with zlib when TCG is enabled target/arm/cpregs: Include missing 'target/arm/cpu.h' header hw/arm/boot: Include missing 'system/memory.h' header target/arm/cpu-features: Include missing 'cpu.h' header target/arm/qmp: Include missing 'cpu.h' header target/arm/kvm: Include missing 'cpu-qom.h' header target/arm/hvf: Include missing 'cpu-qom.h' header
Hi; I've applied these patches to target-arm.next.
Quoted 1 line
hw/arm: Remove unnecessary '
cpu.h' header
After this patch things fail to compile:
../../hw/arm/exynos4210.c:511:20: error: use of undeclared identifier 'ARM_AFF1_SHIFT'
511 | return (0x9 << ARM_AFF1_SHIFT) | cpu;
../../hw/arm/mps3r.c:295:14: error: use of undeclared identifier 'GTIMER_PHYS'; did you mean 'ITIMER_PROF'?
295 | [GTIMER_PHYS] = ARCH_TIMER_NS_EL1_IRQ,
etc. Probably this patch needs to go later in the series.
Quoted 1 line
target/arm: Restrict inclusion of '
multiprocessing.h'
Starting somewhere around here the patches don't apply any more (trivial rebase conflicts, I think, but given the compile error above I didn't spend time on trying to sort them out).
Quoted 9 lines
target/arm: Move some definitions from '
cpu.h' to 'multiprocessing.h'hw/arm: Include missing '
target/arm/gtimer.h' header target/arm: Extract PSCI definitions to 'psci.h' target/arm: Extract feature definitions to 'cpu_has_feature.h' header target/arm: Addarm_cpu_has_feature()helper hw/arm/realview: Replacearm_feature()->arm_cpu_has_feature()hw/arm/virt-acpi: Replacearm_feature()->arm_cpu_has_feature()target/arm: Always include full path to 'cpu.h'
I'm not sure about the arm_cpu_has_feature() patches at the tail end of the series, and there seemed to be some review comments to the effect that maybe we don't need them any more?
thanks
-- PMM