Skip to content

Commit

Permalink
Provide proper unmap notifications to GUI agent
Browse files Browse the repository at this point in the history
The GUI agent needs to know when grants it has sent are _unmapped_, not
just mapped.  Linux provides IOCTL_GNTDEV_SET_UNMAP_NOTIFY which can be
used for this purpose.  Add a new protocol message designed to use this
feature.  Also use proper flexible array members instead of empty
arrays.
  • Loading branch information
DemiMarie committed Jun 12, 2023
1 parent 215db8b commit dae27af
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/qubes-gui-protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
* - gui-daemon sends MSG_WINDOW_DUMP_ACK to acknowledge finishing
* MSG_WINDOW_DUMP processing; this allows agent to know when it
* can safely unmap a window's grants
* 1.8:
* - gui-daemon uses IOCTL_GNTDEV_SET_UNMAP_NOTIFY to notify the agent
* that a window's grants have actually been unmapped.
*/


Expand Down Expand Up @@ -305,11 +308,17 @@ struct msg_cursor {
} __attribute__((may_alias));

enum {
WINDOW_DUMP_TYPE_GRANT_REFS
WINDOW_DUMP_TYPE_GRANT_REFS,
WINDOW_DUMP_TYPE_GRANT_REFS_NOTIFY,
};

struct msg_window_dump_grant_refs {
uint32_t refs[0];
uint32_t refs[];
};

struct msg_window_dump_grant_refs_notify {
uint32_t evtchn_port;
uint32_t refs[];
};

#endif /* QUBES_GUI_PROTOCOL_H */

0 comments on commit dae27af

Please sign in to comment.