On 1/12/22 04:10, Peter Maydell wrote:
In process_its_cmd() and process_mapti() we must check the event ID against a limit defined by the size field in the DTE, which specifies the number of ID bits minus one. Convert this code to our num_foo convention: * change the variable names * use uint64_t and 1ULL when calculating the number of valid event IDs, because DTE.SIZE is 5 bits and so num_eventids may be up to 2^32 * fix the off-by-one error in the comparisonSigned-off-by: Peter Maydell<[email protected]> --- hw/intc/arm_gicv3_its.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
Reviewed-by: Richard Henderson <[email protected]>
+ num_eventids = 1ULL << (FIELD_EX64(dte, DTE, SIZE) + 1);
Could be written 2 << N, instead of 1 << (N + 1). r~
