From 209796a07eac121b7b42c657da89b333697fb51e Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 16 Jan 2019 00:32:02 +0700 Subject: [PATCH 01/10] v2.9.0 --- src/version.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/version.h b/src/version.h index 05748d19..1dba25ec 100644 --- a/src/version.h +++ b/src/version.h @@ -5,6 +5,7 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , + * Copyright 2018-2019 SChernykh * Copyright 2016-2019 XMRig , * * This program is free software: you can redistribute it and/or modify @@ -27,15 +28,15 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig CPU miner" -#define APP_VERSION "2.8.5-dev" +#define APP_VERSION "2.9.0" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" #define APP_KIND "cpu" #define APP_VER_MAJOR 2 -#define APP_VER_MINOR 8 -#define APP_VER_PATCH 5 +#define APP_VER_MINOR 9 +#define APP_VER_PATCH 0 #ifdef _MSC_VER # if (_MSC_VER >= 1910) From 118e54717572220544e0ab84275ccccc919dd5fa Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 16 Jan 2019 02:22:29 +0700 Subject: [PATCH 02/10] Restored compatibility with https://stellite.hashvault.pro. --- CHANGELOG.md | 3 +++ src/common/net/Client.cpp | 3 ++- src/version.h | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c42bdb4f..f08f9db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v2.9.1 +- Restored compatibility with https://stellite.hashvault.pro. + # v2.9.0 - [#899](https://github.com/xmrig/xmrig/issues/899) Added support for new algorithm `cn/half` for Masari and Stellite forks. - [#834](https://github.com/xmrig/xmrig/pull/834) Added ASM optimized code for AMD Bulldozer. diff --git a/src/common/net/Client.cpp b/src/common/net/Client.cpp index 6da63942..8458b1e2 100644 --- a/src/common/net/Client.cpp +++ b/src/common/net/Client.cpp @@ -342,7 +342,8 @@ bool Client::parseJob(const rapidjson::Value ¶ms, int *code) if (params.HasMember("algo")) { job.setAlgorithm(params["algo"].GetString()); } - else if (params.HasMember("variant")) { + + if (params.HasMember("variant")) { const rapidjson::Value &variant = params["variant"]; if (variant.IsInt()) { diff --git a/src/version.h b/src/version.h index 1dba25ec..f3bb1dcc 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 CPU miner" -#define APP_VERSION "2.9.0" +#define APP_VERSION "2.9.1" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 2 #define APP_VER_MINOR 9 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1910) From 6425c53d61d848fe073d12e97438e284f272003f Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 16 Jan 2019 00:09:00 +0100 Subject: [PATCH 03/10] Fixed crash in patchCode() on Linux --- src/crypto/asm/cn_main_loop.S | 20 ++++---------------- src/crypto/asm/cn_main_loop.asm | 20 ++++---------------- src/crypto/asm/win64/cn_main_loop.S | 20 ++++---------------- src/crypto/asm/win64/cn_main_loop.asm | 20 ++++---------------- src/workers/CpuThread.cpp | 3 ++- 5 files changed, 18 insertions(+), 65 deletions(-) diff --git a/src/crypto/asm/cn_main_loop.S b/src/crypto/asm/cn_main_loop.S index 1e5610d1..1d52f206 100644 --- a/src/crypto/asm/cn_main_loop.S +++ b/src/crypto/asm/cn_main_loop.S @@ -23,10 +23,7 @@ FN_PREFIX(cnv2_mainloop_ivybridge_asm): #include "cn2/cnv2_main_loop_ivybridge.inc" add rsp, 48 ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) FN_PREFIX(cnv2_mainloop_ryzen_asm): @@ -35,10 +32,7 @@ FN_PREFIX(cnv2_mainloop_ryzen_asm): #include "cn2/cnv2_main_loop_ryzen.inc" add rsp, 48 ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) FN_PREFIX(cnv2_mainloop_bulldozer_asm): @@ -47,10 +41,7 @@ FN_PREFIX(cnv2_mainloop_bulldozer_asm): #include "cn2/cnv2_main_loop_bulldozer.inc" add rsp, 48 ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) FN_PREFIX(cnv2_double_mainloop_sandybridge_asm): @@ -60,7 +51,4 @@ FN_PREFIX(cnv2_double_mainloop_sandybridge_asm): #include "cn2/cnv2_double_main_loop_sandybridge.inc" add rsp, 48 ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE diff --git a/src/crypto/asm/cn_main_loop.asm b/src/crypto/asm/cn_main_loop.asm index 47b4df9e..2b7a1f46 100644 --- a/src/crypto/asm/cn_main_loop.asm +++ b/src/crypto/asm/cn_main_loop.asm @@ -8,40 +8,28 @@ ALIGN(64) cnv2_mainloop_ivybridge_asm PROC INCLUDE cn2/cnv2_main_loop_ivybridge.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_ivybridge_asm ENDP ALIGN(64) cnv2_mainloop_ryzen_asm PROC INCLUDE cn2/cnv2_main_loop_ryzen.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_ryzen_asm ENDP ALIGN(64) cnv2_mainloop_bulldozer_asm PROC INCLUDE cn2/cnv2_main_loop_bulldozer.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_bulldozer_asm ENDP ALIGN(64) cnv2_double_mainloop_sandybridge_asm PROC INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_double_mainloop_sandybridge_asm ENDP _TEXT_CNV2_MAINLOOP ENDS diff --git a/src/crypto/asm/win64/cn_main_loop.S b/src/crypto/asm/win64/cn_main_loop.S index 90e43470..bb0a581d 100644 --- a/src/crypto/asm/win64/cn_main_loop.S +++ b/src/crypto/asm/win64/cn_main_loop.S @@ -10,34 +10,22 @@ ALIGN(64) cnv2_mainloop_ivybridge_asm: #include "../cn2/cnv2_main_loop_ivybridge.inc" ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) cnv2_mainloop_ryzen_asm: #include "../cn2/cnv2_main_loop_ryzen.inc" ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) cnv2_mainloop_bulldozer_asm: #include "../cn2/cnv2_main_loop_bulldozer.inc" ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE ALIGN(64) cnv2_double_mainloop_sandybridge_asm: #include "../cn2/cnv2_double_main_loop_sandybridge.inc" ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE diff --git a/src/crypto/asm/win64/cn_main_loop.asm b/src/crypto/asm/win64/cn_main_loop.asm index 9c8a6ea9..40cb1cac 100644 --- a/src/crypto/asm/win64/cn_main_loop.asm +++ b/src/crypto/asm/win64/cn_main_loop.asm @@ -8,40 +8,28 @@ ALIGN 64 cnv2_mainloop_ivybridge_asm PROC INCLUDE cn2/cnv2_main_loop_ivybridge.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_ivybridge_asm ENDP ALIGN 64 cnv2_mainloop_ryzen_asm PROC INCLUDE cn2/cnv2_main_loop_ryzen.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_ryzen_asm ENDP ALIGN 64 cnv2_mainloop_bulldozer_asm PROC INCLUDE cn2/cnv2_main_loop_bulldozer.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_mainloop_bulldozer_asm ENDP ALIGN 64 cnv2_double_mainloop_sandybridge_asm PROC INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc ret 0 - nop - nop - nop - nop + mov eax, 0xDEADC0DE cnv2_double_mainloop_sandybridge_asm ENDP _TEXT_CNV2_MAINLOOP ENDS diff --git a/src/workers/CpuThread.cpp b/src/workers/CpuThread.cpp index 5b7016e4..082effe2 100644 --- a/src/workers/CpuThread.cpp +++ b/src/workers/CpuThread.cpp @@ -69,9 +69,10 @@ static void patchCode(T dst, U src, const uint32_t iterations, const uint32_t ma # endif size_t size = 0; - while (*(uint32_t*)(p + size) != 0x90909090) { + while (*(uint32_t*)(p + size) != 0xDEADC0DE) { ++size; } + size += sizeof(uint32_t); memcpy((void*) dst, (const void*) src, size); From d1f551da2c377c645f61ac4324e736c4ae9a751b Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 16 Jan 2019 00:24:34 +0100 Subject: [PATCH 04/10] Fixed compilation error on Windows --- src/crypto/asm/cn_main_loop.S | 8 ++++---- src/crypto/asm/cn_main_loop.asm | 8 ++++---- src/crypto/asm/win64/cn_main_loop.S | 8 ++++---- src/crypto/asm/win64/cn_main_loop.asm | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/crypto/asm/cn_main_loop.S b/src/crypto/asm/cn_main_loop.S index 1d52f206..a792337f 100644 --- a/src/crypto/asm/cn_main_loop.S +++ b/src/crypto/asm/cn_main_loop.S @@ -23,7 +23,7 @@ FN_PREFIX(cnv2_mainloop_ivybridge_asm): #include "cn2/cnv2_main_loop_ivybridge.inc" add rsp, 48 ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) FN_PREFIX(cnv2_mainloop_ryzen_asm): @@ -32,7 +32,7 @@ FN_PREFIX(cnv2_mainloop_ryzen_asm): #include "cn2/cnv2_main_loop_ryzen.inc" add rsp, 48 ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) FN_PREFIX(cnv2_mainloop_bulldozer_asm): @@ -41,7 +41,7 @@ FN_PREFIX(cnv2_mainloop_bulldozer_asm): #include "cn2/cnv2_main_loop_bulldozer.inc" add rsp, 48 ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) FN_PREFIX(cnv2_double_mainloop_sandybridge_asm): @@ -51,4 +51,4 @@ FN_PREFIX(cnv2_double_mainloop_sandybridge_asm): #include "cn2/cnv2_double_main_loop_sandybridge.inc" add rsp, 48 ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 diff --git a/src/crypto/asm/cn_main_loop.asm b/src/crypto/asm/cn_main_loop.asm index 2b7a1f46..f1384be8 100644 --- a/src/crypto/asm/cn_main_loop.asm +++ b/src/crypto/asm/cn_main_loop.asm @@ -8,28 +8,28 @@ ALIGN(64) cnv2_mainloop_ivybridge_asm PROC INCLUDE cn2/cnv2_main_loop_ivybridge.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_ivybridge_asm ENDP ALIGN(64) cnv2_mainloop_ryzen_asm PROC INCLUDE cn2/cnv2_main_loop_ryzen.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_ryzen_asm ENDP ALIGN(64) cnv2_mainloop_bulldozer_asm PROC INCLUDE cn2/cnv2_main_loop_bulldozer.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_bulldozer_asm ENDP ALIGN(64) cnv2_double_mainloop_sandybridge_asm PROC INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_double_mainloop_sandybridge_asm ENDP _TEXT_CNV2_MAINLOOP ENDS diff --git a/src/crypto/asm/win64/cn_main_loop.S b/src/crypto/asm/win64/cn_main_loop.S index bb0a581d..1200c4df 100644 --- a/src/crypto/asm/win64/cn_main_loop.S +++ b/src/crypto/asm/win64/cn_main_loop.S @@ -10,22 +10,22 @@ ALIGN(64) cnv2_mainloop_ivybridge_asm: #include "../cn2/cnv2_main_loop_ivybridge.inc" ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) cnv2_mainloop_ryzen_asm: #include "../cn2/cnv2_main_loop_ryzen.inc" ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) cnv2_mainloop_bulldozer_asm: #include "../cn2/cnv2_main_loop_bulldozer.inc" ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 ALIGN(64) cnv2_double_mainloop_sandybridge_asm: #include "../cn2/cnv2_double_main_loop_sandybridge.inc" ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 diff --git a/src/crypto/asm/win64/cn_main_loop.asm b/src/crypto/asm/win64/cn_main_loop.asm index 40cb1cac..846b860c 100644 --- a/src/crypto/asm/win64/cn_main_loop.asm +++ b/src/crypto/asm/win64/cn_main_loop.asm @@ -8,28 +8,28 @@ ALIGN 64 cnv2_mainloop_ivybridge_asm PROC INCLUDE cn2/cnv2_main_loop_ivybridge.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_ivybridge_asm ENDP ALIGN 64 cnv2_mainloop_ryzen_asm PROC INCLUDE cn2/cnv2_main_loop_ryzen.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_ryzen_asm ENDP ALIGN 64 cnv2_mainloop_bulldozer_asm PROC INCLUDE cn2/cnv2_main_loop_bulldozer.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_mainloop_bulldozer_asm ENDP ALIGN 64 cnv2_double_mainloop_sandybridge_asm PROC INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc ret 0 - mov eax, 0xDEADC0DE + mov eax, 3735929054 cnv2_double_mainloop_sandybridge_asm ENDP _TEXT_CNV2_MAINLOOP ENDS From b11e772accf854aa9940e8a92d830921388e93e8 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 16 Jan 2019 09:17:35 +0700 Subject: [PATCH 05/10] v2.9.2 --- CHANGELOG.md | 3 +++ src/version.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f08f9db5..5f1caca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v2.9.2 +- [#907](https://github.com/xmrig/xmrig/pull/907) Fixed crash on Linux. + # v2.9.1 - Restored compatibility with https://stellite.hashvault.pro. diff --git a/src/version.h b/src/version.h index f3bb1dcc..7f910bd5 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 CPU miner" -#define APP_VERSION "2.9.1" +#define APP_VERSION "2.9.2" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 2 #define APP_VER_MINOR 9 -#define APP_VER_PATCH 1 +#define APP_VER_PATCH 2 #ifdef _MSC_VER # if (_MSC_VER >= 1910) From b58e20dde4f92e4e6f80473b80ac55419a4dedd2 Mon Sep 17 00:00:00 2001 From: Emanuel Haupt Date: Wed, 16 Jan 2019 10:55:45 +0100 Subject: [PATCH 06/10] FreeBSD needs pthread FreeBSD needs the pthread linker flag. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 039bf418..da818232 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,7 @@ else() ) if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) - set(EXTRA_LIBS kvm) + set(EXTRA_LIBS kvm pthread) else() set(EXTRA_LIBS pthread rt dl) endif() From 2b15bcbb4f4ae29512ac01ee4661407f5ac9319f Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 16 Jan 2019 17:53:47 +0700 Subject: [PATCH 07/10] Don't use __builtin___clear_cache on FreeBSD. --- src/Mem_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mem_unix.cpp b/src/Mem_unix.cpp index 7db761ae..a30d9f72 100644 --- a/src/Mem_unix.cpp +++ b/src/Mem_unix.cpp @@ -102,5 +102,7 @@ void *Mem::allocateExecutableMemory(size_t size) void Mem::flushInstructionCache(void *p, size_t size) { +# ifndef __FreeBSD__ __builtin___clear_cache(reinterpret_cast(p), reinterpret_cast(p) + size); +# endif } From e0f5066ded91f6bbdddde17a854009c053ef6af3 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Thu, 17 Jan 2019 00:49:48 +0100 Subject: [PATCH 08/10] Correct FP rounding mode for cn/half --- src/crypto/CryptoNight_monero.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/CryptoNight_monero.h b/src/crypto/CryptoNight_monero.h index 966e516f..20fcfacb 100644 --- a/src/crypto/CryptoNight_monero.h +++ b/src/crypto/CryptoNight_monero.h @@ -66,9 +66,9 @@ __m128i sqrt_result_xmm_##part = _mm_cvtsi64_si128(h##part[13]); #ifdef _MSC_VER -# define VARIANT2_SET_ROUNDING_MODE() if (VARIANT == xmrig::VARIANT_2) { _control87(RC_DOWN, MCW_RC); } +# define VARIANT2_SET_ROUNDING_MODE() if (BASE == xmrig::VARIANT_2) { _control87(RC_DOWN, MCW_RC); } #else -# define VARIANT2_SET_ROUNDING_MODE() if (VARIANT == xmrig::VARIANT_2) { fesetround(FE_DOWNWARD); } +# define VARIANT2_SET_ROUNDING_MODE() if (BASE == xmrig::VARIANT_2) { fesetround(FE_DOWNWARD); } #endif # define VARIANT2_INTEGER_MATH(part, cl, cx) \ From b95ff65eaea3a42be603a6a88296e101c13e5374 Mon Sep 17 00:00:00 2001 From: xmrig Date: Thu, 17 Jan 2019 12:20:37 +0700 Subject: [PATCH 09/10] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f1caca0..8e880f87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.9.3 +- [#909](https://github.com/xmrig/xmrig/issues/909) Fixed compile errors on FreeBSD. +- [#912](https://github.com/xmrig/xmrig/pull/912) Fixed, C++ implementation of `cn/half` was produce up to 13% of invalid hashes. + # v2.9.2 - [#907](https://github.com/xmrig/xmrig/pull/907) Fixed crash on Linux. From b1c22da6a1b3e46d23444c6fa3b018eaac439dca Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 17 Jan 2019 12:21:39 +0700 Subject: [PATCH 10/10] v2.9.3 --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index 7f910bd5..a401f517 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 CPU miner" -#define APP_VERSION "2.9.2" +#define APP_VERSION "2.9.3" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 2 #define APP_VER_MINOR 9 -#define APP_VER_PATCH 2 +#define APP_VER_PATCH 3 #ifdef _MSC_VER # if (_MSC_VER >= 1910)