From b48372f15f60d8b18e1a196c3e56da1f08bd8956 Mon Sep 17 00:00:00 2001 From: LotP1 Date: Sun, 17 Nov 2024 23:11:47 +0100 Subject: [PATCH] Use bigger memory blocks for GiantBlock When using GiantBlock the memory block used for filling SparseMemoryBlocks is now 4096 times bigger. Cuts function table mapping times by a factor of about 5000 --- src/Ryujinx.Cpu/AddressTable.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Cpu/AddressTable.cs b/src/Ryujinx.Cpu/AddressTable.cs index 9f292ab10..bf2dd38e7 100644 --- a/src/Ryujinx.Cpu/AddressTable.cs +++ b/src/Ryujinx.Cpu/AddressTable.cs @@ -137,7 +137,7 @@ namespace ARMeilleure.Common /// True if the bottom page should be sparsely mapped /// is null /// Length of is less than 2 - public AddressTable(AddressTableLevel[] levels, bool sparse) + public AddressTable(AddressTableLevel[] levels, bool sparse, bool lowPower) { ArgumentNullException.ThrowIfNull(levels); @@ -157,7 +157,7 @@ namespace ARMeilleure.Common { // If the address table is sparse, allocate a fill block - _sparseFill = new MemoryBlock(65536, MemoryAllocationFlags.Mirrorable); + _sparseFill = new MemoryBlock(lowPower ? 65536ul : 268435456ul, MemoryAllocationFlags.Mirrorable); ulong bottomLevelSize = (1ul << levels.Last().Length) * (ulong)sizeof(TEntry); @@ -183,7 +183,7 @@ namespace ARMeilleure.Common // Assume software memory means that we don't want to use any signal handlers. bool sparse = type != MemoryManagerType.SoftwareMmu && type != MemoryManagerType.SoftwarePageTable; - return new AddressTable(AddressTablePresets.GetArmPreset(for64Bits, sparse, lowPower), sparse); + return new AddressTable(AddressTablePresets.GetArmPreset(for64Bits, sparse, lowPower), sparse, lowPower); } ///