Commits on Source (4)
-
By adding a new xwl_present_event_from_vblank function we can avoid turning the vblank into an event_id, and also abstract away the exact encoding for event_id from most places. Signed-off-by:
Jessica Clarke <jrtc27@jrtc27.com>
-
All these arguments other than damage come from the vblank itself so passing the vblank simplifies the caller. Moreover, we pass the event_id solely so we can get back to the event, which is just the (extended) vblank, so passing the vblank avoids that round trip. Signed-off-by:
Jessica Clarke <jrtc27@jrtc27.com>
-
On traditional 32-bit and 64-bit architectures, uint64_t can be abused to hold a uintptr_t and be cast back to a valid pointer. However, on CHERI, and thus Arm's Morello prototype, pointers are capabilities, which contain a traditional address alongside additional metadata, including a tag bit that ensures it cannot be forged (the only way to get a capability with the tag bit set is by using instructions that take in another valid capability with sufficient bounds/permissions/etc for the request, and any other operation, like overwriting individual bytes in memory, will give a capability whose tag is clear). Casting a pointer to a uintptr_t is fine as uintptr_t is represented as a capability, but casting to a uint64_t yields just the address, losing the metadata and tag. Thus, when cast back to a uintptr_t, the capability remains invalid and faults on any attempt to dereference. As with various other places in the tree, address this by searching for the pointer in a list so that we no longer rely on this undefined behaviour. Signed-off-by:
Jessica Clarke <jrtc27@jrtc27.com>
-
Nothing should be relying on this anymore, so use a counter like other places in the tree instead. This ensures that the event_id doesn't get cast back into a pointer again in future, and also may be slightly less confusing in cases where calloc reuses an address as debug logs would show the same event_id for those but now they will be distinct. Signed-off-by:
Jessica Clarke <jrtc27@jrtc27.com>