summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-01-15 01:55:44 +0300
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-14 18:17:13 +0300
commit146c4e511717e581065800938537b276173d8548 (patch)
tree7894b82558b3c5c3fd6e939a73bd99bc3d16468b /arch/x86
parentfc25151d9ac7d809239fe68de0a1490b504bb94a (diff)
downloadlinux-146c4e511717e581065800938537b276173d8548.tar.xz
xen/m2p: No need to catch exceptions when we know that there is no RAM
.. 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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/xen/page.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 78ebbeb88d9c..195707060493 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -85,6 +85,10 @@ 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).
@@ -92,7 +96,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
* 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