From 815819767c5794624e3e7bc2bebcabe8ea4de0f6 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 7 Nov 2023 13:24:10 -0300 Subject: Force all exclusive memory accesses to be ordered on AppleHv (#5898) * Implement reprotect method on virtual memory manager (currently stubbed) * Force all exclusive memory accesses to be ordered on AppleHv * Format whitespace * Fix test build * Fix comment copy/paste * Fix wrong bit for isLoad * Update src/Ryujinx.Cpu/AppleHv/HvMemoryManager.cs Co-authored-by: riperiperi --------- Co-authored-by: riperiperi --- src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs') diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs index 2b00f802..2b6d4e4e 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs @@ -1255,7 +1255,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if ((oldPermission & KMemoryPermission.Execute) != 0) { - result = ReprotectWithAttributes(address, pagesCount, permission); + result = ReprotectAndFlush(address, pagesCount, permission); } else { @@ -3036,13 +3036,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory protected abstract Result Reprotect(ulong address, ulong pagesCount, KMemoryPermission permission); /// - /// Changes the permissions of a given virtual memory region. + /// Changes the permissions of a given virtual memory region, while also flushing the cache. /// /// Virtual address of the region to have the permission changes /// Number of pages to have their permissions changed /// New permission /// Result of the permission change operation - protected abstract Result ReprotectWithAttributes(ulong address, ulong pagesCount, KMemoryPermission permission); + protected abstract Result ReprotectAndFlush(ulong address, ulong pagesCount, KMemoryPermission permission); /// /// Alerts the memory tracking that a given region has been read from or written to. -- cgit v1.2.3