lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220627155710.2067032-1-jcmvbkbc@gmail.com>
Date:   Mon, 27 Jun 2022 08:57:10 -0700
From:   Max Filippov <jcmvbkbc@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     linux-next@...r.kernel.org, ntb@...ts.linux.dev,
        Alexander Fomichev <a.fomichev@...ro.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Jon Mason <jdmason@...zu.us>, Max Filippov <jcmvbkbc@...il.com>
Subject: [PATCH] drivers/ntb/test: avoid 64-bit modulus operation

Redefine RESCHEDULE_RATIO to a closest power of 2 so that the following
code in the perf_run_latency

	/* Avoid processor soft lock-ups */
	if (!(pthr->tries % RESCHEDULE_RATIO))
		schedule();

doesn't do 64-bit modulus operation.
This fixes the following build failures on 32-bit architectures visible
in linux-next:

  ERROR: modpost: "__umoddi3" [drivers/ntb/test/ntb_perf.ko] undefined!

Fixes: dc150dfb081f ("ntb_perf: extend with burst latency measurement")
Signed-off-by: Max Filippov <jcmvbkbc@...il.com>
---
 drivers/ntb/test/ntb_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 23e154bd41b9..536fab0030f3 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -126,7 +126,7 @@ MODULE_DESCRIPTION("PCIe NTB Performance Measurement Tool");
 #define PERF_BUF_LEN 1024
 
 #define LAT_MIN_TRIES	20
-#define RESCHEDULE_RATIO	10000
+#define RESCHEDULE_RATIO	8192 /* power of 2, to avoid actual division */
 
 static unsigned long max_mw_size;
 module_param(max_mw_size, ulong, 0644);
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ