From c44ae06d5465d68183b1605eec45e5f2d7333f1e Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 21 Dec 2019 23:57:25 +0700 Subject: [PATCH] Added --randomx-no-rdmsr command line option. --- README.md | 3 ++- src/base/kernel/interfaces/IConfig.h | 1 + src/core/config/ConfigTransform.cpp | 3 +++ src/core/config/Config_platform.h | 3 +++ src/core/config/usage.h | 3 ++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 58c76659..9ded89f8 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ CPU backend: --randomx-no-numa disable NUMA support for RandomX --randomx-mode=MODE RandomX mode: auto, fast, light --randomx-1gb-pages use 1GB hugepages for dataset (Linux only) - --randomx-wrmsr=N write value (0-15) to Intel MSR register 0x1a4 or do nothing (-1) (Linux only) + --randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1) + --randomx-no-rdmsr disable reverting initial MSR values on exit API: --api-worker-id=ID custom worker-id for API diff --git a/src/base/kernel/interfaces/IConfig.h b/src/base/kernel/interfaces/IConfig.h index fe1a24b5..f483f044 100644 --- a/src/base/kernel/interfaces/IConfig.h +++ b/src/base/kernel/interfaces/IConfig.h @@ -92,6 +92,7 @@ public: RandomXModeKey = 1029, RandomX1GbPagesKey = 1031, RandomXWrmsrKey = 1032, + RandomXRdmsrKey = 1033, CPUMaxThreadsKey = 1026, MemoryPoolKey = 1027, YieldKey = 1030, diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index 0309fc59..eb58cdaa 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -175,6 +175,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const } return set(doc, kRandomX, "wrmsr", static_cast(strtol(arg, nullptr, 10))); + + case IConfig::RandomXRdmsrKey: /* --randomx-no-rdmsr */ + return set(doc, kRandomX, "rdmsr", false); # endif # ifdef XMRIG_FEATURE_OPENCL diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index 2a1725e3..1cf12337 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -102,6 +102,9 @@ static const option options[] = { { "randomx-1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, { "1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, { "randomx-wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey }, + { "wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey }, + { "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey }, + { "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey }, # endif # ifdef XMRIG_FEATURE_OPENCL { "opencl", 0, nullptr, IConfig::OclKey }, diff --git a/src/core/config/usage.h b/src/core/config/usage.h index 4fb62a48..cfda7ff4 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -89,7 +89,8 @@ static inline const std::string &usage() u += " --randomx-no-numa disable NUMA support for RandomX\n"; u += " --randomx-mode=MODE RandomX mode: auto, fast, light\n"; u += " --randomx-1gb-pages use 1GB hugepages for dataset (Linux only)\n"; - u += " --randomx-wrmsr=N write value (0-15) to Intel MSR register 0x1a4 or do nothing (-1) (Linux only)\n"; + u += " --randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)\n"; + u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n"; # endif # ifdef XMRIG_FEATURE_HTTP