]> git.ipfire.org Git - thirdparty/linux.git/commit
mshv: Improve mshv_vp_stats_map/unmap(), add them to mshv_root.h
authorStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Wed, 28 Jan 2026 18:11:42 +0000 (10:11 -0800)
committerWei Liu <wei.liu@kernel.org>
Wed, 4 Feb 2026 06:17:05 +0000 (06:17 +0000)
commit1ba923d8cd837ec6ee33525f60f84daaaa26d4e9
treecc434334b6471c3a1eef9cf569703ac12f4fec8e
parent2de4516aa8f726946eadb9831c610b7aeb5bc682
mshv: Improve mshv_vp_stats_map/unmap(), add them to mshv_root.h

These functions are currently only used to map child partition VP stats,
on root partition. However, they will soon be used on L1VH, and also
used for mapping the host's own VP stats.

Introduce a helper is_l1vh_parent() to determine whether we are mapping
our own VP stats. In this case, do not attempt to map the PARENT area.
Note this is a different case than mapping PARENT on an older hypervisor
where it is not available at all, so must be handled separately.

On unmap, pass the stats pages since on L1VH the kernel allocates them
and they must be freed in hv_unmap_stats_page().

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Acked-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/mshv_root.h
drivers/hv/mshv_root_main.c