From 568a433bb4a4845cf755be46fcab19b9487cc9bb Mon Sep 17 00:00:00 2001 From: Luke Craig Date: Fri, 18 Oct 2024 17:38:42 -0400 Subject: [PATCH] make aarch64 sbe more specific --- panda/plugins/osi_linux/osi_linux.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/plugins/osi_linux/osi_linux.cpp b/panda/plugins/osi_linux/osi_linux.cpp index afebaa39799..d6cfc3ead23 100644 --- a/panda/plugins/osi_linux/osi_linux.cpp +++ b/panda/plugins/osi_linux/osi_linux.cpp @@ -356,9 +356,12 @@ bool aarch64_initialized = false; void aarch64_sbe(CPUState *cpu, TranslationBlock *tb); void aarch64_sbe(CPUState *cpu, TranslationBlock *tb) { - if (unlikely(panda_in_kernel_code_linux(cpu) && ((CPUARMState*) cpu->env_ptr)->sp_el[0] != 0)){ + target_ulong pos = ((CPUARMState *)cpu->env_ptr)->sp_el[0]; + if (unlikely(panda_in_kernel_code_linux(cpu)) + && address_in_kernel_code_linux(pos)) + { aarch64_initialized = true; - spel0 = ((CPUARMState*) cpu->env_ptr)->sp_el[0]; + spel0 = pos; } }