diff --git a/CHANGELOG.md b/CHANGELOG.md index 933ec62c..9e932cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v6.5.3 +- [#1946](https://github.com/xmrig/xmrig/pull/1946) Fixed MSR mod names in JSON API (v6.5.2 affected). + # v6.5.2 - [#1935](https://github.com/xmrig/xmrig/pull/1935) Separate MSR mod for Zen/Zen2 and Zen3. - [#1937](https://github.com/xmrig/xmrig/issues/1937) Print path to existing WinRing0 service without verbose option. diff --git a/src/backend/cpu/cpu.cmake b/src/backend/cpu/cpu.cmake index b2efdb03..3894b1c6 100644 --- a/src/backend/cpu/cpu.cmake +++ b/src/backend/cpu/cpu.cmake @@ -47,6 +47,7 @@ if (WITH_HWLOC) src/backend/cpu/platform/HwlocCpuInfo.h ) elseif (WITH_LIBCPUID) + message(WARNING, "libcpuid support is deprecated and will be removed in future versions.") set(WITH_HWLOC OFF) add_subdirectory(src/3rdparty/libcpuid) diff --git a/src/backend/cpu/interfaces/ICpuInfo.h b/src/backend/cpu/interfaces/ICpuInfo.h index 57f6185a..9270ca09 100644 --- a/src/backend/cpu/interfaces/ICpuInfo.h +++ b/src/backend/cpu/interfaces/ICpuInfo.h @@ -55,6 +55,8 @@ public: MSR_MOD_MAX }; +# define MSR_NAMES_LIST "none", "ryzen_17h", "ryzen_19h", "intel", "custom" + enum Flag : uint32_t { FLAG_AES, FLAG_AVX2, diff --git a/src/backend/cpu/platform/BasicCpuInfo.cpp b/src/backend/cpu/platform/BasicCpuInfo.cpp index 43dbe1d2..7cf09f8c 100644 --- a/src/backend/cpu/platform/BasicCpuInfo.cpp +++ b/src/backend/cpu/platform/BasicCpuInfo.cpp @@ -52,8 +52,16 @@ namespace xmrig { -static const std::array flagNames = { "aes", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "xop", "popcnt", "cat_l3" }; -static const std::array msrNames = { "none", "ryzen", "intel", "custom" }; +constexpr size_t kCpuFlagsSize = 12; +static const std::array flagNames = { "aes", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "xop", "popcnt", "cat_l3" }; +static_assert(kCpuFlagsSize == ICpuInfo::FLAG_MAX, "kCpuFlagsSize and FLAG_MAX mismatch"); + + +#ifdef XMRIG_FEATURE_MSR +constexpr size_t kMsrArraySize = 5; +static const std::array msrNames = { MSR_NAMES_LIST }; +static_assert(kMsrArraySize == ICpuInfo::MSR_MOD_MAX, "kMsrArraySize and MSR_MOD_MAX mismatch"); +#endif static inline void cpuid(uint32_t level, int32_t output[4]) @@ -344,7 +352,12 @@ rapidjson::Value xmrig::BasicCpuInfo::toJSON(rapidjson::Document &doc) const out.AddMember("packages", static_cast(packages()), allocator); out.AddMember("nodes", static_cast(nodes()), allocator); out.AddMember("backend", StringRef(backend()), allocator); + +# ifdef XMRIG_FEATURE_MSR out.AddMember("msr", StringRef(msrNames[msrMod()]), allocator); +# else + out.AddMember("msr", "none", allocator); +# endif # ifdef XMRIG_FEATURE_ASM out.AddMember("assembly", StringRef(Assembly(assembly()).toString()), allocator); diff --git a/src/crypto/rx/RxConfig.cpp b/src/crypto/rx/RxConfig.cpp index 43e21a89..c501e712 100644 --- a/src/crypto/rx/RxConfig.cpp +++ b/src/crypto/rx/RxConfig.cpp @@ -74,7 +74,7 @@ static const std::array msrPresets = { MsrItems() }; -static const std::array modNames = { "none", "ryzen_17h", "ryzen_19h", "intel", "custom" }; +static const std::array modNames = { MSR_NAMES_LIST }; static_assert (kMsrArraySize == ICpuInfo::MSR_MOD_MAX, "kMsrArraySize and MSR_MOD_MAX mismatch"); #endif diff --git a/src/version.h b/src/version.h index 85c28eda..d716814f 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig miner" -#define APP_VERSION "6.5.2" +#define APP_VERSION "6.5.3-dev" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 6 #define APP_VER_MINOR 5 -#define APP_VER_PATCH 2 +#define APP_VER_PATCH 3 #ifdef _MSC_VER # if (_MSC_VER >= 1920)