From 008bfc27f3c1c1c24b91eb44c2a4b60bbb4e6ee9 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 29 Jul 2020 17:48:51 -0700 Subject: [PATCH] kern: automatic PC alignment on ERET is implementation defined --- .../libmesosphere/source/arch/arm64/kern_k_thread_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp index 4ba9028ac..b0dfa8892 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp @@ -70,7 +70,7 @@ namespace ams::kern::arch::arm64 { std::memset(ctx, 0, sizeof(*ctx)); /* Set PC and argument. */ - ctx->pc = GetInteger(pc); + ctx->pc = GetInteger(pc) & ~(UINT64_C(1)); ctx->x[0] = arg; /* Set PSR. */