Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329164
b: refs/heads/master
c: 3fc509f
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Aug 23, 2012
1 parent f031e24 commit 3f6e498
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 785f62314984ea3af9dd830b020289ba2509ae69
refs/heads/master: 3fc509fc0c590900568ef516a37101d88f3476f5
14 changes: 11 additions & 3 deletions trunk/arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ unsigned long __init xen_revector_p2m_tree(void)
unsigned long va_start;
unsigned long va_end;
unsigned long pfn;
unsigned long pfn_free = 0;
unsigned long *mfn_list = NULL;
unsigned long size;

Expand Down Expand Up @@ -442,11 +443,18 @@ unsigned long __init xen_revector_p2m_tree(void)
if (mid_p >= (unsigned long *)va_start && mid_p <= (unsigned long *)va_end) {
unsigned long *new;

new = &mfn_list[pfn];
if (pfn_free > (size / sizeof(unsigned long))) {
WARN(1, "Only allocated for %ld pages, but we want %ld!\n",
size / sizeof(unsigned long), pfn_free);
return 0;
}
new = &mfn_list[pfn_free];

copy_page(new, mid_p);
p2m_top[topidx][mididx] = &mfn_list[pfn];
p2m_top_mfn_p[topidx][mididx] = virt_to_mfn(&mfn_list[pfn]);
p2m_top[topidx][mididx] = &mfn_list[pfn_free];
p2m_top_mfn_p[topidx][mididx] = virt_to_mfn(&mfn_list[pfn_free]);

pfn_free += P2M_PER_PAGE;

}
/* This should be the leafs allocated for identity from _brk. */
Expand Down

0 comments on commit 3f6e498

Please sign in to comment.