From be979d35c7c8c7f6a251e1b1928dc0879232738b Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 14 Nov 2020 02:46:32 +0700 Subject: [PATCH 1/5] v6.5.3-dev --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From 9a1e867da264a8d3ce534ab8a846af5ffc788fa0 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sat, 14 Nov 2020 19:55:43 +0100 Subject: [PATCH 2/5] Fixed MSR mod names in JSON API --- src/backend/cpu/interfaces/ICpuInfo.h | 2 ++ src/backend/cpu/platform/BasicCpuInfo.cpp | 2 +- src/crypto/rx/RxConfig.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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..7177554f 100644 --- a/src/backend/cpu/platform/BasicCpuInfo.cpp +++ b/src/backend/cpu/platform/BasicCpuInfo.cpp @@ -53,7 +53,7 @@ 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" }; +static const std::array msrNames = { MSR_NAMES_LIST }; static inline void cpuid(uint32_t level, int32_t output[4]) 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 From 6379d1f90ef746298cd2f308af6e9f5f58e8d16a Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 15 Nov 2020 04:13:40 +0700 Subject: [PATCH 3/5] Add static_assert --- src/backend/cpu/platform/BasicCpuInfo.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/backend/cpu/platform/BasicCpuInfo.cpp b/src/backend/cpu/platform/BasicCpuInfo.cpp index 7177554f..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 = { MSR_NAMES_LIST }; +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); From aa284c6a3af1e9f00e73cb845645214b6620b9ba Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 15 Nov 2020 04:23:59 +0700 Subject: [PATCH 4/5] Added warning about libcpuid deprecation. --- src/backend/cpu/cpu.cmake | 1 + 1 file changed, 1 insertion(+) 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) From 19da03c9b7ee8f5812bbb3bd54bbc83b324aa3fd Mon Sep 17 00:00:00 2001 From: xmrig Date: Sun, 15 Nov 2020 07:14:46 +0700 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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.