]> xenbits.xensource.com Git - people/tklengyel/xen.git/commit
tools/dombuilder: Don't allocate dom->p2m_host[] for translated domains
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Dec 2019 18:20:33 +0000 (18:20 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 7 Jan 2020 12:46:03 +0000 (12:46 +0000)
commit97e34ad22d226b9680f4f9c00d0bb3294e2a1c80
tree9616a0eb7e11841e4c3b846c9e9ee9f696a5b1b4
parentd9b16799f633d94280d795a2903f8e6bd8bd7986
tools/dombuilder: Don't allocate dom->p2m_host[] for translated domains

xc_dom_p2m() and dom->p2m_host[] implement a linear transform for translated
domains, but waste a substantial chunk of RAM doing so.

ARM literally never reads dom->p2m_host[] (because of the xc_dom_translated()
short circuit in xc_dom_p2m()).  Drop it all.

x86 HVM does use dom->p2m_host[] for xc_domain_populate_physmap_exact() calls
when populating 4k pages.  Reuse the same tactic from 2M/1G ranges and use an
on-stack array instead.  Drop the memory allocation.

x86 PV guests do use dom->p2m_host[] as a non-identity transform.  Rename the
field to pv_p2m to make it clear it is PV-only.

No change in the constructed guests.

Reported-by: Varad Gautam <vrd@amazon.de>
Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
stubdom/grub/kexec.c
tools/libxc/include/xc_dom.h
tools/libxc/xc_dom_arm.c
tools/libxc/xc_dom_x86.c