From 864b6085a8744af73d682acf928a6f13a8e7aeca Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 15 May 2020 10:09:42 -0700 Subject: [PATCH] exo2: fix bugs in non-core0 bootup --- exosphere2/program/source/secmon_setup.cpp | 2 +- exosphere2/program/source/secmon_start_virtual.s | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/exosphere2/program/source/secmon_setup.cpp b/exosphere2/program/source/secmon_setup.cpp index 833e98b9a..02f044d4e 100644 --- a/exosphere2/program/source/secmon_setup.cpp +++ b/exosphere2/program/source/secmon_setup.cpp @@ -1018,7 +1018,7 @@ namespace ams::secmon { constexpr u32 ResetVectorHigh = static_cast((PhysicalTzramProgramResetVector >> BITSIZEOF(u32))); /* Write our reset vector to the secure boot registers. */ - reg::Write(secmon::MemoryRegionVirtualDeviceSystem.GetAddress() + SB_AA64_RESET_LOW, ResetVectorLow); + reg::Write(secmon::MemoryRegionVirtualDeviceSystem.GetAddress() + SB_AA64_RESET_LOW, ResetVectorLow | 1); reg::Write(secmon::MemoryRegionVirtualDeviceSystem.GetAddress() + SB_AA64_RESET_HIGH, ResetVectorHigh); /* Disable non-secure writes to the reset vector. */ diff --git a/exosphere2/program/source/secmon_start_virtual.s b/exosphere2/program/source/secmon_start_virtual.s index 0727929ac..37f81f118 100644 --- a/exosphere2/program/source/secmon_start_virtual.s +++ b/exosphere2/program/source/secmon_start_virtual.s @@ -59,6 +59,9 @@ _ZN3ams6secmon20StartWarmbootVirtualEv: ldr x20, =0x1F01F67C0 mov sp, x20 + /* Setup X18 to point to the global context. */ + ldr x18, =0x1F01FA000 + /* Perform final warmboot setup. */ bl _ZN3ams6secmon24SetupSocSecurityWarmbootEv