diff options
-rw-r--r-- | arch/x86/include/asm/xen/page.h | 6 |
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) | |||
85 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 85 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
86 | return mfn; | 86 | return mfn; |
87 | 87 | ||
88 | if (unlikely((mfn >> machine_to_phys_order) != 0)) { | ||
89 | pfn = ~0; | ||
90 | goto try_override; | ||
91 | } | ||
88 | pfn = 0; | 92 | pfn = 0; |
89 | /* | 93 | /* |
90 | * The array access can fail (e.g., device space beyond end of RAM). | 94 | * 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) | |||
92 | * but we must handle the fault without crashing! | 96 | * but we must handle the fault without crashing! |
93 | */ | 97 | */ |
94 | __get_user(pfn, &machine_to_phys_mapping[mfn]); | 98 | __get_user(pfn, &machine_to_phys_mapping[mfn]); |
95 | 99 | try_override: | |
96 | /* | 100 | /* |
97 | * If this appears to be a foreign mfn (because the pfn | 101 | * If this appears to be a foreign mfn (because the pfn |
98 | * doesn't map back to the mfn), then check the local override | 102 | * doesn't map back to the mfn), then check the local override |