You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/target/arm
Akihiko Odaki bedcc7465d target/arm: Define raw write for PMU CLR registers
Raw writes to PMCNTENCLR and PMCNTENCLR_EL0 incorrectly used their
default write function, which clears written bits instead of writes the
raw value.

PMINTENCLR and PMINTENCLR_EL1 are similar registers, but they instead
had ARM_CP_NO_RAW. Commit 7a0e58fa64 ("target-arm: Split NO_MIGRATE
into ALIAS and NO_RAW") sugguests ARM_CP_ALIAS should be used instead of
ARM_CP_NO_RAW in such a case:

> We currently mark ARM coprocessor/system register definitions with
> the flag ARM_CP_NO_MIGRATE for two different reasons:
> 1) register is an alias on to state that's also visible via
>    some other register, and that other register is the one
>    responsible for migrating the state
> 2) register is not actually state at all (for instance the TLB
>    or cache maintenance operation "registers") and it makes no
>    sense to attempt to migrate it or otherwise access the raw state
>
> This works fine for identifying which registers should be ignored
> when performing migration, but we also use the same functions for
> synchronizing system register state between QEMU and the kernel
> when using KVM. In this case we don't want to try to sync state
> into registers in category 2, but we do want to sync into registers
> in category 1, because the kernel might have picked a different
> one of the aliases as its choice for which one to expose for
> migration.

These registers fall in category 1 (ARM_CP_ALIAS), not category 2
(ARM_CP_NO_RAW).

ARM_CP_NO_RAW also has another undesired side effect that hides
registers from GDB.

Properly set raw write functions and drop the ARM_CP_NO_RAW flag from
PMINTENCLR and PMINTENCLR_EL1; this fixes GDB/KVM state synchronization
of PMCNTENCLR and PMCNTENCLR_EL0, and exposes all these four registers
to GDB.

It is not necessary to add ARM_CP_ALIAS to these registers because the
flag is already set.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-id: 20250531-clr-v3-1-377f9bf1746d@rsg.ci.i.u-tokyo.ac.jp
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 weeks ago
..
hvf hvf: avoid repeatedly setting trap debug for each cpu 2 months ago
tcg target/arm: Only link with zlib when TCG is enabled 1 month ago
Kconfig kconfig: express dependency of individual boards on libfdt 1 year ago
arch_dump.c target/arm/arch_dump: remove TARGET_AARCH64 conditionals 2 months ago
arm-powerctl.c include: Rename sysemu/ -> system/ 6 months ago
arm-powerctl.h
arm-qmp-cmds.c target/arm/qmp: Include missing 'cpu.h' header 1 month ago
common-semi-target.h target/arm/common-semi-target.h: Remove unnecessary boot.h include 2 years ago
cortex-regs.c target/arm: Saturate L2CTLR_EL1 core count field rather than overflowing 2 years ago
cpregs.h target/arm/cpregs: Include missing 'target/arm/cpu.h' header 1 month ago
cpu-features.h target/arm/cpu-features: Include missing 'cpu.h' header 1 month ago
cpu-param.h accel/tcg: Move TARGET_TAGGED_ADDRESSES to TCGCPUOps.untagged_addr 2 months ago
cpu-qom.h target/arm: Remove TYPE_AARCH64_CPU 2 months ago
cpu.c target/arm: Fill in TCGCPUOps.pointer_wrap 1 month ago
cpu.h target/arm: Remove TYPE_AARCH64_CPU 2 months ago
cpu32-stubs.c target/arm/cpu: remove TARGET_AARCH64 in arm_cpu_finalize_features 2 months ago
cpu64.c target/arm: Remove TYPE_AARCH64_CPU 2 months ago
debug_helper.c target/arm/debug_helper: remove target_ulong 2 months ago
gdbstub.c target/arm: Handle AArch64 gdb read/write regs in TYPE_ARM_CPU 2 months ago
gdbstub64.c exec/cpu-all: remove exec/target_page include 2 months ago
gtimer.h target/arm: Document the architectural names of our GTIMERs 4 months ago
helper.c target/arm: Define raw write for PMU CLR registers 2 weeks ago
helper.h target/arm/helper: extract common helpers 2 months ago
hvf-stub.c target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition 1 month ago
hvf_arm.h target/arm/hvf: Include missing 'cpu-qom.h' header 1 month ago
hyp_gdbstub.c target/arm: Replace target_ulong -> vaddr for HWBreakpoint 2 months ago
idau.h Use DECLARE_*CHECKER* macros 5 years ago
internals.h target/arm: Replace target_ulong -> vaddr for HWBreakpoint 2 months ago
kvm-consts.h exec: Rename NEED_CPU_H -> COMPILING_PER_TARGET 1 year ago
kvm-stub.c target/arm/kvm-stub: add missing stubs 2 months ago
kvm.c kvm: Introduce kvm_arch_pre_create_vcpu() 1 month ago
kvm_arm.h target/arm/kvm: Include missing 'cpu-qom.h' header 1 month ago
machine.c target/arm/machine: move cpu_post_load kvm bits to kvm_arm_cpu_post_load function 2 months ago
meson.build target-arm queue: 4 weeks ago
multiprocessing.h target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header 1 year ago
ptw.c target/arm/ptw: replace TARGET_AARCH64 by CONFIG_ATOMIC64 from arm_casq_ptw 2 months ago
syndrome.h target/arm: fix exception syndrome for AArch32 bkpt insn 1 year ago
tcg-stubs.c target/arm: Unexport assert_hflags_rebuild_correctly 2 months ago
trace-events target/arm: Implement FEAT_ECV CNTPOFF_EL2 handling 1 year ago
trace.h
vfp_fpscr.c target/arm: Rename vfp_helper.c to vfp_fpscr.c 4 months ago