From cf5895e04f66f3d3f25139768809420ef097ecf9 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 28 Mar 2024 00:18:31 -0700 Subject: [PATCH] kern: use userspace access instructions to read from tlr --- .../source/arch/arm64/svc/kern_svc_handlers_asm.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s b/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s index 6e6f07a30..a3ee735a2 100644 --- a/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s +++ b/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s @@ -68,7 +68,8 @@ _ZN3ams4kern4arch5arm6412SvcHandler64Ev: /* Check if our disable count allows us to call SVCs. */ mrs x10, tpidrro_el0 - ldrh w10, [x10, #(THREAD_LOCAL_REGION_DISABLE_COUNT)] + add x10, x10, #(THREAD_LOCAL_REGION_DISABLE_COUNT) + ldtrh w10, [x10] cbz w10, 1f /* It might not, so check the stack params to see if we must not allow the SVC. */ @@ -352,7 +353,8 @@ _ZN3ams4kern4arch5arm6412SvcHandler32Ev: /* Check if our disable count allows us to call SVCs. */ mrs x10, tpidrro_el0 - ldrh w10, [x10, #(THREAD_LOCAL_REGION_DISABLE_COUNT)] + add x10, x10, #(THREAD_LOCAL_REGION_DISABLE_COUNT) + ldtrh w10, [x10] cbz w10, 1f /* It might not, so check the stack params to see if we must not allow the SVC. */