summary refs log tree commit diff stats
path: root/cpu-common.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-21 12:12:35 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-09 17:00:47 +0100
commit30e76638eb35ffe88e95cca2b5af952c14dc336d (patch)
tree9a522a6d151abe32538b004dd99cba797739b5cd /cpu-common.c
parent43610f3184f846da948e8ab9dbc0c5de1e9bde79 (diff)
downloadfocaccia-qemu-30e76638eb35ffe88e95cca2b5af952c14dc336d.tar.gz
focaccia-qemu-30e76638eb35ffe88e95cca2b5af952c14dc336d.zip
cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro
CpuState caches its CPUClass since commit 6fbdff87062
("cpu: cache CPUClass in CPUState for hot code paths"),
use it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250122093028.52416-5-philmd@linaro.org>
Diffstat (limited to 'cpu-common.c')
-rw-r--r--cpu-common.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cpu-common.c b/cpu-common.c
index f5dcc2d136..ef5757d23b 100644
--- a/cpu-common.c
+++ b/cpu-common.c
@@ -388,11 +388,10 @@ void process_queued_cpu_work(CPUState *cpu)
 int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
                           CPUBreakpoint **breakpoint)
 {
-    CPUClass *cc = CPU_GET_CLASS(cpu);
     CPUBreakpoint *bp;
 
-    if (cc->gdb_adjust_breakpoint) {
-        pc = cc->gdb_adjust_breakpoint(cpu, pc);
+    if (cpu->cc->gdb_adjust_breakpoint) {
+        pc = cpu->cc->gdb_adjust_breakpoint(cpu, pc);
     }
 
     bp = g_malloc(sizeof(*bp));
@@ -418,11 +417,10 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
 /* Remove a specific breakpoint.  */
 int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
 {
-    CPUClass *cc = CPU_GET_CLASS(cpu);
     CPUBreakpoint *bp;
 
-    if (cc->gdb_adjust_breakpoint) {
-        pc = cc->gdb_adjust_breakpoint(cpu, pc);
+    if (cpu->cc->gdb_adjust_breakpoint) {
+        pc = cpu->cc->gdb_adjust_breakpoint(cpu, pc);
     }
 
     QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {