Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Util: Detect presence of TSX_Force_Abort and print to log if detected #6045

Merged
merged 1 commit into from Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions Utilities/sysinfo.cpp 100644 → 100755
Expand Up @@ -44,6 +44,12 @@ bool utils::has_rtm()
return g_value;
}

bool utils::has_tsx_force_abort()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[3] & 0x2000) == 0x2000;
return g_value;
}

bool utils::has_mpx()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[1] & 0x4000) == 0x4000;
Expand Down Expand Up @@ -127,10 +133,17 @@ std::string utils::get_system_info()
if (has_rtm())
{
result += " | TSX";

if (has_tsx_force_abort())
{
result += "-FA";
}

if (!has_mpx())
{
result += " disabled by default";
}

}

return result;
Expand Down
2 changes: 2 additions & 0 deletions Utilities/sysinfo.h 100644 → 100755
Expand Up @@ -37,6 +37,8 @@ namespace utils

bool has_rtm();

bool has_tsx_force_abort();

bool has_mpx();

bool has_512();
Expand Down