Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221893
b: refs/heads/master
c: 9ec23a7
h: refs/heads/master
i:
  221891: 3919798
v: v3
  • Loading branch information
Ian Campbell authored and Jeremy Fitzhardinge committed Nov 11, 2010
1 parent eaeafd9 commit fc08259
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6903591f314b8947d0e362bda7715e90eb9df75e
refs/heads/master: 9ec23a7f6d2537faf14368e066e307c06812c4ca
18 changes: 11 additions & 7 deletions trunk/arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ static unsigned long __init xen_return_unused_memory(unsigned long max_pfn,
const struct e820map *e820)
{
phys_addr_t max_addr = PFN_PHYS(max_pfn);
phys_addr_t last_end = 0;
phys_addr_t last_end = ISA_END_ADDRESS;
unsigned long released = 0;
int i;

/* Free any unused memory above the low 1Mbyte. */
for (i = 0; i < e820->nr_map && last_end < max_addr; i++) {
phys_addr_t end = e820->map[i].addr;
end = min(max_addr, end);

released += xen_release_chunk(last_end, end);
last_end = e820->map[i].addr + e820->map[i].size;
if (last_end < end)
released += xen_release_chunk(last_end, end);
last_end = max(last_end, e820->map[i].addr + e820->map[i].size);
}

if (last_end < max_addr)
Expand Down Expand Up @@ -164,6 +166,7 @@ char * __init xen_memory_setup(void)
XENMEM_memory_map;
rc = HYPERVISOR_memory_op(op, &memmap);
if (rc == -ENOSYS) {
BUG_ON(xen_initial_domain());
memmap.nr_entries = 1;
map[0].addr = 0ULL;
map[0].size = mem_end;
Expand Down Expand Up @@ -201,12 +204,13 @@ char * __init xen_memory_setup(void)
}

/*
* Even though this is normal, usable memory under Xen, reserve
* ISA memory anyway because too many things think they can poke
* In domU, the ISA region is normal, usable memory, but we
* reserve ISA memory anyway because too many things poke
* about in there.
*
* In a dom0 kernel, this region is identity mapped with the
* hardware ISA area, so it really is out of bounds.
* In Dom0, the host E820 information can leave gaps in the
* ISA range, which would cause us to release those pages. To
* avoid this, we unconditionally reserve them here.
*/
e820_add_region(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS,
E820_RESERVED);
Expand Down

0 comments on commit fc08259

Please sign in to comment.