diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-08-31 17:06:22 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-10-22 15:57:26 -0400 |
commit | cfd8951e082a589637f9de3c33efd3218fdb3c03 (patch) | |
tree | e4b55dc7c0aa6dce4e022d1162abfd2633758720 /arch/x86/include/asm/xen | |
parent | 33a847502b0338351cebd8fc0c68ac796cfadbbd (diff) |
xen: don't map missing memory
When setting up a pte for a missing pfn (no matching mfn), just create
an empty pte rather than a junk mapping.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/xen')
-rw-r--r-- | arch/x86/include/asm/xen/page.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index e40ca6e67bb5..875f5a08a6c7 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -41,10 +41,17 @@ extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); | |||
41 | 41 | ||
42 | static inline unsigned long pfn_to_mfn(unsigned long pfn) | 42 | static inline unsigned long pfn_to_mfn(unsigned long pfn) |
43 | { | 43 | { |
44 | unsigned long mfn; | ||
45 | |||
44 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 46 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
45 | return pfn; | 47 | return pfn; |
46 | 48 | ||
47 | return get_phys_to_machine(pfn) & ~FOREIGN_FRAME_BIT; | 49 | mfn = get_phys_to_machine(pfn); |
50 | |||
51 | if (mfn != INVALID_P2M_ENTRY) | ||
52 | mfn &= ~FOREIGN_FRAME_BIT; | ||
53 | |||
54 | return mfn; | ||
48 | } | 55 | } |
49 | 56 | ||
50 | static inline int phys_to_machine_mapping_valid(unsigned long pfn) | 57 | static inline int phys_to_machine_mapping_valid(unsigned long pfn) |