qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max


From: Richard Henderson
Subject: Re: [PATCH 2/2] target/arm: Implement FEAT WFxT and enable for '-cpu max'
Date: Tue, 30 Apr 2024 10:31:13 -0700
User-agent: Mozilla Thunderbird

On 4/30/24 07:00, Peter Maydell wrote:
+    if (uadd64_overflow(timeout, offset, &nexttick)) {
+        nexttick = UINT64_MAX;
+    }
+    if (nexttick > INT64_MAX / gt_cntfrq_period_ns(cpu)) {
+        /*
+         * If the timeout is too long for the signed 64-bit range
+         * of a QEMUTimer, let it expire early.
+         */
+        timer_mod_ns(cpu->wfxt_timer, INT64_MAX);
+    } else {
+        timer_mod(cpu->wfxt_timer, nexttick);
+    }

The use of both UINT64_MAX and INT64_MAX is confusing.  Perhaps

    if (uadd64_overflow(timeout, offset, &nexttick) ||
        nexttick > INT64_MAX / gt_cntfrq_period_ns(cpu)) {
        nexttick = INT64_MAX;
    }
    timer_mod(cpu->wfxt_timer, nexttick);


Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]