Revert the link to the Low Power PPTC cache setting
The emulator now always uses GiantBlock. TinyBlock has been left in, but is unused.
This commit is contained in:
parent
08520812d4
commit
ba0a65078d
@ -50,6 +50,9 @@ namespace ARMeilleure.Common
|
|||||||
new( 1, 30),
|
new( 1, 30),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//high power will run worse on DDR3 systems and some DDR4 systems due to the higher ram utilization
|
||||||
|
//low power will never run worse than non-sparse, but for most systems it won't be necessary
|
||||||
|
//high power is always used, but I've left low power in here for future reference
|
||||||
public static AddressTableLevel[] GetArmPreset(bool for64Bits, bool sparse, bool lowPower = false)
|
public static AddressTableLevel[] GetArmPreset(bool for64Bits, bool sparse, bool lowPower = false)
|
||||||
{
|
{
|
||||||
if (sparse)
|
if (sparse)
|
||||||
|
@ -137,7 +137,7 @@ namespace ARMeilleure.Common
|
|||||||
/// <param name="sparse">True if the bottom page should be sparsely mapped</param>
|
/// <param name="sparse">True if the bottom page should be sparsely mapped</param>
|
||||||
/// <exception cref="ArgumentNullException"><paramref name="levels"/> is null</exception>
|
/// <exception cref="ArgumentNullException"><paramref name="levels"/> is null</exception>
|
||||||
/// <exception cref="ArgumentException">Length of <paramref name="levels"/> is less than 2</exception>
|
/// <exception cref="ArgumentException">Length of <paramref name="levels"/> is less than 2</exception>
|
||||||
public AddressTable(AddressTableLevel[] levels, bool sparse, bool lowPower)
|
public AddressTable(AddressTableLevel[] levels, bool sparse)
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(levels);
|
ArgumentNullException.ThrowIfNull(levels);
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ namespace ARMeilleure.Common
|
|||||||
{
|
{
|
||||||
// If the address table is sparse, allocate a fill block
|
// If the address table is sparse, allocate a fill block
|
||||||
|
|
||||||
_sparseFill = new MemoryBlock(lowPower ? 65536ul : 268435456ul, MemoryAllocationFlags.Mirrorable);
|
_sparseFill = new MemoryBlock(268435456ul, MemoryAllocationFlags.Mirrorable); //low Power TC uses size: 65536ul
|
||||||
|
|
||||||
ulong bottomLevelSize = (1ul << levels.Last().Length) * (ulong)sizeof(TEntry);
|
ulong bottomLevelSize = (1ul << levels.Last().Length) * (ulong)sizeof(TEntry);
|
||||||
|
|
||||||
@ -178,12 +178,12 @@ namespace ARMeilleure.Common
|
|||||||
/// <param name="for64Bits">True if the guest is A64, false otherwise</param>
|
/// <param name="for64Bits">True if the guest is A64, false otherwise</param>
|
||||||
/// <param name="type">Memory manager type</param>
|
/// <param name="type">Memory manager type</param>
|
||||||
/// <returns>An <see cref="AddressTable{TEntry}"/> for ARM function lookup</returns>
|
/// <returns>An <see cref="AddressTable{TEntry}"/> for ARM function lookup</returns>
|
||||||
public static AddressTable<TEntry> CreateForArm(bool for64Bits, MemoryManagerType type, bool lowPower)
|
public static AddressTable<TEntry> CreateForArm(bool for64Bits, MemoryManagerType type)
|
||||||
{
|
{
|
||||||
// Assume software memory means that we don't want to use any signal handlers.
|
// Assume software memory means that we don't want to use any signal handlers.
|
||||||
bool sparse = type != MemoryManagerType.SoftwareMmu && type != MemoryManagerType.SoftwarePageTable;
|
bool sparse = type != MemoryManagerType.SoftwareMmu && type != MemoryManagerType.SoftwarePageTable;
|
||||||
|
|
||||||
return new AddressTable<TEntry>(AddressTablePresets.GetArmPreset(for64Bits, sparse, lowPower), sparse, lowPower);
|
return new AddressTable<TEntry>(AddressTablePresets.GetArmPreset(for64Bits, sparse), sparse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -9,7 +9,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
private readonly ITickSource _tickSource;
|
private readonly ITickSource _tickSource;
|
||||||
private readonly HvMemoryManager _memoryManager;
|
private readonly HvMemoryManager _memoryManager;
|
||||||
|
|
||||||
public HvCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit, bool lowPower)
|
public HvCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit)
|
||||||
{
|
{
|
||||||
_tickSource = tickSource;
|
_tickSource = tickSource;
|
||||||
_memoryManager = (HvMemoryManager)memory;
|
_memoryManager = (HvMemoryManager)memory;
|
||||||
|
@ -14,9 +14,9 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit, bool lowPower)
|
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit)
|
||||||
{
|
{
|
||||||
return new HvCpuContext(_tickSource, memoryManager, for64Bit, lowPower);
|
return new HvCpuContext(_tickSource, memoryManager, for64Bit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,6 @@ namespace Ryujinx.Cpu
|
|||||||
/// <param name="memoryManager">Memory manager for the address space of the context</param>
|
/// <param name="memoryManager">Memory manager for the address space of the context</param>
|
||||||
/// <param name="for64Bit">Indicates if the context will be used to run 64-bit or 32-bit Arm code</param>
|
/// <param name="for64Bit">Indicates if the context will be used to run 64-bit or 32-bit Arm code</param>
|
||||||
/// <returns>CPU context</returns>
|
/// <returns>CPU context</returns>
|
||||||
ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit, bool lowPower);
|
ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
private readonly Translator _translator;
|
private readonly Translator _translator;
|
||||||
private readonly AddressTable<ulong> _functionTable;
|
private readonly AddressTable<ulong> _functionTable;
|
||||||
|
|
||||||
public JitCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit, bool lowPower)
|
public JitCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit)
|
||||||
{
|
{
|
||||||
_tickSource = tickSource;
|
_tickSource = tickSource;
|
||||||
_functionTable = AddressTable<ulong>.CreateForArm(for64Bit, memory.Type, lowPower);
|
_functionTable = AddressTable<ulong>.CreateForArm(for64Bit, memory.Type);
|
||||||
_translator = new Translator(new JitMemoryAllocator(forJit: true), memory, _functionTable);
|
_translator = new Translator(new JitMemoryAllocator(forJit: true), memory, _functionTable);
|
||||||
|
|
||||||
if (memory.Type.IsHostMappedOrTracked())
|
if (memory.Type.IsHostMappedOrTracked())
|
||||||
|
@ -12,9 +12,9 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit, bool lowPower)
|
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit)
|
||||||
{
|
{
|
||||||
return new JitCpuContext(_tickSource, memoryManager, for64Bit, lowPower);
|
return new JitCpuContext(_tickSource, memoryManager, for64Bit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,11 @@ namespace Ryujinx.Cpu.LightningJit
|
|||||||
private readonly Translator _translator;
|
private readonly Translator _translator;
|
||||||
private readonly AddressTable<ulong> _functionTable;
|
private readonly AddressTable<ulong> _functionTable;
|
||||||
|
|
||||||
public LightningJitCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit, bool lowPower)
|
public LightningJitCpuContext(ITickSource tickSource, IMemoryManager memory, bool for64Bit)
|
||||||
{
|
{
|
||||||
_tickSource = tickSource;
|
_tickSource = tickSource;
|
||||||
|
|
||||||
_functionTable = AddressTable<ulong>.CreateForArm(for64Bit, memory.Type, lowPower);
|
_functionTable = AddressTable<ulong>.CreateForArm(for64Bit, memory.Type);
|
||||||
|
|
||||||
_translator = new Translator(memory, _functionTable);
|
_translator = new Translator(memory, _functionTable);
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@ namespace Ryujinx.Cpu.LightningJit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit, bool lowPower)
|
public ICpuContext CreateCpuContext(IMemoryManager memoryManager, bool for64Bit)
|
||||||
{
|
{
|
||||||
return new LightningJitCpuContext(_tickSource, memoryManager, for64Bit, lowPower);
|
return new LightningJitCpuContext(_tickSource, memoryManager, for64Bit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
GpuContext gpuContext,
|
GpuContext gpuContext,
|
||||||
T memoryManager,
|
T memoryManager,
|
||||||
ulong addressSpaceSize,
|
ulong addressSpaceSize,
|
||||||
bool for64Bit,
|
bool for64Bit)
|
||||||
bool lowPower)
|
|
||||||
{
|
{
|
||||||
if (memoryManager is IRefCounted rc)
|
if (memoryManager is IRefCounted rc)
|
||||||
{
|
{
|
||||||
@ -46,7 +45,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
|
|
||||||
_pid = pid;
|
_pid = pid;
|
||||||
_gpuContext = gpuContext;
|
_gpuContext = gpuContext;
|
||||||
_cpuContext = cpuEngine.CreateCpuContext(memoryManager, for64Bit, lowPower);
|
_cpuContext = cpuEngine.CreateCpuContext(memoryManager, for64Bit);
|
||||||
_memoryManager = memoryManager;
|
_memoryManager = memoryManager;
|
||||||
|
|
||||||
AddressSpaceSize = addressSpaceSize;
|
AddressSpaceSize = addressSpaceSize;
|
||||||
|
@ -48,13 +48,12 @@ namespace Ryujinx.HLE.HOS
|
|||||||
IArmProcessContext processContext;
|
IArmProcessContext processContext;
|
||||||
|
|
||||||
bool isArm64Host = RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
bool isArm64Host = RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
||||||
bool isLowPower = context.Device.Configuration.LowPowerPtc;
|
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS() && isArm64Host && for64Bit && context.Device.Configuration.UseHypervisor)
|
if (OperatingSystem.IsMacOS() && isArm64Host && for64Bit && context.Device.Configuration.UseHypervisor)
|
||||||
{
|
{
|
||||||
var cpuEngine = new HvEngine(_tickSource);
|
var cpuEngine = new HvEngine(_tickSource);
|
||||||
var memoryManager = new HvMemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
var memoryManager = new HvMemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
||||||
processContext = new ArmProcessContext<HvMemoryManager>(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit, isLowPower);
|
processContext = new ArmProcessContext<HvMemoryManager>(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -88,7 +87,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
{
|
{
|
||||||
case MemoryManagerMode.SoftwarePageTable:
|
case MemoryManagerMode.SoftwarePageTable:
|
||||||
var memoryManager = new MemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
var memoryManager = new MemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
||||||
processContext = new ArmProcessContext<MemoryManager>(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit, isLowPower);
|
processContext = new ArmProcessContext<MemoryManager>(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MemoryManagerMode.HostMapped:
|
case MemoryManagerMode.HostMapped:
|
||||||
@ -96,7 +95,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
if (addressSpace == null)
|
if (addressSpace == null)
|
||||||
{
|
{
|
||||||
var memoryManagerHostTracked = new MemoryManagerHostTracked(context.Memory, addressSpaceSize, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler);
|
var memoryManagerHostTracked = new MemoryManagerHostTracked(context.Memory, addressSpaceSize, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler);
|
||||||
processContext = new ArmProcessContext<MemoryManagerHostTracked>(pid, cpuEngine, _gpu, memoryManagerHostTracked, addressSpaceSize, for64Bit, isLowPower);
|
processContext = new ArmProcessContext<MemoryManagerHostTracked>(pid, cpuEngine, _gpu, memoryManagerHostTracked, addressSpaceSize, for64Bit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -106,7 +105,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
}
|
}
|
||||||
|
|
||||||
var memoryManagerHostMapped = new MemoryManagerHostMapped(addressSpace, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler);
|
var memoryManagerHostMapped = new MemoryManagerHostMapped(addressSpace, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler);
|
||||||
processContext = new ArmProcessContext<MemoryManagerHostMapped>(pid, cpuEngine, _gpu, memoryManagerHostMapped, addressSpace.AddressSpaceSize, for64Bit, isLowPower);
|
processContext = new ArmProcessContext<MemoryManagerHostMapped>(pid, cpuEngine, _gpu, memoryManagerHostMapped, addressSpace.AddressSpaceSize, for64Bit);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -115,7 +114,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DiskCacheLoadState = processContext.Initialize(_titleIdText, _displayVersion, _diskCacheEnabled, _codeAddress, _codeSize, isLowPower ? "LowPower" : "HighPower");
|
DiskCacheLoadState = processContext.Initialize(_titleIdText, _displayVersion, _diskCacheEnabled, _codeAddress, _codeSize, "HighPower"); //Ready for exefs profiles
|
||||||
|
|
||||||
return processContext;
|
return processContext;
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ namespace Ryujinx.Tests.Cpu
|
|||||||
{
|
{
|
||||||
private readonly Translator _translator;
|
private readonly Translator _translator;
|
||||||
|
|
||||||
public CpuContext(IMemoryManager memory, bool for64Bit, bool lowPower)
|
public CpuContext(IMemoryManager memory, bool for64Bit)
|
||||||
{
|
{
|
||||||
_translator = new Translator(new JitMemoryAllocator(), memory, AddressTable<ulong>.CreateForArm(for64Bit, memory.Type, lowPower));
|
_translator = new Translator(new JitMemoryAllocator(), memory, AddressTable<ulong>.CreateForArm(for64Bit, memory.Type));
|
||||||
memory.UnmapEvent += UnmapHandler;
|
memory.UnmapEvent += UnmapHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ namespace Ryujinx.Tests.Cpu
|
|||||||
|
|
||||||
_context = CpuContext.CreateExecutionContext();
|
_context = CpuContext.CreateExecutionContext();
|
||||||
|
|
||||||
_cpuContext = new CpuContext(_memory, for64Bit: true, lowPower: false);
|
_cpuContext = new CpuContext(_memory, for64Bit: true);
|
||||||
|
|
||||||
// Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table,
|
// Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table,
|
||||||
// which improves test durations.
|
// which improves test durations.
|
||||||
|
@ -57,7 +57,7 @@ namespace Ryujinx.Tests.Cpu
|
|||||||
_context = CpuContext.CreateExecutionContext();
|
_context = CpuContext.CreateExecutionContext();
|
||||||
_context.IsAarch32 = true;
|
_context.IsAarch32 = true;
|
||||||
|
|
||||||
_cpuContext = new CpuContext(_memory, for64Bit: false, lowPower: false);
|
_cpuContext = new CpuContext(_memory, for64Bit: false);
|
||||||
|
|
||||||
// Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table,
|
// Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table,
|
||||||
// which improves test durations.
|
// which improves test durations.
|
||||||
|
@ -22,7 +22,7 @@ namespace Ryujinx.Tests.Cpu
|
|||||||
_translator ??= new Translator(
|
_translator ??= new Translator(
|
||||||
new JitMemoryAllocator(),
|
new JitMemoryAllocator(),
|
||||||
new MockMemoryManager(),
|
new MockMemoryManager(),
|
||||||
AddressTable<ulong>.CreateForArm(true, MemoryManagerType.SoftwarePageTable, lowPower: false));
|
AddressTable<ulong>.CreateForArm(true, MemoryManagerType.SoftwarePageTable));
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
|
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
|
||||||
|
@ -58,7 +58,7 @@ namespace Ryujinx.Tests.Memory
|
|||||||
_translator ??= new Translator(
|
_translator ??= new Translator(
|
||||||
new JitMemoryAllocator(),
|
new JitMemoryAllocator(),
|
||||||
new MockMemoryManager(),
|
new MockMemoryManager(),
|
||||||
AddressTable<ulong>.CreateForArm(true, MemoryManagerType.SoftwarePageTable, lowPower: false));
|
AddressTable<ulong>.CreateForArm(true, MemoryManagerType.SoftwarePageTable));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user