Revision 8a369e20
b/xen-all.c | ||
---|---|---|
19 | 19 |
|
20 | 20 |
#include <xen/hvm/ioreq.h> |
21 | 21 |
#include <xen/hvm/params.h> |
22 |
#include <xen/hvm/e820.h> |
|
22 | 23 |
|
23 | 24 |
//#define DEBUG_XEN |
24 | 25 |
|
... | ... | |
144 | 145 |
new_block->host = NULL; |
145 | 146 |
new_block->offset = 0; |
146 | 147 |
new_block->length = ram_size; |
148 |
if (ram_size >= HVM_BELOW_4G_RAM_END) { |
|
149 |
/* Xen does not allocate the memory continuously, and keep a hole at |
|
150 |
* HVM_BELOW_4G_MMIO_START of HVM_BELOW_4G_MMIO_LENGTH |
|
151 |
*/ |
|
152 |
new_block->length += HVM_BELOW_4G_MMIO_LENGTH; |
|
153 |
} |
|
147 | 154 |
|
148 | 155 |
QLIST_INSERT_HEAD(&ram_list.blocks, new_block, next); |
149 | 156 |
|
... | ... | |
152 | 159 |
memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS), |
153 | 160 |
0xff, new_block->length >> TARGET_PAGE_BITS); |
154 | 161 |
|
155 |
if (ram_size >= 0xe0000000 ) {
|
|
156 |
above_4g_mem_size = ram_size - 0xe0000000;
|
|
157 |
below_4g_mem_size = 0xe0000000;
|
|
162 |
if (ram_size >= HVM_BELOW_4G_RAM_END) {
|
|
163 |
above_4g_mem_size = ram_size - HVM_BELOW_4G_RAM_END;
|
|
164 |
below_4g_mem_size = HVM_BELOW_4G_RAM_END;
|
|
158 | 165 |
} else { |
159 | 166 |
below_4g_mem_size = ram_size; |
160 | 167 |
} |
161 | 168 |
|
162 |
cpu_register_physical_memory(0, below_4g_mem_size, new_block->offset); |
|
163 |
#if TARGET_PHYS_ADDR_BITS > 32 |
|
169 |
cpu_register_physical_memory(0, 0xa0000, 0); |
|
170 |
/* Skip of the VGA IO memory space, it will be registered later by the VGA |
|
171 |
* emulated device. |
|
172 |
* |
|
173 |
* The area between 0xc0000 and 0x100000 will be used by SeaBIOS to load |
|
174 |
* the Options ROM, so it is registered here as RAM. |
|
175 |
*/ |
|
176 |
cpu_register_physical_memory(0xc0000, below_4g_mem_size - 0xc0000, |
|
177 |
0xc0000); |
|
164 | 178 |
if (above_4g_mem_size > 0) { |
165 | 179 |
cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size, |
166 |
new_block->offset + below_4g_mem_size);
|
|
180 |
0x100000000ULL);
|
|
167 | 181 |
} |
168 |
#endif |
|
169 | 182 |
} |
170 | 183 |
|
171 | 184 |
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size) |
Also available in: Unified diff