TSX: new fallback method (time-based)

Basically, using timestamp counter.
Rewritten vm::reservation_op with the same principle.
Rewritten another transaction helper.
Add two new settings for configuring fallbacks.
Two limits are specified in nanoseconds (first and second).
Fix PUTLLC reload logic (prevent reusing garbage).
This commit is contained in:
Nekotekina 2020-10-31 01:52:24 +03:00
parent 80530e8aef
commit 86fc842c89
12 changed files with 263 additions and 79 deletions

View file

@ -55,7 +55,9 @@ LOG_CHANNEL(sys_log, "SYS");
stx::manual_fixed_typemap<void> g_fixed_typemap;
bool g_use_rtm;
bool g_use_rtm = false;
u64 g_rtm_tx_limit1 = 0;
u64 g_rtm_tx_limit2 = 0;
std::string g_cfg_defaults;
@ -1019,6 +1021,14 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
}
}
if (g_use_rtm)
{
// Update supplementary settings
const f64 _1ns = utils::get_tsc_freq() / 1000'000'000.;
g_rtm_tx_limit1 = g_cfg.core.tx_limit1_ns * _1ns;
g_rtm_tx_limit2 = g_cfg.core.tx_limit2_ns * _1ns;
}
// Load patches from different locations
g_fxo->get<patch_engine>()->append_title_patches(m_title_id);