diff mbox series

[2/4] target/arm: Do not imply ARM_CP_NO_GDB

Message ID 20250317-raw-v1-2-09e2dfff0e90@daynix.com (mailing list archive)
State New
Headers show
Series target/arm: Flag PMCNTENCLR with ARM_CP_NO_RAW | expand

Commit Message

Akihiko Odaki March 17, 2025, 11:16 a.m. UTC
Do not imply ARM_CP_NO_GDB when ARM_CP_NO_RAW.

A register without raw access support may still expose some state to GDB
that is managed by something else.

A register may its state with another register but may not be used for
either migration or KVM state synchronization. For example, a
multiplexing register cannot support raw access. KVM may also have
a problem when synchronizing a register.

Such a register can be flagged with ARM_CP_ALIAS | ARM_CP_NO_RAW, but
its value can be still exposed to GDB as it's usually the case for
registers flagged with ARM_CP_ALIAS. ARM_CP_NO_GDB should not be implied
in this case.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 target/arm/cpregs.h  | 8 ++++----
 target/arm/gdbstub.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h
index 52377c6eb50f..99e2afc84250 100644
--- a/target/arm/cpregs.h
+++ b/target/arm/cpregs.h
@@ -75,10 +75,10 @@  enum {
      */
     ARM_CP_IO                    = 1 << 9,
     /*
-     * Flag: Register has no underlying state and does not support raw access
-     * for state saving/loading; it will not be used for either migration or
-     * KVM state synchronization. Typically this is for "registers" which are
-     * actually used as instructions for cache maintenance and so on.
+     * Flag: Register does not support raw access for state saving/loading; it
+     * will not be used for either migration or KVM state synchronization.
+     * Typically this is for "registers" which are actually used as instructions
+     * for cache maintenance and so on.
      */
     ARM_CP_NO_RAW                = 1 << 10,
     /*
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
index 30068c226273..4459e90811b8 100644
--- a/target/arm/gdbstub.c
+++ b/target/arm/gdbstub.c
@@ -270,7 +270,7 @@  static void arm_register_sysreg_for_feature(gpointer key, gpointer value,
     CPUARMState *env = &cpu->env;
     DynamicGDBFeatureInfo *dyn_feature = &cpu->dyn_sysreg_feature;
 
-    if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_NO_GDB))) {
+    if (!(ri->type & ARM_CP_NO_GDB)) {
         if (arm_feature(env, ARM_FEATURE_AARCH64)) {
             if (ri->state == ARM_CP_STATE_AA64) {
                 arm_gen_one_feature_sysreg(&param->builder, dyn_feature,