Skip to content

Commit 87ca46b

Browse files
roygeropsiff
authored andcommitted
x86/xen: move xen_reserve_extra_memory()
commit fc05ea8 upstream. In preparation for making the function static. No functional change. Signed-off-by: Roger Pau Monné <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Message-ID: <[email protected]> Signed-off-by: Juergen Gross <[email protected]> [ Stable backport - move the code as it exists ] Signed-off-by: Jason Andryuk <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit fa1103f)
1 parent 77fa23c commit 87ca46b

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

arch/x86/xen/enlighten_pvh.c

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,47 +26,6 @@
2626
bool __ro_after_init xen_pvh;
2727
EXPORT_SYMBOL_GPL(xen_pvh);
2828

29-
void __init xen_pvh_init(struct boot_params *boot_params)
30-
{
31-
xen_pvh = 1;
32-
xen_domain_type = XEN_HVM_DOMAIN;
33-
xen_start_flags = pvh_start_info.flags;
34-
35-
if (xen_initial_domain())
36-
x86_init.oem.arch_setup = xen_add_preferred_consoles;
37-
x86_init.oem.banner = xen_banner;
38-
39-
xen_efi_init(boot_params);
40-
41-
if (xen_initial_domain()) {
42-
struct xen_platform_op op = {
43-
.cmd = XENPF_get_dom0_console,
44-
};
45-
int ret = HYPERVISOR_platform_op(&op);
46-
47-
if (ret > 0)
48-
xen_init_vga(&op.u.dom0_console,
49-
min(ret * sizeof(char),
50-
sizeof(op.u.dom0_console)),
51-
&boot_params->screen_info);
52-
}
53-
}
54-
55-
void __init mem_map_via_hcall(struct boot_params *boot_params_p)
56-
{
57-
struct xen_memory_map memmap;
58-
int rc;
59-
60-
memmap.nr_entries = ARRAY_SIZE(boot_params_p->e820_table);
61-
set_xen_guest_handle(memmap.buffer, boot_params_p->e820_table);
62-
rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
63-
if (rc) {
64-
xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
65-
BUG();
66-
}
67-
boot_params_p->e820_entries = memmap.nr_entries;
68-
}
69-
7029
/*
7130
* Reserve e820 UNUSABLE regions to inflate the memory balloon.
7231
*
@@ -133,3 +92,44 @@ void __init xen_reserve_extra_memory(struct boot_params *bootp)
13392
xen_add_extra_mem(PFN_UP(e->addr), pages);
13493
}
13594
}
95+
96+
void __init xen_pvh_init(struct boot_params *boot_params)
97+
{
98+
xen_pvh = 1;
99+
xen_domain_type = XEN_HVM_DOMAIN;
100+
xen_start_flags = pvh_start_info.flags;
101+
102+
if (xen_initial_domain())
103+
x86_init.oem.arch_setup = xen_add_preferred_consoles;
104+
x86_init.oem.banner = xen_banner;
105+
106+
xen_efi_init(boot_params);
107+
108+
if (xen_initial_domain()) {
109+
struct xen_platform_op op = {
110+
.cmd = XENPF_get_dom0_console,
111+
};
112+
int ret = HYPERVISOR_platform_op(&op);
113+
114+
if (ret > 0)
115+
xen_init_vga(&op.u.dom0_console,
116+
min(ret * sizeof(char),
117+
sizeof(op.u.dom0_console)),
118+
&boot_params->screen_info);
119+
}
120+
}
121+
122+
void __init mem_map_via_hcall(struct boot_params *boot_params_p)
123+
{
124+
struct xen_memory_map memmap;
125+
int rc;
126+
127+
memmap.nr_entries = ARRAY_SIZE(boot_params_p->e820_table);
128+
set_xen_guest_handle(memmap.buffer, boot_params_p->e820_table);
129+
rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
130+
if (rc) {
131+
xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
132+
BUG();
133+
}
134+
boot_params_p->e820_entries = memmap.nr_entries;
135+
}

0 commit comments

Comments
 (0)