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.Cpu/Jit/MemoryManager.cs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/Ryujinx.Cpu/Jit/MemoryManager.cs') diff --git a/src/Ryujinx.Cpu/Jit/MemoryManager.cs b/src/Ryujinx.Cpu/Jit/MemoryManager.cs index 1c27e97f..912e3f7e 100644 --- a/src/Ryujinx.Cpu/Jit/MemoryManager.cs +++ b/src/Ryujinx.Cpu/Jit/MemoryManager.cs @@ -575,22 +575,15 @@ namespace Ryujinx.Cpu.Jit } } -#pragma warning disable IDE0051 // Remove unused private member - private ulong GetPhysicalAddress(ulong va) + private ulong GetPhysicalAddressInternal(ulong va) { - // We return -1L if the virtual address is invalid or unmapped. - if (!ValidateAddress(va) || !IsMapped(va)) - { - return ulong.MaxValue; - } - - return GetPhysicalAddressInternal(va); + return PteToPa(_pageTable.Read((va / PageSize) * PteSize) & ~(0xffffUL << 48)) + (va & PageMask); } -#pragma warning restore IDE0051 - private ulong GetPhysicalAddressInternal(ulong va) + /// + public void Reprotect(ulong va, ulong size, MemoryPermission protection) { - return PteToPa(_pageTable.Read((va / PageSize) * PteSize) & ~(0xffffUL << 48)) + (va & PageMask); + // TODO } /// @@ -698,9 +691,5 @@ namespace Ryujinx.Cpu.Jit /// Disposes of resources used by the memory manager. /// protected override void Destroy() => _pageTable.Dispose(); - -#pragma warning disable IDE0051 // Remove unused private member - private static void ThrowInvalidMemoryRegionException(string message) => throw new InvalidMemoryRegionException(message); -#pragma warning restore IDE0051 } } -- cgit v1.2.3