From 10ed579c389f9fb6756e1219e10ada2644f1a690 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 25 Oct 2021 13:38:52 -0700 Subject: [PATCH] kernel_ldr: bring initial cache flush in line with Nintendo --- libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp index 6225f28a8..e370a76e6 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp @@ -384,11 +384,13 @@ namespace ams::kern::arch::arm64::cpu { /* Store cache from L1 up to (level of coherence - 1). */ for (int level = 0; level < levels_of_coherency - 1; ++level) { PerformCacheOperationBySetWayImpl(level, StoreDataCacheLineBySetWayImpl); + DataSynchronizationBarrier(); } /* Flush cache from (level of coherence - 1) down to L0. */ for (int level = levels_of_coherency; level > 0; --level) { PerformCacheOperationBySetWayImpl(level - 1, FlushDataCacheLineBySetWayImpl); + DataSynchronizationBarrier(); } }