|
26 | 26 | bool __ro_after_init xen_pvh; |
27 | 27 | EXPORT_SYMBOL_GPL(xen_pvh); |
28 | 28 |
|
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 | | - |
70 | 29 | /* |
71 | 30 | * Reserve e820 UNUSABLE regions to inflate the memory balloon. |
72 | 31 | * |
@@ -133,3 +92,44 @@ void __init xen_reserve_extra_memory(struct boot_params *bootp) |
133 | 92 | xen_add_extra_mem(PFN_UP(e->addr), pages); |
134 | 93 | } |
135 | 94 | } |
| 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