diff options
author | bunnei <bunneidev@gmail.com> | 2020-11-14 08:20:32 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-11-29 10:31:52 +0100 |
commit | 63fd1bb50302867b233325f253b1e2abbc379875 (patch) | |
tree | 65204a55cc87b2b4ef7260744ff96fabc813c9f6 /src/core/hle/kernel/memory/page_table.cpp | |
parent | hle: kernel: time_manager: Avoid a crash on process exit. (diff) | |
download | yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar.gz yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar.bz2 yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar.lz yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar.xz yuzu-63fd1bb50302867b233325f253b1e2abbc379875.tar.zst yuzu-63fd1bb50302867b233325f253b1e2abbc379875.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/memory/page_table.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/memory/page_table.cpp b/src/core/hle/kernel/memory/page_table.cpp index a3fadb533..f53a7be82 100644 --- a/src/core/hle/kernel/memory/page_table.cpp +++ b/src/core/hle/kernel/memory/page_table.cpp @@ -670,6 +670,11 @@ ResultCode PageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size, Memo return RESULT_SUCCESS; } + if ((prev_perm & MemoryPermission::Execute) != (perm & MemoryPermission::Execute)) { + // Memory execution state is changing, invalidate CPU cache range + system.InvalidateCpuInstructionCacheRange(addr, size); + } + const std::size_t num_pages{size / PageSize}; const OperationType operation{(perm & MemoryPermission::Execute) != MemoryPermission::None ? OperationType::ChangePermissionsAndRefresh |