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>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Dec 2023 16:44:10 -0800
From:   Bjorn Andersson <quic_bjorande@...cinc.com>
To:     Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>
CC:     <linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Randy Dunlap" <rdunlap@...radead.org>,
        Bjorn Andersson <quic_bjorande@...cinc.com>
Subject: [PATCH] soc: qcom: stats: Fix division issue on 32-bit platforms

commit 'e84e61bdb97c ("soc: qcom: stats: Add DDR sleep stats")' made it
in with a mult_frac() which causes link errors on Arm and PowerPC
builds:

  ERROR: modpost: "__aeabi_uldivmod" [drivers/soc/qcom/qcom_stats.ko] undefined!

Expand the mult_frac() to avoid this problem.

Fixes: e84e61bdb97c ("soc: qcom: stats: Add DDR sleep stats")
Reported-by: Randy Dunlap <rdunlap@...radead.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@...cinc.com>
---
 drivers/soc/qcom/qcom_stats.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
index 4763d62a8cb0..5ba61232313e 100644
--- a/drivers/soc/qcom/qcom_stats.c
+++ b/drivers/soc/qcom/qcom_stats.c
@@ -221,7 +221,8 @@ static int qcom_ddr_stats_show(struct seq_file *s, void *unused)
 
 	for (i = 0; i < ddr.entry_count; i++) {
 		/* Convert the period to ms */
-		entry[i].dur = mult_frac(MSEC_PER_SEC, entry[i].dur, ARCH_TIMER_FREQ);
+		entry[i].dur *= MSEC_PER_SEC;
+		entry[i].dur = div_u64(entry[i].dur, ARCH_TIMER_FREQ);
 	}
 
 	for (i = 0; i < ddr.entry_count; i++)

---
base-commit: adcad44bd1c73a5264bff525e334e2f6fc01bb9b
change-id: 20231205-qcom_stats-aeabi_uldivmod-fix-4a63c7ec013f

Best regards,
-- 
Bjorn Andersson <quic_bjorande@...cinc.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ