ANDROID: KVM: arm64: Fix div type in hyp_trace clock

do_div is only for 32-bits integers. Use the div64_u64() variant
instead.

Bug: 357781595
Bug: 273748186
Change-Id: I7718373f0eb1373e90c1dd7b685ba3be89f93cc1
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
Vincent Donnefort
2025-01-23 15:10:04 +00:00
parent 6327fe6333
commit eb277bec9e
+1 -9
View File
@@ -122,15 +122,7 @@ static void __hyp_clock_work(struct work_struct *work)
err / NSEC_PER_USEC);
}
if (delta_boot > U32_MAX) {
do_div(delta_boot, NSEC_PER_SEC);
rate = delta_cycles;
} else {
rate = delta_cycles * NSEC_PER_SEC;
}
do_div(rate, delta_boot);
rate = div64_u64(delta_cycles * NSEC_PER_SEC, delta_boot);
clocks_calc_mult_shift(&hyp_clock->mult, &hyp_clock->shift,
rate, NSEC_PER_SEC, CLOCK_MAX_CONVERSION_S);