xenoprof: adjust ordering of page sharing vs domain type setting
authorJan Beulich <jbeulich@suse.com>
Mon, 4 May 2020 09:48:13 +0000 (11:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 May 2020 09:48:13 +0000 (11:48 +0200)
commit7f6a6e8c0a400d1a073b083fe0b7d25ef74b14e0
treed059e178de511d605651ed249df197b54b808708
parent0135be8bd8cd60090298f02310691b688d95c3a8
xenoprof: adjust ordering of page sharing vs domain type setting

Buffer pages should be shared with "ignored" or "active" guests only
(besides, obviously, the primary profiling domain). Hence domain type
should be set to "ignored" before unsharing from the primary domain
(which implies even a previously "passive" domain may then access its
buffers, albeit that's not very useful unless it gets promoted to
"active" subsequently), i.e. such that no further writes of records to
the buffer would occur, and (at least for consistency) also before
sharing it (with the calling domain) from the XENOPROF_get_buffer path.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wl@xen.org>
xen/common/xenoprof.c