linux/include/xen
Oleksandr Tyshchenko 9dd060afe2 xen/balloon: Bring alloc(free)_xenballooned_pages helpers back
This patch rolls back some of the changes introduced by commit
121f2faca2 "xen/balloon: rename alloc/free_xenballooned_pages"
in order to make possible to still allocate xenballooned pages
if CONFIG_XEN_UNPOPULATED_ALLOC is enabled.

On Arm the unpopulated pages will be allocated on top of extended
regions provided by Xen via device-tree (the subsequent patches
will add required bits to support unpopulated-alloc feature on Arm).
The problem is that extended regions feature has been introduced
into Xen quite recently (during 4.16 release cycle). So this
effectively means that Linux must only use unpopulated-alloc on Arm
if it is running on "new Xen" which advertises these regions.
But, it will only be known after parsing the "hypervisor" node
at boot time, so before doing that we cannot assume anything.

In order to keep working if CONFIG_XEN_UNPOPULATED_ALLOC is enabled
and the extended regions are not advertised (Linux is running on
"old Xen", etc) we need the fallback to alloc_xenballooned_pages().

This way we wouldn't reduce the amount of memory usable (wasting
RAM pages) for any of the external mappings anymore (and eliminate
XSA-300) with "new Xen", but would be still functional ballooning
out RAM pages with "old Xen".

Also rename alloc(free)_xenballooned_pages to xen_alloc(free)_ballooned_pages
and make xen_alloc(free)_unpopulated_pages static inline in xen.h
if CONFIG_XEN_UNPOPULATED_ALLOC is disabled.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/1639080336-26573-4-git-send-email-olekstysh@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-01-06 09:53:35 +01:00
..
arm xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
interface xen/x86: obtain upper 32 bits of video frame buffer address for Dom0 2022-01-06 08:55:34 +01:00
acpi.h xen: Remove support for PV ACPI cpu/memory hotplug 2021-04-23 09:31:50 +02:00
balloon.h xen/balloon: Bring alloc(free)_xenballooned_pages helpers back 2022-01-06 09:53:35 +01:00
events.h xen/console: harden hvc_xen against event channel storms 2021-12-16 08:24:08 +01:00
features.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
grant_table.h Xen/gnttab: introduce common INVALID_GRANT_{HANDLE,REF} 2021-03-10 16:39:29 -06:00
hvc-console.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hvm.h xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h 2020-06-11 15:15:19 +02:00
mem-reservation.h xen/balloon: add runtime control for scrubbing ballooned out pages 2018-09-14 08:51:10 -04:00
page.h swiotlb-xen: remove XEN_PFN_PHYS 2020-08-04 07:50:43 +02:00
pci.h xen-pciback: allow compiling on other archs than x86 2021-11-02 08:03:43 -05:00
platform_pci.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
swiotlb-xen.h Merge branch 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-05-04 10:58:49 -07:00
xen-front-pgdir-shbuf.h xen: Introduce shared buffer helpers for page directory... 2018-12-18 12:15:55 -05:00
xen-ops.h xen/privcmd: drop "pages" parameter from xen_remap_pfn() 2021-10-05 08:20:27 +02:00
xen.h xen/balloon: Bring alloc(free)_xenballooned_pages helpers back 2022-01-06 09:53:35 +01:00
xenbus_dev.h xenbus: Add support for xenbus backend in stub domain 2012-05-21 09:53:18 -04:00
xenbus.h xen: add "not_essential" flag to struct xenbus_driver 2021-11-23 13:41:29 -06:00