Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234168
b: refs/heads/master
c: fb38923
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Mar 14, 2011
1 parent b3fbf19 commit 3ed2224
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 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: f4cec35b0d4b90d96e3770a3d1e68ea882e7a7c8
refs/heads/master: fb38923ead10aa8a28db191548e176e8856614d7
18 changes: 16 additions & 2 deletions trunk/arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,12 @@ static pteval_t pte_pfn_to_mfn(pteval_t val)
if (val & _PAGE_PRESENT) {
unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
pteval_t flags = val & PTE_FLAGS_MASK;
unsigned long mfn = pfn_to_mfn(pfn);
unsigned long mfn;

if (!xen_feature(XENFEAT_auto_translated_physmap))
mfn = get_phys_to_machine(pfn);
else
mfn = pfn;
/*
* If there's no mfn for the pfn, then just create an
* empty non-present pte. Unfortunately this loses
Expand All @@ -427,8 +431,18 @@ static pteval_t pte_pfn_to_mfn(pteval_t val)
if (unlikely(mfn == INVALID_P2M_ENTRY)) {
mfn = 0;
flags = 0;
} else {
/*
* Paramount to do this test _after_ the
* INVALID_P2M_ENTRY as INVALID_P2M_ENTRY &
* IDENTITY_FRAME_BIT resolves to true.
*/
mfn &= ~FOREIGN_FRAME_BIT;
if (mfn & IDENTITY_FRAME_BIT) {
mfn &= ~IDENTITY_FRAME_BIT;
flags |= _PAGE_IOMAP;
}
}

val = ((pteval_t)mfn << PAGE_SHIFT) | flags;
}

Expand Down

0 comments on commit 3ed2224

Please sign in to comment.