[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 06/29] target/arm: Wrap breakpoint/watchpoint updates with tcg
From: |
Fabiano Rosas |
Subject: |
[PATCH v6 06/29] target/arm: Wrap breakpoint/watchpoint updates with tcg_enabled |
Date: |
Fri, 17 Feb 2023 17:11:27 -0300 |
This is in preparation for restricting compilation of some parts of
debug_helper.c to TCG only.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
Dropped r-bs because I added a few more ifs in debug_helper.c
---
target/arm/cpu.c | 6 ++++--
target/arm/debug_helper.c | 16 ++++++++++++----
target/arm/machine.c | 7 +++++--
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 5f63316dbf..d7ceb626f0 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -536,8 +536,10 @@ static void arm_cpu_reset_hold(Object *obj)
}
#endif
- hw_breakpoint_update_all(cpu);
- hw_watchpoint_update_all(cpu);
+ if (tcg_enabled()) {
+ hw_breakpoint_update_all(cpu);
+ hw_watchpoint_update_all(cpu);
+ }
arm_rebuild_hflags(env);
}
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 3c671c88c1..3325eb9d7d 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -939,7 +939,9 @@ static void dbgwvr_write(CPUARMState *env, const
ARMCPRegInfo *ri,
value &= ~3ULL;
raw_write(env, ri, value);
- hw_watchpoint_update(cpu, i);
+ if (tcg_enabled()) {
+ hw_watchpoint_update(cpu, i);
+ }
}
static void dbgwcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
@@ -949,7 +951,9 @@ static void dbgwcr_write(CPUARMState *env, const
ARMCPRegInfo *ri,
int i = ri->crm;
raw_write(env, ri, value);
- hw_watchpoint_update(cpu, i);
+ if (tcg_enabled()) {
+ hw_watchpoint_update(cpu, i);
+ }
}
void hw_breakpoint_update(ARMCPU *cpu, int n)
@@ -1062,7 +1066,9 @@ static void dbgbvr_write(CPUARMState *env, const
ARMCPRegInfo *ri,
int i = ri->crm;
raw_write(env, ri, value);
- hw_breakpoint_update(cpu, i);
+ if (tcg_enabled()) {
+ hw_breakpoint_update(cpu, i);
+ }
}
static void dbgbcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
@@ -1079,7 +1085,9 @@ static void dbgbcr_write(CPUARMState *env, const
ARMCPRegInfo *ri,
value = deposit64(value, 8, 1, extract64(value, 7, 1));
raw_write(env, ri, value);
- hw_breakpoint_update(cpu, i);
+ if (tcg_enabled()) {
+ hw_breakpoint_update(cpu, i);
+ }
}
void define_debug_regs(ARMCPU *cpu)
diff --git a/target/arm/machine.c b/target/arm/machine.c
index b4c3850570..fd6323f6d8 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -2,6 +2,7 @@
#include "cpu.h"
#include "qemu/error-report.h"
#include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
#include "kvm_arm.h"
#include "internals.h"
#include "migration/cpu.h"
@@ -848,8 +849,10 @@ static int cpu_post_load(void *opaque, int version_id)
return -1;
}
- hw_breakpoint_update_all(cpu);
- hw_watchpoint_update_all(cpu);
+ if (tcg_enabled()) {
+ hw_breakpoint_update_all(cpu);
+ hw_watchpoint_update_all(cpu);
+ }
/*
* TCG gen_update_fp_context() relies on the invariant that
--
2.35.3
- [PATCH v6 00/29] target/arm: Allow CONFIG_TCG=n builds, Fabiano Rosas, 2023/02/17
- [PATCH v6 01/29] target/arm: rename handle_semihosting to tcg_handle_semihosting, Fabiano Rosas, 2023/02/17
- [PATCH v6 02/29] target/arm: wrap psci call with tcg_enabled, Fabiano Rosas, 2023/02/17
- [PATCH v6 03/29] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled(), Fabiano Rosas, 2023/02/17
- [PATCH v6 04/29] target/arm: Move PC alignment check, Fabiano Rosas, 2023/02/17
- [PATCH v6 05/29] target/arm: Move cpregs code out of cpu.h, Fabiano Rosas, 2023/02/17
- [PATCH v6 06/29] target/arm: Wrap breakpoint/watchpoint updates with tcg_enabled,
Fabiano Rosas <=
- [PATCH v6 07/29] target/arm: Wrap TCG-only code in debug_helper.c, Fabiano Rosas, 2023/02/17
- [PATCH v6 08/29] target/arm: move translate modules to tcg/, Fabiano Rosas, 2023/02/17
- [PATCH v6 09/29] target/arm: move helpers to tcg/, Fabiano Rosas, 2023/02/17
- [PATCH v6 10/29] target/arm: Move psci.c into the tcg directory, Fabiano Rosas, 2023/02/17
- [PATCH v6 11/29] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled, Fabiano Rosas, 2023/02/17
- [PATCH v6 12/29] target/arm: Move hflags code into the tcg directory, Fabiano Rosas, 2023/02/17
- [PATCH v6 14/29] target/arm: Don't access TCG code when debugging with KVM, Fabiano Rosas, 2023/02/17
- [PATCH v6 13/29] target/arm: Move regime_using_lpae_format into internal.h, Fabiano Rosas, 2023/02/17