summaryrefslogtreecommitdiffstats
path: root/drivers/xen/unpopulated-alloc.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-04-07 11:38:57 +0200
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2022-04-07 15:08:37 -0500
commit262fc47ac17461c8cdc71c70aff6c3ea45acb0b9 (patch)
tree4c3fe0de6f1876ea113056ea4fac29223291bb40 /drivers/xen/unpopulated-alloc.c
parentde2ae403b4c0e79a3410e63bc448542fbb9f9bfc (diff)
downloadlinux-stable-262fc47ac17461c8cdc71c70aff6c3ea45acb0b9.tar.gz
linux-stable-262fc47ac17461c8cdc71c70aff6c3ea45acb0b9.tar.bz2
linux-stable-262fc47ac17461c8cdc71c70aff6c3ea45acb0b9.zip
xen/balloon: don't use PV mode extra memory for zone device allocations
When running as a Xen PV guest use the extra memory (memory which isn't allocated for the guest at boot time) only for ballooning purposes and not for zone device allocations. This will remove some code without any lack of functionality. While at it move some code to get rid of another #ifdef. Remove a comment which is stale since some time now. Signed-off-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20220407093857.1485-1-jgross@suse.com Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/unpopulated-alloc.c')
-rw-r--r--drivers/xen/unpopulated-alloc.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c
index a8b41057c382..a39f2d36dd9c 100644
--- a/drivers/xen/unpopulated-alloc.c
+++ b/drivers/xen/unpopulated-alloc.c
@@ -230,39 +230,6 @@ void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages)
}
EXPORT_SYMBOL(xen_free_unpopulated_pages);
-#ifdef CONFIG_XEN_PV
-static int __init init(void)
-{
- unsigned int i;
-
- if (!xen_domain())
- return -ENODEV;
-
- if (!xen_pv_domain())
- return 0;
-
- /*
- * Initialize with pages from the extra memory regions (see
- * arch/x86/xen/setup.c).
- */
- for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
- unsigned int j;
-
- for (j = 0; j < xen_extra_mem[i].n_pfns; j++) {
- struct page *pg =
- pfn_to_page(xen_extra_mem[i].start_pfn + j);
-
- pg->zone_device_data = page_list;
- page_list = pg;
- list_count++;
- }
- }
-
- return 0;
-}
-subsys_initcall(init);
-#endif
-
static int __init unpopulated_init(void)
{
int ret;