tools/libs/ctrl: fix xc_core_arch_map_p2m() to support linear p2m table
authorJuergen Gross <jgross@suse.com>
Fri, 4 Jun 2021 06:02:10 +0000 (08:02 +0200)
committerJulien Grall <jgrall@amazon.com>
Fri, 4 Jun 2021 17:56:46 +0000 (18:56 +0100)
commitbd7a29c3d0b937ab542abea06ff1b575abe7247a
treebfe94a3c6ccc80a9c10f875a449449a64a4bf767
parent7bd8989ab77b6ade3b7a5f4b640a55248d1791a3
tools/libs/ctrl: fix xc_core_arch_map_p2m() to support linear p2m table

The core of a pv linux guest produced via "xl dump-core" is nor usable
as since kernel 4.14 only the linear p2m table is kept if Xen indicates
it is supporting that. Unfortunately xc_core_arch_map_p2m() is still
supporting the 3-level p2m tree only.

Fix that by copying the functionality of map_p2m() from libxenguest to
libxenctrl.

Additionally the mapped p2m isn't of a fixed length now, so the
interface to the mapping functions needs to be adapted. In order not to
add even more parameters, expand struct domain_info_context and use a
pointer to that as a parameter.

Fixes: dc6d60937121 ("libxc: set flag for support of linear p2m list in domain builder")
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
tools/include/xenguest.h
tools/libs/ctrl/xc_core.c
tools/libs/ctrl/xc_core.h
tools/libs/ctrl/xc_core_arm.c
tools/libs/ctrl/xc_core_x86.c
tools/libs/ctrl/xc_private.h
tools/libs/guest/xg_domain.c