Skip to content

Commit

Permalink
xen: fix mismerge in masking pte flags
Browse files Browse the repository at this point in the history
Looks like a mismerge/misapply dropped one of the cases of pte flag
masking for Xen.  Also, only mask the flags for present ptes.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jan 30, 2008
1 parent 261a5ec commit a89780f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ unsigned long long xen_pgd_val(pgd_t pgd)

pte_t xen_make_pte(unsigned long long pte)
{
if (pte & 1)
if (pte & _PAGE_PRESENT) {
pte = phys_to_machine(XPADDR(pte)).maddr;
pte &= ~(_PAGE_PCD | _PAGE_PWT);
}

return (pte_t){ .pte = pte };
}
Expand Down Expand Up @@ -288,10 +290,10 @@ unsigned long xen_pgd_val(pgd_t pgd)

pte_t xen_make_pte(unsigned long pte)
{
if (pte & _PAGE_PRESENT)
if (pte & _PAGE_PRESENT) {
pte = phys_to_machine(XPADDR(pte)).maddr;

pte &= ~(_PAGE_PCD | _PAGE_PWT);
pte &= ~(_PAGE_PCD | _PAGE_PWT);
}

return (pte_t){ pte };
}
Expand Down

0 comments on commit a89780f

Please sign in to comment.