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.
  • Loading branch information
DemiMarie committed Aug 14, 2023
1 parent 215db8b commit d30f00c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 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];
};

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

#endif /* QUBES_GUI_PROTOCOL_H */

0 comments on commit d30f00c

Please sign in to comment.