diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index bc1ce7fca..0309fc59f 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -170,6 +170,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const return set(doc, kRandomX, "1gb-pages", true); case IConfig::RandomXWrmsrKey: /* --randomx-wrmsr */ + if (arg == nullptr) { + return set(doc, kRandomX, "wrmsr", true); + } + return set(doc, kRandomX, "wrmsr", static_cast(strtol(arg, nullptr, 10))); # endif diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index 9b360b23a..14ae5b2e0 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -100,7 +100,7 @@ static const option options[] = { { "randomx-mode", 1, nullptr, IConfig::RandomXModeKey }, { "randomx-1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, { "1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, - { "randomx-wrmsr", 1, nullptr, IConfig::RandomXWrmsrKey }, + { "randomx-wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey }, # endif # ifdef XMRIG_FEATURE_OPENCL { "opencl", 0, nullptr, IConfig::OclKey }, diff --git a/src/crypto/rx/RxConfig.cpp b/src/crypto/rx/RxConfig.cpp index cd8601a7d..e11aaba6a 100644 --- a/src/crypto/rx/RxConfig.cpp +++ b/src/crypto/rx/RxConfig.cpp @@ -109,7 +109,13 @@ rapidjson::Value xmrig::RxConfig::toJSON(rapidjson::Document &doc) const obj.AddMember(StringRef(kInit), m_threads, allocator); obj.AddMember(StringRef(kMode), StringRef(modeName()), allocator); obj.AddMember(StringRef(kOneGbPages), m_oneGbPages, allocator); - obj.AddMember(StringRef(kWrmsr), m_wrmsr < 0 ? Value(kFalseType) : Value(m_wrmsr), allocator); + + if (m_wrmsr < 0 || m_wrmsr == 6) { + obj.AddMember(StringRef(kWrmsr), m_wrmsr == 6, allocator); + } + else { + obj.AddMember(StringRef(kWrmsr), m_wrmsr, allocator); + } # ifdef XMRIG_FEATURE_HWLOC if (!m_nodeset.empty()) {