Under certain conditions for events that use a bitmask of unit mask values, an invalid unit mask value specified by the user may be incorrectly accepted as valid. For example:
i386/sandybridge: The int_misc event has the following possible unit mask values that can be put into a bitmask:
Unit masks (default 0x40)
0x40: rat_stall_cycles Cycles Resource Allocation Table (RAT) external stall is sent to
Instruction Decode Queue (IDQ) for this thread.
0x03: recovery_cycles Number of cycles waiting to be recover after Nuke due to all other
cases except JEClear. (extra: cmask=1)
0x03: recovery_stalls_count Edge applied to recovery_cycles, thus counts occurrences.
(extra: edge cmask=1)
The event specification of int_misc:2000000:1 will be incorrectly accepted as valid.
The code in libop/op_events.c:op_check_events is faulty in how it ascertains the validity of a passed unit mask value when the given event's unit_type_mask == utm_bitmask.