Skip to content

Commit

Permalink
xen/m2p: No need to catch exceptions when we know that there is no RAM
Browse files Browse the repository at this point in the history
.. beyound what we think is the end of memory. However there might
be more System RAM - but assigned to a guest. Hence jump to the
M2P override check and consult.

[v1: Added Review-by tag]

Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Mar 14, 2011
1 parent fc25151 commit 146c4e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/x86/include/asm/xen/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
if (xen_feature(XENFEAT_auto_translated_physmap))
return mfn;

if (unlikely((mfn >> machine_to_phys_order) != 0)) {
pfn = ~0;
goto try_override;
}
pfn = 0;
/*
* The array access can fail (e.g., device space beyond end of RAM).
* In such cases it doesn't matter what we return (we return garbage),
* but we must handle the fault without crashing!
*/
__get_user(pfn, &machine_to_phys_mapping[mfn]);

try_override:
/*
* If this appears to be a foreign mfn (because the pfn
* doesn't map back to the mfn), then check the local override
Expand Down

0 comments on commit 146c4e5

Please sign in to comment.