|
From: | Richard Henderson |
Subject: | Re: [PATCH 11/26] hw/intc/arm_gicv3_its: Use 1ULL when shifting by (DTE.SIZE + 1) |
Date: | Sun, 12 Dec 2021 12:43:28 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 12/11/21 11:11 AM, Peter Maydell wrote:
if (dte_valid) {- max_eventid = 1UL << (FIELD_EX64(dte, DTE, SIZE) + 1); + max_eventid = 1ULL << (FIELD_EX64(dte, DTE, SIZE) + 1);
Without changing the type of max_eventid, I think it'd be easiest to fix the off-by-one bug by not changing the comparisions, but changing this computation. E.g.
max_eventid = (2 << FIELD_EX64(dte, DTE, SIZE)) - 1; so that the value becomes UINT32_MAX for SIZE=31. r~
[Prev in Thread] | Current Thread | [Next in Thread] |